fix(admin): avoid stale title overwrite in custom modal#1786
Merged
coltea merged 2 commits intochaitin:mainfrom Apr 15, 2026
Merged
fix(admin): avoid stale title overwrite in custom modal#1786coltea merged 2 commits intochaitin:mainfrom
coltea merged 2 commits intochaitin:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an admin-side issue where editing in the CustomModal could be overwritten by subsequent “hydration” from preview/config data, by stabilizing debounced updates and preventing initial form resets from triggering preview writes.
Changes:
- Stabilize and clean up the debounced
setAppPreviewDatadispatcher hook. - Refactor Header/Footer config forms to use
reset()for hydration and skip the first “sync back to preview” after hydrating. - Adjust effect dependencies/cleanup around preview updates.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
web/admin/src/hooks/useDebounceAppPreviewData.tsx |
Memoizes the debounced dispatcher and cancels it on unmount to avoid stale debounced callbacks. |
web/admin/src/components/CustomModal/components/config/HeaderConfig.tsx |
Uses reset() + hydration guard to avoid overwriting user edits when preview data changes. |
web/admin/src/components/CustomModal/components/config/FooterConfig.tsx |
Uses reset() + hydration guard to reduce unintended overwrites during initial hydration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 标题
修复管理端存在覆盖配置项的问题
变更类型
请勾选适用的变更类型:
变更内容
详细描述本次 PR 的具体变更内容:
测试情况
描述本次变更的测试情况:
其他说明
任何其他需要说明的事项: