Repository navigation
perf(app-shell): an object list loads the package ask, the view settings panel and the create-view dialog only when opened - #38429
Merged
Conversation
…ngs panel and the create-view dialog only when opened The list route imported the package ask and the designer strings statically and drew the ask, the view config panel and the create-view dialog closed on every list, so ~183 KB (brotli) of authoring code was fetched before the list's first screen. Each now loads on its first opening and stays mounted after; a refused view create loads its words with the refusal. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxzGFPvShbd2qnkdEv
Contributor
Author
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-29T01:50Z · zone
|
Merged
9 tasks done
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 Tesla · project thread
Part of #37444. This is the first cut: the object list page stops loading authoring code before its first screen. The card stays open, because this cut alone is not expected to bring the list page under 2.5 s; a second cut waits for this PR's reading and a claim amendment.
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The object list route (
ObjectView) pulled about 69 chunks (~183 KB brotli, measured onff69bcab) of authoring code before its first screen:objectViewViewCrud.tsxandobjectViewViewSharing.tsimportedmetadata-admin/PackageCreateAskandmetadata-admin/i18nstatically (since feat(app-shell): a create with no named package asks to pick or create one #38204).usePackageCreateAskdrew a closedPackageCreateAskDialogon every list, and that dialog imports the package page's create dialog,PackageFormDialog,SchemaFormand the Studio catalogue.ViewConfigPanelandCreateViewDialogareReact.lazy, but were rendered closed on every list, so their chunks were fetched on every list load too.Now:
useDeferredPackageCreateAsk(inobjectViewViewCrud.tsx) keeps the sameask(request) => Promise<string | null>contract. It mounts a lazyPackageCreateAskDialogon the first ask and keeps it mounted afterwards, so it closes the way it did before. A newer ask still resolves the older one withnull, and unmount still resolves a pending ask withnull.reportViewNotSaved(err, locale)still answers synchronously whether the error was a runtime-create refusal. The refusal text, the designer locale mapping and the Studio catalogue load on the refusal, and the toast shows once they arrive. A cancelled ask still shows nothing.useObjectTranslation()instead ofuseMetadataLocale();designerLocaleOfmaps it at refusal time.ObjectView.tsxmountsViewConfigPanelandCreateViewDialogthe first time each opens (useOpenedOnce), and keeps them mounted after that.No exported shape changes, no spec or metadata change.
Tests
objectViewListRoute.deferredAuthoring-37444.test.tsxpins the load order with countedvi.mockfactories: importing./ObjectViewevaluates none ofPackageCreateAsk,PackagesPage,SchemaForm,metadata-admin/i18n,ViewConfigPanel,CreateViewDialog; the ask loads its dialog on the first ask, answers it and stays mounted closed; a refused create toasts once its words load, a cancelled one never toasts.ObjectView.readOnlyPackageViewSaves-35974.test.tsxandObjectView.viewConfigSaveWiring-10210.test.tsxread the panel's props; they now open the panel first, since a closed panel is no longer mounted. The personal-view case now asserts the closed panel is not mounted.Pin ablation
Committed first, then
scripts/ablation-replace.mjsonobjectViewViewCrud.tsx: the anchorimport type { PackageAskRequest } from './metadata-admin/PackageCreateAsk.js';replaced with a value import ofPackageCreateAskDialog(void-used). Result: case 1 (packageAsk0 → 1) and case 2 red, case 3 green: 2 failed, 1 passed. Restored: blob equals HEAD,git diff HEADempty.What is not separately pinned: the
CreateViewDialogrender deferral inObjectView(its module-load count is pinned at import time only; no case opens the dialog). TheViewConfigPanelrender deferral is pinned by the 35974 personal-view case.Acceptance notes
objectViewViewCrud.tsx(useDeferredPackageCreateAsk: the resolve-older-ask and unmount paths), thenObjectView.tsx(useOpenedOnceand the two mount sites), thenobjectViewViewSharing.ts(the catch path).PackagesPage,SchemaFormorCreateViewDialogchunk. Click the view settings gear: the panel opens after one chunk fetch.all), not on the open view (unit-level evidence only).Verification
LCP on this PR's build (
bd4f2071) against main, by the card's method: production builds, HTTP/2 TLS front, Lighthouse 13.6.0 desktop preset, signed in, blocks main-1, pr-1, pr-2, main-2 of 5 runs per page. The record page got a reversed round on top. p is a two-sided permutation test on the median difference. Full runs: card comment 7248989586.On the list page, the scripts fetched before the first screen go from 274 to 225: 171.6 KB less gzip as served, or 188 KB less brotli by the dist's
.brfiles. Home and record fetch the same script count on both builds. The list is still 51 ms over 2500, so the card stays open for a second cut.Gates
node scripts/pm/dispatch-gates.mjs --commands: 38 derived, all 38 exit 0.--ran: 38 run, 0 NOT-MEASURED, 0 UNRUN.--tier: no path-derived mandate; 356 changed lines (under 3000).overlap-check: merges cleanly ontoorigin/main, VERDICT clean.cd ui && pnpm exec vitest runon 23 affected app-shell files: 265/265 passed.Human Minimum
packages/specholds no runtime logic. (not touched)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibxzGFPvShbd2qnkdEv