Repository navigation
fix(app-shell): inside a package's second app, the sidebar and nav:menu links stay in that app - #29430
Merged
Conversation
… app by name Build the sidebar's nav basePath, the area-election route basePath and the nav:menu block's basePath on appAddressSegment over the full metadata app list instead of appRouteSegment (the package id), which opens the package's first app. A package's first or only app keeps its package-id address. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUtBT7bo7SPANQh2LX
The utils barrel does not re-export it; AppContent and CommandPalette import it from utils/appRoute.js the same way. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUtBT7bo7SPANQh2LX
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T15:02ZHead-sha:
|
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.
Requested by Steedos · project thread
Fixes #29328
Clause-②: no
Metadata-protocol: none
The two lines are copied from the claim (comment 6577088246).
维护者速读
nav:menu页面块的链接前缀,改为用应用自己的地址appAddressSegment(在完整应用元数据列表中求值):包 ID 能回到这个应用时用包 ID,否则用应用名。/apps/包ID总是打开该包的第一个应用。一个包里有两个应用(例如crm与crm_service)时,在第二个应用里点侧边栏任何一项,都会跳进第一个应用,换成别的应用的导航、顶栏和首页。console avatar menu: a hidden app that shares its package with the package's first app opens the first app instead of itself #29024 已经修了头像菜单、⌘K、应用切换器、首页磁贴和报表索引,侧边栏还是旧算法。appAddressSegment是AppContent已在用的现有函数,不新增导出。回滚即撤销本 PR。layout/UnifiedSidebar.tsx的两处basePath(areaRoute与导航);views/nav-menu-renderer.tsx的basePath;新测试UnifiedSidebar.packageAppAddress-29328.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/layout/__tests__/UnifiedSidebar.packageAppAddress-29328.test.tsx packages/app-shell/src/views/__tests__/nav-menu.packageAppAddress-29328.render.test.tsx,预期 7 个用例通过(在 main 上其中 3 个第二应用用例为红)。What changes
layout/UnifiedSidebar.tsx): the navbasePathevery entry link is built on, and thebasePathof the route the area election reads, are/apps/plusappAddressSegment(apps, activeApp)over the full metadata app list (the listAppContentresolves/apps/SEGMENTon), instead ofappRouteSegment(activeApp), the package id. Inside a package's second app the area holding the routed entry is now elected too: with the package-id prefix no entry of the second app matched the route.nav:menublock (views/nav-menu-renderer.tsx): itsbasePathis built the same way.appAddressSegmentfromutils/appRoute.js, asAppContentandCommandPalettedo; theutilsbarrel does not re-export it, and the sidebar tests that mock the barrel keep working unchanged.Tests
layout/__tests__/UnifiedSidebar.packageAppAddress-29328.test.tsx, through the realUnifiedSidebar,NavigationRendererand route helpers (theutilsmodule is not mocked):com.example.crmshipscrm(first) andcrm_service(two areas);com.example.hrshipshralone. Insidecrm_servicean entry links to/apps/crm_service/crm_queue; at/apps/crm_service/crm_casethe Casework area is elected and its object and dashboard entries link intocrm_service. Controls:crmkeeps/apps/com.example.crm/...,hrkeeps/apps/com.example.hr/....views/__tests__/nav-menu.packageAppAddress-29328.render.test.tsx, through the realnav:menublock underSchemaRendererandMePermissionsProvider: insidecrm_serviceits object and dashboard links carry/apps/crm_service/...; the same two controls.origin/main2f7977cdbefore the fix: 3 failed (the three second-app cases; received/apps/com.example.crm/crm_queue,/apps/com.example.crm/crm_caseand the first area elected), 4 passed (the controls).Acceptance notes
appRouteSegment(app)link builders (AppSwitcher's setup path, the marketplace deploy button, ConsoleShell's setup alias).Verification
Head
ada58c18. The fix is commits23551407andc1354524(based onorigin/main2f7977cd);ada58c18mergesorigin/mainafter PR #29327 and PR #29325 landed (none of this PR's files changed; clean). The branch's delta againstmainis the five files above. Readings name their head; the final head's are CI's check-runs.Tests
ada58c18, after rebuilding the app-shell dependency closure: every ui test file namingUnifiedSidebar,nav-menu-rendererorNavMenuRenderer(70 files, the two new ones included): 70 passed, 553 tests passed, at--maxWorkers=2under the verification lock. The same set on the fix head before the merge: 69 files, 546 tests passed.turbo run type-check --filter=@object-ui/app-shell(tsc --noEmitand the test tsconfig): 65 of 65 tasks successful on the fix head and again onada58c18.Gates
ada58c18:node scripts/pm/dispatch-gates.mjs --commandsderived 34 families for this diff (the same list as on the fix head); all 34 ran with exit 0,pnpm --dir ui exec vitest run scripts/among them (169 files passed, 2 skipped; 4921 tests passed).--ranreconciled 34 derived, 34 run, 0 NOT-MEASURED. The changeset, ADR-0087, closing-keyword and Part-of gates ran against this body.node scripts/check-sdui-manifest.mjs: exit 0 (no registry change).pnpm check:new-line-citations(underui/): 0 new citations.Generated by Claude Code