Uh oh!
There was an error while loading. Please reload this page.
fix(app-shell): sys-objects 的三个生产端直发规范 metadata 路由,不再绕 system/metadata 别名 (#3739) - #3748
Merged
Merged
Conversation
…l metadata route (#3739) `AppSidebar.systemFallbackNavigation`, `UnifiedSidebar.homeNavigation` and `console/home/QuickActions` all aimed at `/apps/setup/system/metadata/object`. That spelling is not a page: `apps/console`'s host fragment declares `system/metadata/:metadataType` with `MetadataRedirect` as its element, a bare Navigate onto `/apps/setup/metadata/object` — the engine's real route. Every click paid a redundant hop plus a re-render. Same defect #3660 fixed for `sys-datasources`, declared one line below `sys-objects` in both sidebar arrays; it was missed there because the two entries reach their aliases through different route tables (app-shell's `component/metadata/resource` vs the host's `system/metadata/:type` rewrite). Endpoints are byte-identical to what the alias hop computed; only the intermediate hop is gone. The alias routes are untouched and stay reachable for bookmarks and external links. Pins: `systemNavObjectsHop.test.tsx` measures the redirect chain for both sidebars (one entry = direct arrival) with a CONTROL case proving the alias still forwards; `systemNavSettingsTarget.test.tsx` and `QuickActions.settingsTarget.test.tsx` pin the URL each of the three producers emits. #3611's "the sibling card is unchanged" anchor in the QuickActions suite is rewritten rather than extended — that premise is what this issue falsified. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
The latest updates on your projects. Learn more about Vercel for GitHub. |
yinlianghui
commented
Aug 8, 2026
CollaboratorAuthor
越界发现已另行记录为 #3749(observation-class, Generated by Claude Code Generated by Claude Code |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 8, 2026 11:36
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 8, 2026
akarma-synetal pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 10, 2026
…ectstack-ai#3858) objectstack-ai#3712 / PR objectstack-ai#3732 的围栏(MetadataManagerPage / listComponent 一族)之外, P1.12.3 与 P1.16 两节还剩九条失实条目。手法沿 objectstack-ai#3700 / PR objectstack-ai#3705、objectstack-ai#3704 / PR objectstack-ai#3714、objectstack-ai#3712 / PR objectstack-ai#3732:条目一律不删、就地按现实改写、原 [x] 保留、 错误名保留作纠错锚且判词紧跟其后、引用只挂裸文本编号、不种新计数。 P1.12.3 四条: - metadataTypeRegistry —— 全仓零命中。但它并非"从未存在":文件确实以 apps/console/src/config/metadataTypeRegistry.ts 落过地(d601ef6 加入), 在 ff9a0d9(移除 studio app、迁往 metadata-admin 引擎)被删。今天的等价物 是引擎自己的 MetadataResourceRegistry (packages/app-shell/src/views/metadata-admin/registry.ts),行类型 MetadataResourceConfig,由 registerMetadataResource() 填;且未注册的类型 同样可列可编,注册只是覆写默认值 —— "centralized config" 的语义也变了。 - SystemHubPage 注册表生成卡片 —— metadataTypeCards 是手写字面量 (Applications / Metadata / Datasources),其上方注释自述 per-type 卡片 在引擎开始自动列举全部类型后即被移除;dashboard / page / report 三张卡 都不存在。真正按注册表列举类型的是引擎的 MetadataDirectoryPage。 - 动态 /system/metadata/:metadataType —— 该拼法只在 console host fragment (apps/console/src/AppContent.tsx)声明,三种 arity 的 route element 都是 MetadataRedirect,并非页面。真正渲染的动态路由是引擎的 metadata/:type (packages/app-shell/src/console/AppContent.tsx);"in all route contexts" 这半句对它成立(with-app 与 zero-app 两支都声明了),故如实保留。 - app / object 专属路由 —— app 仍成立(system/apps → AppManagementPage); object 已无专属页,由引擎通用外壳承载,配置见 builtinComponents.tsx 与 views/metadata-admin/anchors.ts 的 registerMetadataResource({ type: 'object', … }),只给列/搜索字段/建单字段/锚点,无组件覆写。全仓仅 permission(EditPage)与 datasource(ListPage)替换外壳页。 P1.16 四条 + :1001: - listMode / MetadataTypeConfig / MetadataGrid 三个符号全仓零命中; MetadataResourceConfig 没有任何渲染模式键,列形状只有 listColumns (加 ListPage 整页替换)。 - "grid mode 下的表格渲染"—— 表格是真的,但不是一档模式: ResourceListPage 对所有类型无条件渲染同一个 table,无分支可切。 - report 一条须订正卡片正文的举证:report **有** registerMetadataResource 注册(anchors.ts,基线 4e93e40 上即已存在),卡片正文"零注册"的 grep 结论有误。真实判词是:注册项里没有任何东西选择渲染模式(因为无模式 可选),它配的是对象锚点组与建单种子。 - :1001 按分诊注记逐入口分别判,且前提已部分过期:卡片正文称 sidebar / QuickActions 仍指 legacy 别名,而 objectstack-ai#3739 / PR objectstack-ai#3748 已合并 —— 两个 sidebar 的 sys-objects 与 home 的 manage-objects 现均指引擎正规路由 /apps/setup/metadata/object;hub cards 本就没有 object 卡。故三个入口 今天没有一个指向该拼法,离开的原因各不相同,如实分述。 围栏内只动这九行。节标题 **Metadata Manager Grid Mode:** 依"错误名留作 纠错锚"之例不动;:865 的 MetadataService 三个方法经核实真实存在,不在改写 之列。 Fixesobjectstack-ai#3738 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 freeto 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.
Fixes#3739
前提核验(issue body 只是线索)
在
origin/main@8ad6070fb上逐条复核,三处调用点全部仍在发 legacy 别名,premise 成立:规范目标也核到了:
packages/app-shell/src/console/AppContent.tsx:641的metadata/:type→MetadataResourceListPage,两个分支都声明。别名一侧由apps/console/src/AppContent.tsx:189-191的system/metadata/:metadataType→MetadataRedirect服务,它就是一个Navigate,目标恰好是本 PR 写进导航项的那个 URL。另外确认在途无人改动这三个文件(PR #3728 今天只碰了 apps/console 的 AppContent)。改了什么
三处生产端一律改指
/apps/setup/metadata/object,并按 #3660 在同一数组下一行留下的注释形状、逐文件沿用该文件既有注释习惯,各写一段判词。落地页面逐字节不变 —— 新 URL 就是别名跳转本来算出来的那个(
object百分号编码即自身,三处都不带 query/hash);消失的只有中间那一跳和随之而来的 re-render。别名路由一行未动,书签与外链继续能到,只是我们自己的导航不再往里喂流量。顺手修掉一句被本次改动证伪的旧注释:两个侧边栏 #3590 段末的「Every sibling below already spells
/apps/setup/system/...」。它在 #3660 之后对sys-datasources已经不成立,本 PR 让它对sys-objects也不成立 —— 留着会诱导下一个 agent 为了「前缀一致」把 URL 改回去,所以改写为「这两个 metadata-admin 条目名的是引擎的规范路由;此处的不变量不是前缀一致,而是名字指向真正渲染的那条路由」。测试
按这一族已有的模式加/改,分两层:
packages/app-shell/src/layout/__tests__/systemNavObjectsHop.test.tsx——systemNavDatasourcesHop.test.tsx的孪生件,量的是跳数而非终点:href 从两个侧边栏的真实渲染里读出来,丢进同时认识规范路由与别名的 router,ChainRecorder记录每一个落点,一条 = 直达。两个文件分开放,因为要镜像的别名路由不同(本文件镜像apps/console的MetadataRedirect,与AppContent.noAppComponentRoutes.test.tsx同源同做法)。第三个 case 是 CONTROL:别名依然能解析,且解析要付那一跳 —— 别名可用是契约的一部分,不是附带损害;它同时证明前两条断言不空转。systemNavSettingsTarget.test.tsx:ADMINISTRATION_ENTRIES的Object Manager换成规范 URL,并给 AppSidebar 那一半补上同形状断言(两个侧边栏各持一份字面量,只钉一份就能单边漂回去 —— 这正是 导航仍有 4 处生产端在生成已废弃的 component/metadata 别名(SystemHub 两张卡片 + 两个 sidebar),各多绕一跳 #3660 给Datasources补断言的理由)。QuickActions.settingsTarget.test.tsx第三个 case。它原本叫「REGRESSION: the sibling card that was already hub-scoped is unchanged」,钉的正是我要改的那个字面量 —— 这个前提就是本 issue 证伪的东西,所以整条重写而非并存(沿用该族「只钉修好的形状,不同时钉 bug 和 fix」的纪律)。三处都按 #3660/#3609 的做法替换旧期望,不与旧形状并存。
反向验证(先预测,再运行)
预测:只把三处生产端 URL 改回别名、测试不动,应有 9 条中 5 条转红 —— hop 文件两条 sidebar case、settings-target 文件 AppSidebar 与九条目循环、QuickActions 的 manage-objects;CONTROL、dormancy、system-settings、non-admin 四条保持绿。并预测 hop 文件会先死在
expect(href).toBe(CANONICAL)这个前置断言上,因此那条「两跳链」并不会出现在 diff 里。实测与预测逐条吻合:
随后
git checkout --复原,工作树干净。消费半径全量(不止改动包)
一条被改的 URL 在哪里被消费就在哪里可能碎,所以按调用面而非按包跑:app-shell 的
layout/__tests__、console/__tests__、console/home/__tests__,加上apps/console的别名钉(AppContent.legacyRedirects.test.tsx)与 #3660 的 System Hub 卡片钉。apps/console的 legacyRedirects 测试一行未动,并且照旧全绿 —— 本 PR 只重指内部生产端,别名本身必须继续为外部到访服务。其余门禁:
@object-ui/app-shell的type-check干净;eslint对六个改动文件 0 error(新测试文件单跑 0 findings);check-control-bytesOK,并对改动文件另跑了一次手工控制字节扫描(gate 的盲区正是这类字节藏身处)。Changeset
.changeset/nav-sys-objects-canonical-route-3739.md,@object-ui/app-shell: patch。里面如实写了:三个生产端中两个侧边栏是活的,QuickActions今天没有任何 JSX 调用点(其自身测试里有一条 dormancy 前置断言在钉这件事),所以那一处是「哪天有人把它挂回 /home,死链不会跟着回来」的守卫,而非用户可见变化。范围
只碰 issue 点名的三个文件与它们的测试。发现了一处越界项已另行开 issue 记录(见下方评论),没有在本 PR 里动:
AppContent.noAppComponentRoutes.test.tsx/AppContent.pseudoRouteSegments.test.tsx的头注释把这两个条目当作现在还在发别名的生产端来枚举 —— #3660 之后sys-datasources那一行已经陈旧,本 PR 让sys-objects那一行也陈旧。两处测试断言本身都是从 URL 直接进入、量别名路由的行为,别名保留,因此仍然正确、仍然全绿;陈旧的只有叙述。参照 #3660 把同类注释改写单独立为 #3666 的先例,归为独立 issue。🤖 Generated with Claude Code
https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Generated by Claude Code