Repository navigation
perf(app-shell): a console-created app's object and page routes read what they name by name - #29542
Merged
Merged
Conversation
…e read what they name by name The nav gate asks its cross-app union without views, a package-less app's object route reads its object and lookup targets through the names-only scope, a page the app bundle does not hold is read by name under the prefer-local rule, and a names-only scope composes the views of the names its reader asked. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTxHVLQcafzV1G73bX
…iew labels and the phone title's page read Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTxHVLQcafzV1G73bX
…pp list names its app Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTxHVLQcafzV1G73bX
…page read by name in the existing route pins Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTxHVLQcafzV1G73bX
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTxHVLQcafzV1G73bX
This was referenced Nov 2, 2026
Contributor
Author
|
domain:ui#3 · zhuangjianguo · session_01QsR2jV4dWohojjbTJTQq5m 席位核对 · ACCEPT · 2026-11-02T18:39ZHead-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 #29416
Clause-②: no
Metadata-protocol: none
Claim: 6581096637 · amendments: 6581167613, 6581536193
维护者速读
requiresObject和查找字段目标,不再读整张对象注册表。应用包(bundle)里没有的页面按名读单条,不再读整张/meta/page列表。ui/packages/app-shell/src/console/appObjectScope.ts(readObjectRouteNames)、ui/packages/app-shell/src/hooks/useObjectPresence.ts(readItemPreferLocal)、ui/packages/app-shell/src/providers/MetadataProvider.tsx:1744(按名读取只组合提问者所问名字的视图)。meta/object:应该没有不带名字的GET /api/v1/meta/object。再打开该应用里一个包外页面:应该是GET /api/v1/meta/page/<名字>,没有/meta/page整表,也没有/meta/view。What changes
An app created in the console has no
_packageId. On such an app, three readers still downloaded a whole metadata list. A page outside the app bundle had the same problem in any app.useNavMemberGatesinside a package-less appreadObjectScope({ names: unionNames })with views. The union names other apps' objects outside this bundle, so composing their views read the whole/meta/viewlist.{ names: unionNames, views: false }, the same call it already made outside an app and on the package leg. Nothing in the app reads views off this presence answer.MetadataProvidernames-only compose (probe-proved, amendment 6581536193)MetadataProvider.tsx:1744).readAppObjectScopefor a package-less app's object routereadObjectRouteNames(appObjectScope.ts:547) reads the route's object, the app'srequiresObjectnames and the palette's nav objects by name. It reads the object's lookup targets by name withviews: false. Until the app list names the app, nothing is read (a candidate without a known package must not ask early). The app's root still reads the whole registry, as before.useServedViewItemsnames-only branch (amendment 6581536193)requiresObjectonly, so a route object named only by a navigation entry lost its served view labels once the registry was no longer loaded.packagelessAppObjectNames(app): navigationtype: 'object'names plusrequiresObject, acrossnavigationand everyareas[].navigation.AppContent's page scope,PageView,AppHeader's phone titlepreferLocal(metadata.pages, name, _packageId): the whole/meta/pagelist.readItemPreferLocal(useObjectPresence.ts:190), built onuseReadItemsByNamefrom #29413. While the type is idle, it asks the page by name. It takes the answer when the app has no package, or when the answer is the app package's own. Otherwise (another package's page, or no page) it falls back to the list, so the item is always the onepreferLocalwould pick. Once the list is loading or loaded, it reads the list and asks nothing.Tests
console/__tests__/AppContent.packagelessReads-29416.test.tsx(7). These use the realAppContent,PageViewandMetadataProvider, with a recording adapter and a ready app bundle.object,vieworpagelist.hooks/__tests__/packagelessServedViews-29416.test.tsx(2).viewTabLabellabels (tab and crumb) are byte-identical before and after the whole registry loads, and no list is read.layout/__tests__/AppHeader.pageTitleByName-29416.test.tsx(2). The phone title asks the page by name with no list read, plus a CONTROL with the list loaded.appObjectScope-12811: an app without a package now expectsobject/crm_account,object/sys_user.AppContent.objectScope-12811: the route object and its lookup target by name.AppContent.pageRouteObjects-12980: the double serves pages by name.openPathObjectReaders-12811is unchanged and green. No row moved.Acceptance notes
/meta/objectlist:sys_userandsys_organization(the lookup targets), and the Setup app'srequiresObjectsys_* names from the nav gate's union, which the whole list used to answer./meta/viewthroughObjectView's saved-views overlay (ui/packages/app-shell/src/views/ObjectView.tsx:416,dataSource.listViews(objectName)→ the adapter'sreadViewList). On this route it is now the only/meta/viewreader./meta/viewthrough the package scope's with-views lookup read./meta/pagelist (readPages). Its root still reads the whole registry.ReadNamesWithoutViewsimport, and thepreferLocalimport that main's new dashboard read uses.Verification
Production Console, app-crm (
objectstack dev --seed-admin --fresh), before (app-shell sources at base5f7d554c) and after (headbd111303; later commits only merge main)Setup:
ops_appwith no package, saved throughPUT /api/v1/meta/app/ops_appwith two object entries (crm_account,crm_contact).crm_welcomeis not in its navigation, so it is outside the bundle./api/request with its CDP initiator stack (Debugger.setAsyncCallStackDepth 64).Object route
/apps/ops_app/crm_account, en:GET /api/v1/meta/object(551,834 B) and/meta/view(7,014 B), both fromget objects.GET /api/v1/meta/objectwithout a name./meta/view(7,014 B) is still read, and its only initiator isObjectView'slistViews(see Acceptance notes).crm_appobject route after:/meta/object?package=com.example.crmand/meta/viewfromappObjectScope's lookup read (unchanged).Out-of-bundle page route
/apps/ops_app/page/crm_welcome, en:GET /api/v1/meta/page(15,463 B, fromget pages) and/meta/view(7,014 B, the nav gate's names-only scope).GET /api/v1/meta/page/crm_welcome(1,044 B). There is no/meta/pagelist and no/meta/view.The visible text of both routes is identical before and after, including the view tab
All Recordsand the page body.Ablations (each through
scripts/ablation-replace.mjs, restored withgit diff HEADempty, atbd111303)readObjectRouteNamesalways reads the list. 5 red.requiresObjectonly. 1 red.readItemPreferLocaldrops the ownership check. 1 red ((d), the other package's answer).AppHeaderreads the page list. 1 red.PageViewreads the page list. 3 red.Local runs
bd111303, underos-verify-lockwith--maxWorkers=2: 210 test files naming the touched modules, 1,920 tests, all passed.3a894d8b:console/__tests__andhooks/__tests__: 157 files, 1,273 tests. Main'sAppContent.dashboardRouteReads-28784was red on the droppedpreferLocalimport, then green after the fix.PageView,AppHeader,AppContentandappObjectScopefiles plus the new tests: 95 files, 754 tests, all passed.turbo run type-check --filter=@object-ui/app-shell: 65/65, at both heads.eslint --no-inline-configon the changed files: 0 errors.dispatch-gates --commands): 34 commands, all exit 0 atbd111303, reconciled with--ran(34 derived, 34 run, 0 NOT-MEASURED). At3a894d8b,check-sdui-manifestandcheck-changeset-no-majorpass.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jTxHVLQcafzV1G73bX
Generated by Claude Code