fix(spec): warn loudly on view-key collisions in expandViewContainer#2556
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 98 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
added a commit
that referenced
this pull request
Jul 4, 2026
…nostics) #2556 (view-key collision boot warnings) landed on main while this branch was open. Reconciled by keeping BOTH: the merged `expandViewContainerWithDiagnostics` now pushes `collisions[]` (consumed by the new build-time `lint-view-refs`) AND stamps per-item `_diagnostics` (consumed by the boot loaders) at the same detection points. view-expand keeps both test suites (17 pass); showcase view/ action conflicts merged; .objectui-sha takes main's pin; api-surface unchanged; full turbo build 71/71. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
list/form views share one <object>.<key> namespace during container expansion; a colliding key (e.g. formViews.default vs the implicit default list) was silently renamed to <key>_2, so action targets and navigation viewNames referencing the requested name resolved to the OTHER view — the root cause of the showcase "Log Time" form action opening the list view and rendering a black/empty form. - spec: ExpandedViewItem gains optional _diagnostics; uniqueViewName renames now stamp a warning naming both views and the blast radius. - objectql engine + metadata plugin: log expansion warnings at boot. - app-showcase: rename formViews.default -> edit and point showcase_log_time's target at showcase_task.edit (with comments documenting the collision). - tests: 3 new cases covering collision warnings and the clean path. Closes #2554 Co-Authored-By: Claude <noreply@anthropic.com>
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.
Closes #2554
问题
expandViewContainer中 list/form 视图共享同一个<object>.<key>命名空间。key 冲突时(典型:formViews.default撞上主list隐式占用的default),uniqueViewName把后注册者静默改名为<key>_2— 零告警。所有引用原名的地方(form action 的target、导航viewName)会解析到另一个视图。showcase 实锤链路(P0-8/19/20):
showcase_log_timeactiontarget: 'showcase_task.default'意图打开 form,但showcase_task.default实际是 list 视图(form 被改名成default_2)→ FormPage 渲染 list 视图配置 → 零字段黑屏 + 提交误报成功。修复
保持改名行为不变(向后兼容),但让冲突可见:
view.zod.ts):ExpandedViewItem增加可选_diagnostics字段(复用MetadataValidationResult的{valid, warnings:[{path,message}]}形状);四个注册点在发生改名时打上 warning,消息点名两个视图名和影响面。engine.ts) / metadata (plugin.ts):两个展平 loader 在启动时把_diagnostics.warnings写进日志。formViews.default→edit,showcase_log_time.target→showcase_task.edit,注释说明冲突原因。测试
packages/metadata/src/view-expand.test.ts新增 3 个用例:form/list 冲突带 warning、formViews 撞 listViews key、无冲突不打_diagnostics。@objectstack/spec6669 tests pass;@objectstack/objectql737 pass;@objectstack/metadata257 pass。Co-Authored-By: Claude noreply@anthropic.com