Repository navigation
perf(console): answer an app page's views, page and dashboard reads from the app bundle first - #28754
Merged
Merged
Conversation
…rom the app bundle first The provider no longer reads /meta/view at mount. A scope composes its objects with the app bundle's views when the bundle holds every object in it, and the page route, the app bar title and the nav and recent-item labels read their page or dashboard from the bundle, reading the list only for an item the bundle does not hold. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
… list on demand in the list-sharing pins Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…provider stand-in leaves readers on their list Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
… when every asked object is bundled Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…rts the scope Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…ist, and let presence skip views Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…he adapter wrapper Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
… the list loads for the rest Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…it waits for its bundle Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…oading Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…ence read Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…nt accepts Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
…p while it revalidates Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUjXYpqdaAkEWBHbqG
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-01T17:52ZHead-sha:
|
This was referenced Nov 1, 2026
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
Part of #28645
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
/meta/view列表组合;回滚即还原本 PR,无数据或协议变更。ui/packages/app-shell/src/providers/MetadataProvider.tsx(viewsForObjects、peekBundle)、ui/packages/app-shell/src/console/appObjectScope.ts(enterAppBundle)、ui/packages/app-shell/src/views/PageView.tsx。cd ui && pnpm exec vitest run packages/app-shell/src/providers/__tests__/MetadataProvider.bundleFirstReads-28645.test.tsx,预期 17 个用例全绿。What changes
The app metadata bundle (#27627) answers by-name reads, but the console's readers looked names up in whole lists. This PR moves those readers to the bundle first:
MetadataProviderstops reading/meta/viewat mount (EAGER_TYPES = ['app']). A route's object scope composes each object the bundle holds with the bundle's views. It reads the/meta/viewlist only when a name it asks is outside the bundle, and only for the objects the bundle does not hold. A list already in hand keeps answering while a bundle loads, so a settled scope never unsettles. The whole registry (objects) still reads the list beside it.providers/bundledReads.ts):PageView,AppContent's page scope,AppHeader's phone title,useRecentItemLabelanduseNavTargetLabelread a page or dashboard from the bundle, prefer-local by owner package. A miss falls back to the list as before.useAppObjectScopePrefetchenters the app's bundle as soon as the app list names the app.AppContentreuses that entry (enterAppBundle) instead of revalidating it. Leaving the app ends the entry.useObjectPresenceasks its object with a package-localviews: falseand reads no views.useServedViewItems(read):AppHeaderreads views only on an object's view route.@object-ui/data-objectstack: newObjectStackAdapter.peekAppBundle()and the exported typesAppBundlePeek,AppBundleItems,AppBundleEntry, with TSDoc. This is the Clause-② widening.NavigationSyncEffect(useNavigationSync.ts) is untouched. It still reads/meta/pageand/meta/dashboard, which PR 2 removes (#28680, maintainer ruling A).Tests
MetadataProvider.bundleFirstReads-28645.test.tsx(17 cases) andappBundlePeek-28645.test.ts(5 cases).appObjectScope-12811.test.tsxadds the root bundle entry and its reuse through the console's adapter wrapper.objectScope-12811,namesOnlyScope-12980,oneMetadataRead-13044,switchDropsAdapter-13044,ConnectedShell.sessionGate.views: false, the pending-before-enter rule, bundled objects keeping bundle views, and the root entry.Acceptance notes
Measured on a production console build (
pnpm build+pnpm console:build,pnpm dev -- --fresh),showcase_app, admin, API calls of a warm reload, two runs each. Base2678600d, head of this PR:page/showcase_start_here/meta/view−1,/api/v1/packages+1dashboard/showcase_ops_dashboardshowcase_task(object list)Expected with PR 2 (NavigationSyncEffect stops reading the lists): page 26 → 24, dashboard 35 → 33. That is
/meta/pageand/meta/dashboard−1 each, plus this PR's view saving on the page route. This PR ships at net zero because PR 2 needs these readers off the lists.Deviations:
/api/v1/packages+1 on the page route.PageViewnow draws on the bundle about 250 ms before the page list would land. Its Studio design gate (useStudioDesignGate) therefore asks/packagesoutside the in-flight window the sidebar's gates share.packages-io.tsforbids a reuse window, so this PR does not add one./meta/view. It reads the whole object registry (objects), as on main, and the bundle cannot spare that read without changing the dashboard route's whole-registry rule./meta/view.showcase_task's lookup targetsys_useris outside the bundle, so its scope reads the list for the objects the bundle lacks. A reader skips views only where its output is the same without them (useObjectPresence).app-bundle.ts, the newbundledReads.ts,appObjectScope.tsanduseObjectPresence.ts(claim amendment 6559809254).AppContent's page route no longer waits for the page list bucket.RecordDetailViewis unchanged, becauseusePageAssignmentstill reads the page list on record routes.Verification
Derived gates (35)
Run at
23fefe55(the last commit after it only replaces a module variable inappObjectScope.ts;check-sdui-manifestre-ran at the final head, exit 0).dispatch-gates --ran: 35 derived, 35 run, 0 NOT-MEASURED.Tests and type-check
--maxWorkers=2: 427 passed, 3527 tests. The full app-shell suite (~71 min) is left to CI's Test UI shards.pnpm turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/data-objectstack: 66/66 tasks, exit 0.node scripts/check-sdui-manifest.mjs: exit 0.origin/mainate735b79ewith no overlap on touched files and no parallel fix found.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses. (run aseslint --quietover the changed ui files: 0 errors; the whole-workspace lint is left to CI)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_01QsR2jUjXYpqdaAkEWBHbqG