Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… priority for live preview
- Remove key={refreshKey} from PluginObjectView to allow config changes to propagate
without requiring component remount (save). Props changes now flow naturally.
- Fix navigation overlay to use activeView.navigation with priority over objectDef.navigation,
enabling view-level navigation mode changes to take effect immediately.
- Mock ListView in tests to isolate data flow verification from async rendering effects.
- Add tests for live preview of showRecordCount, allowPrinting, and label changes.
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot 仔细评估是否已经完成了任务中要求的所有开发 |
…and navigation mode - Enhance ListView mock to render selection.type, addRecord.enabled, and addRecordViaForm - Add test: selection mode change propagates to ListView schema in real-time - Add test: addRecord toggle propagates both addRecord and addRecordViaForm to ListView - Add test: navigation mode change from config panel propagates to ListView schema live - Strengthen navigation priority test to verify ListView receives view-level navigation Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
经过仔细评估,已完成补充。以下是完整的完成状态: Issue 要求 1 — 配置面板属性实时生效(Live Preview):✅ 已完成
Issue 要求 2 — 导航模式(navigation)实时同步:✅ 已完成
Issue 要求 3 — Toolbar/Actions 属性实时生效:✅ 已完成
Issue 要求 4 — 自动化测试覆盖所有场景:✅ 已在
ROADMAP 更新:✅ 已完成(root causes #10 和 #11) 全部 31 个测试通过,0 回归。 |
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical UX issue where ListView config panel property changes required clicking "Save" to take effect. The root cause was twofold: (1) key={refreshKey} on PluginObjectView forced full remounts only on save/create, preventing prop-driven re-rendering, and (2) detail overlay navigation ignored view-level config in favor of object-level config.
Changes:
- Removed
key={refreshKey}from PluginObjectView to enable natural React prop-based updates - Added navigation priority chain:
activeView.navigation > objectDef.navigation > default drawer - Added comprehensive test coverage (8 new tests) validating live preview for all config properties
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/console/src/components/ObjectView.tsx | Removed key={refreshKey} from PluginObjectView (line 576); Added view-level navigation priority in detailNavigation (line 234) |
| apps/console/src/tests/ObjectView.test.tsx | Added ListView mock isolating data flow assertions; Added 8 comprehensive live preview tests covering showRecordCount, allowPrinting, selection, addRecord, navigation mode, label changes, multiple simultaneous changes, and navigation priority |
| ROADMAP.md | Documented root causes #10 (key={refreshKey} blocking live preview) and #11 (navigation not consuming activeView.navigation) |
Config panel property changes (showRecordCount, allowPrinting, addRecord, selection, navigation mode, etc.) required clicking Save to take effect. The data flow
viewDraft → activeView → mergedViews → PluginObjectViewwas correct, but two issues blocked live preview.key={refreshKey}on PluginObjectViewrefreshKeyonly incremented on save/create. React keying forced a full remount as the only update path, making prop-driven re-rendering a no-op between saves.Navigation overlay ignoring view-level config
Detail overlay only consumed
objectDef.navigation, so switching navigation mode (drawer/modal/split/popover) in the config panel had no effect.Tests
showRecordCountandallowPrintingtoggles propagate to ListView schema in real-timeselectionmode change propagates to ListView schema in real-timeaddRecordtoggle propagates bothaddRecordandaddRecordViaFormto ListViewnavigationmode change from config panel propagates to ListView schema liveactiveView.navigation > objectDef.navigation)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.