Repository navigation
fix(app-shell): Home asks for the objects it names instead of loading the whole object registry - #29229
Merged
Conversation
… palette on first open Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSvXnowXjLpyfdKoux
…t-count tests for each home reader Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSvXnowXjLpyfdKoux
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSvXnowXjLpyfdKoux
…ollow home's by-name reads Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSvXnowXjLpyfdKoux
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSvXnowXjLpyfdKoux
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSvXnowXjLpyfdKoux
This was referenced Nov 2, 2026
Closed
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T10:10ZHead-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 #29121
Clause-②: no
Metadata-protocol: none
Claim: 6572592854 · amendment: 6573209598
维护者速读
GET /api/v1/meta/object)和整张视图表;命令面板第一次打开时才挂载,首页的动态、最近访问、面板最近记录都只按名字读自己用到的对象。ui/packages/app-shell/src/hooks/useObjectPresence.ts(新的readObjectsByName)、ui/packages/app-shell/src/console/home/HomeLayout.tsx(面板首开才挂载)、ui/packages/app-shell/src/hooks/useNavMemberGates.ts(首页无应用时的能力门)。meta/object:只见meta/object/<名字>,没有不带名字的meta/object;按 ⌘K 搜acme,结果与改前一致。What changes
On
main, every visit to/homeread the whole object registry and the whole view list. Measured with CDP initiator stacks on a production Console (app-crm), four readers asked for them unconditionally, each hidden behind the one before by the provider's cache, and four more once there is data:HomeLayout: the command palette'sobjectsprop (palette closed)views: falseuseObjectPresenceoutside an app (activity feeds'sys_activitycheck)views: falseuseNavMemberGatesoutside an app (the feeds' cross-app roster capability gate)requiresObjectunion,views: false; the package leg asks without views tooHomePage: recent record row iconsuseNavTargetLabelobject label (Home's recent record rows){ byName: true }option: the object by name; a view target reads its object with its viewsuseRecentItemLabel: recent object / list-view rowsActivityObjectLabel: activity rows (Home rail, bell)CommandPaletterecent record rows (palette open)readObjectsByName(inuseObjectPresence.ts) is the one helper: while nothing has loaded the whole list it asks each name through the names-only scope (objectui#12980); once the list is loaded or loading it reads the list and asks nothing; a hand-rolled context reads itsobjects; no name asks nothing (a names-only scope with no names would be the whole registry). Every in-app leg is unchanged: inside an app the sidebar, routes and gates read what they read before.The palette's record search reads only its navigation's objects (
useRecordSearchwithobjectNames), so handing it the host app's scope over those names leaves its results unchanged.Tests
Request-count tests over the real
MetadataProviderand a fake adapter that records each read:console/home/__tests__/homeObjectReads-29121.test.tsx: presence check, roster gate (answers as the whole list did, including an absent required object), activity label, an empty-names read; CONTROL: with the whole list loaded each reader asks nothing.console/home/__tests__/HomeLayout.paletteReads-29121.test.tsx: closed palette not mounted and no read; opened (click or?palette=1) readsobject?package=…plus the outside name; a package-less app reads by name only.console/home/__tests__/HomePage.recentObjectReads-29121.test.tsx: no recent row → no read; record rows read their objects by name (icon and label pinned); an object row by name and a list-view row with its views (view, neverobject).chrome/CommandPalette.recentReadsByName-29121.test.tsx: the palette's recent rows read their objects by name.HomeLayout.searchOpensPalette-12601(the palette probe exists from the first open),navGateUnionScope-12980(its "outside an app reads the whole registry" control now pins the by-name read),openPathObjectReaders-12811(the census learnsreadObjectsByName(…)as a spelling and abyNamekind; HomeLayout, HomePage, ActivityObjectLabel and useRecentItemLabel reclassified).Acceptance notes
chrome/CommandPalette.tsx(the palette's recent rows, its object source while open; found on the production re-measure) and the three updated test pins above.GET /api/v1/meta/objecton home): met on app-crm, see Verification. The home now asks the 8requiresObjectnames of the Setup app's navigation by name (the roster gate), plussys_activityand the objects its recent and activity rows name. That is more requests than one list (19 → 28 on app-crm) and far fewer bytes (558 KB → 70 KB). There is no batch by-names read on/meta/objecttoday.acmeis byte-identical between main and this branch on the same server.useRecentItemLabel), and opening the palette reads/meta/reportand/meta/dataset(its report entries). Neither is the object registry.Verification
Home requests, production Console, app-crm (
objectstack dev --fresh), recent records and activity rows presentmain
0a41075a: 19/api/requests on reload of/home, includingGET /api/v1/meta/object(551,461 bytes) andGET /api/v1/meta/view(6,643 bytes); the initiator of both isHomeLayout(get objects).This branch
5705cea1: 28 requests; noGET /api/v1/meta/objectwithout a name and no/meta/view. By name:sys_business_unit,sys_notification,sys_notification_preference,sys_notification_template,sys_queue,sys_queue_member,sys_record_share,sys_sharing_rule(Setup'srequiresObjectentries),sys_activity,crm_contact,crm_account(recent and activity rows): 70,164 bytes together. Opening the palette and typing readsobject?package=com.example.crm(31,636 bytes),/meta/report,/meta/dataset.Same page on both: recent rows' text and icons, activity rows' labels, and the activity feed's
sys_activityfilter (21 object names) are identical.Ablations (each leg through
scripts/ablation-replace.mjs, restored withgit diff HEADempty)HomeLayout.paletteReads"closed" red.homeObjectReadspresence red.homeObjectReadsgate red.readObjectsByNamereturns the whole list → activity label, empty-names, both HomePage row cases red (4).metadata.objects→ record rows red.useNavTargetLabelignoresbyName→ both HomePage row cases red.useRecentItemLabeltitle readsmetadata.objects→ object/view row case red.CommandPalette.recentReadsByNamered.Local runs at
5705cea1CommandPalette,useNavTargetLabel,readObjectsByName, the census): 90 files / 802 tests passed (one name listed twice). Earlier heads: 88 files naming the seven hooks/components (2 expected pins updated, then green) and 151 files namingsharedUserFeeds,InboxPopover,RecentApps,HomeRail,CommandPalette,AppHeader: 620 + 498 tests passed.turbo run type-check --filter=@object-ui/app-shell: 65/65 tasks.eslint --no-inline-configon the changed files: 0 errors.node scripts/pm/dispatch-gates.mjs --commands) atd8b43ffa: 34 derived, 34 run, all exit 0, reconciled with--ran(0 NOT-MEASURED);check:type-check-debtunder the verify lock;node scripts/check-sdui-manifest.mjsexit 0 among them. The full app-shell suite is CI's Test UI.Human Minimum
packages/specholds no runtime logic.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_01QsR2jSvXnowXjLpyfdKoux