Repository navigation
perf(console): a full-page record open asks its page list and object scope beside the permission read, and the app bar package list after the page - #35987
Conversation
…scope beside the permission read, and the app bar's package list after the page The console root's prefetch now starts a record route's /meta/page read and the package object list (under AppContent's own rule) as soon as the app list names the app, instead of when AppContent mounts after /auth/me/permissions. fetchSessionPackages waits until the page's counted requests stay quiet for 750 ms (at most 8 s) before reading GET /api/v1/packages, so that response no longer downloads beside the record. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUVVocvc9dVySV9DVf
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — ACCEPT (L1-b)Head-sha: ac36606 · read 2026-11-21T04:53Z 维护者速读
Must-fixNone. Should-fix
Checked
Owed
|
…flag Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUVVocvc9dVySV9DVf
|
repo:objectstack#1 · os-sales · session_01L6bhgUmopshYqDCrYekUj4 席位核对 — delta ACCEPT (L1-b)Head-sha: 1e33395 · read 2026-11-21T04:57Z · delta from 维护者速读
Delta
Must-fix / Should-fixNone. Owed
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T05:16Z · Area b1-CX's PR for #35416 (items 1, 2 and 4; item 3 and the hosted re-measure are #35981, seat note 7057574117): opening a record page full-page starts the page's own reads earlier and takes |
… session read, and the chrome no longer waits for the route's reads (objectstack-ai#36014) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuXu8529KKMpkikFhpmiBwMt)_ Part of objectstack-ai#35981 Clause-②: no Metadata-protocol: none Skills-docs: none — no authorable metadata changes (Metadata-protocol: none) repo:objectstack#1 · os-sales · session_01L6bhgWwKdjqiYQSujUXhn7 ## 维护者速读 - 用链接或刷新整页打开任何应用页(记录页、列表页等)时,登录状态一确认,整屏的「正在打开你的控制台…」就换成控制台的空框架:顶栏、侧栏(宽度和用户上次留下的一样)、和页面形状一样的灰色骨架。本地测量:整屏启动画面从约 1.1 秒提前到约 0.4 秒消失;把权限接口模拟成托管环境的 3 秒时,从约 3.8 秒提前到约 0.4 秒。 - 骨架里不出现应用名称、图标、任何菜单项或按钮:这些要等应用列表、权限和管理员判定回来才知道,所以「闪一下别的应用」「闪一下没权限的菜单」「误跳转」都不会发生,判定的输入和时机与改动前完全相同。 - 记录内容出现的时间不变(本地约 1.5 秒,模拟 3 秒权限时约 4.2 秒),没有变慢;本 PR 只改「等待时看到什么」。数据本身更早发出要动权限前置读取,另议。 - 出错时最坏情况是骨架和真实框架之间有一次位置跳动,可直接撤回;不改任何接口和返回格式。托管环境前后对比要等部署后才能测,卡片保持打开(本 PR 写 Part of),由座位安排。 ## What changes - New `ui/packages/app-shell/src/console/ConsoleBootShell.tsx`: - `ConsoleBootShell`: the console chrome's frame with nothing in it. The real `AppShell` from `@object-ui/layout` (same sidebar primitive and route-slot classes as `ConsoleLayout`; since objectstack-ai#36187, no top bar from 768 px up and grey blocks where the sidebar's head puts the app menu, the search and the bell and its foot the account; the 48 px top bar on a phone and on a docs page), `primeConsoleSidebarOpen` run before the sidebar provider reads its cookie (as `ConsoleLayout` does), grey blocks in the bar and the sidebar, and in the slot the skeleton of the route the URL names (`metadataReadsForAppRoute`). No text, no link, no button. It draws the shape the chrome will have on the route and width, from the same predicates `ConsoleLayout` reads (`showHeader={(phone || docsPage) && !recordPageOwnsTopBar}`) (moved to `layout/consoleRoutePaths.ts`, re-exported from `ConsoleLayout`): no sidebar on an app's docs pages (`isAppDocsPath`, objectstack-ai#36000) and no top bar on a phone record page (`isRecordPagePath`, objectstack#28483). It carries `data-boot-splash` (it is still the boot wait) and `data-boot-shell`. - `ConsoleBootFallback`: the frame on an `/apps/:app/*` route once `useAuth()` has answered with a user; `LoadingScreen` while the session read is out, with no user, on every other route (`/home`, auth surfaces, `/forms/…`), and outside a router. - `RouteMetadataSkeleton` moved here from `AppContent.tsx`, with a `boot` flag that adds `data-boot-splash`. - `ConsoleShell.tsx` `LoadingFallback` renders `ConsoleBootFallback`. That covers the gates between the session read and `AppContent`: `ConnectedShellInner` (adapter), `RequireOrganization` (organization list) and the console host's `ConsolePermissionsScope` (`ui/apps/console/src/AppContent.tsx`, now `loadingFallback={<LoadingFallback />}`; its error fallback is unchanged). - `AppContent.tsx`: - The readiness gate draws `ConsoleBootShell` instead of `LoadingScreen`, and holds only on the adapter, the app list, the admin verdict (objectui#5619) and the deployment flags (`/auth/config`). The flags are new to the gate: the chrome's navigation gates read them, and a navigation predicate naming a flag (`features.cloudManaged != true`) faults and withholds its entry while none are bound (objectui#12700). Before, the route's own reads made the chrome mount after that answer by timing only; with them off the gate, Live E2E UI caught the fault (`list-row-action-cel`), reproduced locally by holding `/auth/config` 2 s. The first-paint wait on the route's own buckets (`!firstPaintDone && !routeReadsSettled`, objectui#12809) is gone: the chrome mounts, and the route slot shows `RouteMetadataSkeleton` until `routeReadsSettled`, the path a later navigation already took. - The two access-verdict waits before the chrome (`appSurfaceAwaitsVerdict`, `requestedAppMissing`) draw the frame too. - The route slot's `Suspense` fallback is `RouteMetadataSkeleton … boot` instead of the full-screen `LoadingScreen` inside the chrome (measured locally: 0.2 s of logo splash inside the chrome while the record page's chunk resolved). - `firstRouteDrawn` (replaces `firstPaintDone`) keeps the first route skeleton's `data-boot-splash` until the route's reads have landed once. - `RedirectWithSplash` paints `ConsoleBootFallback` instead of `LoadingScreen`, so a boot redirect out of a gate that was drawing the frame (`RequireOrganization` → `/organizations`, `AppContent` → home) still changes no pixels during its hand-off (objectui#6378). Read first (risk order): 1. `AppContent.tsx`, the readiness gate and the route slot (`RouteMetadataSkeleton`, the `Suspense` fallback). 2. `ConsoleBootShell.tsx`, `RoutedBootFallback`'s conditions. 3. `ConsoleShell.tsx` `LoadingFallback`, `RedirectWithSplash.tsx`. ## Why An `/apps/:app/*` open passed five gates in a row, each drawing the full-screen splash: `AuthGuard` (`get-session`), `ConnectedShellInner` (adapter), `RequireOrganization` (`organization/list`), `ConsolePermissionsScope` (`/auth/me/permissions`, more than 3 s server-side on the hosted environment, objectstack-ai#35987), then `AppContent`'s gate (app list, admin verdict, the route's own reads until the first paint). Only the first decides whether there is a session. The others decide which app this is, which navigation exists and where to redirect, and the frame shows none of those. What each guarantee rests on, unchanged: - **No wrong-app flash**: the frame names no app. The chrome still mounts only once the app list is in and the URL's app is matched; `requestedAppMissing` and the access-verdict screens are unchanged. - **No unauthorised-menu flash**: navigation entries come only from the real chrome (`UnifiedSidebar`, `AppHeader`), which still mounts after the permission answer and the admin verdict. - **No redirect loop or wrong redirect**: the frame never navigates; the no-active-app redirect still waits for the admin verdict, and the organization redirects for their own inputs. - **Boot-paint semantics** (objectui#12980, readiness waits): the frame and the first route skeleton carry `data-boot-splash`, so the chrome's deferred feeds (`sharedUserFeeds`), the locale list (`loadLocales`) and the e2e/smoke waits keyed on that marker wait for exactly what they waited for before. What the chrome reads before the route's buckets land: `ConsoleLayout`/`AppHeader`/`CommandPalette` get the object list the route has so far (the scope's or none). The header's object crumb is absent until the object lands, as on any later navigation today. Nothing in the chrome decides from it. ## Verification ### Before/after, the same record page (local and throttled, not hosted) `examples/app-showcase` (`pnpm dev -- --fresh`, seeded admin), behind a local HTTP/2 TLS proxy (objectstack-ai#35987's recipe), Chromium 1280×800, zh-CN, JS cached, DevTools throttling 300 ms RTT / 6 Mbps, 3 runs per row, full-page open of `/_console/apps/com.example.showcase/showcase_project/record/<id>`. Seconds from navigation start. Paint milestones from a MutationObserver: full-screen splash gone (no `LoadingScreen` left and the pre-JS splash gone), frame drawn (`data-boot-shell`), chrome drawn (`console-route`), record shown (its name in the route slot). The second profile holds `/auth/me/permissions` 3 s in the proxy, a stand-in for the hosted server time (simulated, not measured hosted). | Profile | | `get-session` answered | full-screen splash gone | chrome drawn | record shown | |---|---|---|---|---|---| | 300 ms / 6 Mbps | before | 0.38 / 0.40 / 0.35 | 1.69 / 1.15 / 1.09 | 1.51 / 0.96 / 0.87 | 2.10 / 1.52 / 1.46 | | | after | 0.44 / 0.35 / 0.36 | **0.69 / 0.37 / 0.37** (frame) | 1.19 / 0.81 / 0.82 | 1.89 / 1.50 / 1.52 | | + permissions held 3 s | before | 0.47 / 0.45 / 0.35 | 4.03 / 3.87 / 3.78 | 3.79 / 3.62 / 3.57 | 4.40 / 4.25 / 4.16 | | | after | 0.42 / 0.41 / 0.35 | **0.74 / 0.44 / 0.37** (frame) | 3.89 / 3.63 / 3.52 | 4.53 / 4.26 / 4.15 | - The frame replaces the splash within about 20 ms of the session answer in runs 2 and 3 (run 1 of each row is the first open after the warm-up and starts its reads late), before `/meta/page` answers (0.73–1.10) and well before the permission answer. - "Before" splash gone comes after "chrome drawn" because the chrome mounted with the full-screen `LoadingScreen` inside it while the record page's chunk resolved; after, that slot shows the record skeleton. - Chrome drawn and record shown do not move beyond run noise: the record's data read still leaves after the permission answer and the record page's mount (`POST …/page` sent at the same times before and after). Moving that read earlier is a different change (a data read before the permission answer), not taken here. - ⚠ Gap: the hosted environment is not reachable from this container, and an "after" there exists only once this is deployed. The hosted before/after (objectstack-ai#35981's scope addition: segment timings before objectstack-ai#35987 and after this PR, and `/api/v1/packages` off the boot path) is owed after deploy; the card stays open for it. Screenshots after objectstack-ai#36187 (`after2-1440-*`, `after2-375-*`: frame, then loaded) and, from the first round, (frame → chrome → record) at 1280×800 (sidebar folded by the window width, as the chrome folds it), 1600×900 (sidebar open, same width in frame and chrome) and iPhone 13, the raw runs (`*.json`, `summary.txt`), the measurement script and the proxy: `/mnt/project-files/build-seat1/35981/` in the project files. ### Tests - `ui/packages/app-shell/src/console/__tests__/ConsoleBootShell-35981.test.tsx` (new, 7 cases): the frame on an app route with a user, carrying `data-boot-splash`, the top bar and the route skeleton; `LoadingFallback` draws it; a boot redirect paints it at its first commit and then lands; the frame has no text and nothing to press; no sidebar on a docs page and no top bar on a phone record page, with the sidebar and the bar kept everywhere else; the splash while the session read is out, with no user, on `/home`, `/login`, `/forms/…`, bare `/apps`, and outside a router. - `AppContent.splashCriticalPath-12809.test.tsx` (amended): before the member row answers, the frame and no chrome; after it, the chrome with the route skeleton carrying `data-boot-splash`; the splash marker leaves when the route draws, as before. The two CONTROL cases are unchanged and pass (a later skeleton is not the boot wait). - Amended where the old splash was the expected frame: `AppContent.routeChunkPreload-12980` (case (a): the chrome is up under the route skeleton while the page's reads are out; the inside-the-chrome watcher counts the full-screen splash only, and case (b) now sees the route skeleton, not a splash, while the chunk loads), `bootRedirectCoverage` (the boot frame counts as full-viewport cover), and the `LoadingFallback` mock in `App.homePermissions-12700` and `FormPage.routePermissions-29187` (the permission scope's fallback). All four pass. - Local run of `packages/app-shell/` and `apps/console/`: the first full run hit its 50-minute limit in this 4-core container after reaching those four reds and nothing else. The scoped rerun after the fixes (app-shell `console/`, `chrome/`, `layout/`, `hooks/`, and `apps/console/`): 892 files, 7992 tests, all pass. CI's Test UI shards carry the whole suite and are green on the head. - `AppContent.splashCriticalPath-12809`: a new case holds `/auth/config` and pins frame-not-chrome until it answers (red with the gate line reverted). `AppContent.unresolvedAdmin-5619` (three cases, including the MUST NOT CHANGE one) now awaits the chrome, since the flags' answer is a promise even when the mock gives it at once; the admin verdict still adds no wait. `AppContent.emptyNavigationLanding-12079` gets a stable `getAuthConfig`, as `AuthProvider`'s `useCallback` gives, since a fresh one per render re-asks on every render. - After merging `main` and the L1-b should-fixes: app-shell `console/`, `layout/`, `chrome/`: 465 files, 3659 tests, all pass; `pnpm console:build` green. - `pnpm check:test-source-alias`: the amended boot-path test now mounts the chrome, which reaches `@objectstack/lint` lazily; it loads it at module top, as the gate asks. Green. - `pnpm console:build` (runs `tsc` for app-shell and the console): green. - ESLint on the changed files: no errors. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No spec change.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes (changed files). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset (`.changeset/35981-app-route-boot-frame.md`, patch), and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the maintainer summary is in Chinese by the maintainer's standing rule). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. Follow-up (not in this PR): the record's own data read waits for the permission answer and the record page's mount; starting it earlier would need its own card (it reads data before the permission answer arrives). --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgWwKdjqiYQSujUXhn7)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWwKdjqiYQSujUXhn7 <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgWwKdjqiYQSujUXhn7 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #35416
Clause-②: no
Metadata-protocol: none
Skills-docs: none — no authorable metadata changes (Metadata-protocol: none)
repo:objectstack#1 · os-sales · session_01L6bhgUVVocvc9dVySV9DVf
维护者速读
/api/v1/packages)不再和记录数据抢同一条连接:页面自己的请求安静 0.75 秒后才去取(最多等 8 秒)。代价是应用栏的「在 Studio 中编辑」铅笔/眼睛图标晚出现约 1 秒(取到之前本来就不显示)。What changes
@object-ui/app-shelluseAppObjectScopePrefetch(console/appObjectScope.ts), the console root's prefetch that mounts beside/auth/me/permissions: on a record route it now asks the page list (ensureType('page')) and handsreadAppObjectScopethe same page-list and bundle readersAppContenthands it. So the record route's/meta/pageread and, underAppContent's own rule (objectstack#35455: not when the bundle answers a miss), the package object list (/meta/object?package=) leave as soon as the app list names the app. Before, the root passed no page-list reader, so on a record route both waited forAppContent, which mounts only after the permission read answers.AppContentreads the same entries and asks nothing twice. The page reader reads the provider'spagesonly when the record route asks (that getter starts the page list), so a list route asks no page list.fetchSessionPackages(views/studio-design/packages-io.ts), the session-held read behind the app bar's and the sidebar's Studio entries (useStudioEntryGate, and fix(ui): a view a read-only package ships offers no footer calculation menu and no Rename #35975's menus when it lands): a read it starts now waits forwhenQuiet(750, 8000), the page's counted requests (the data layer's settle signal) at zero for 750 ms, at most 8 s. A read already on the wire is joined at once, and a held list answers with no wait. Studio's own reads (fetchPackages,fetchListedPackageIds) are unchanged. The entries were already absent while the list was unread, and fix(ui): a view a read-only package ships offers no footer calculation menu and no Rename #35975 already fails open while unread, so nothing is drawn wrongly during the wait.observability/settleSignal.ts: newwhenQuiet(quietMs, maxMs). It resolves at once where no request was ever counted (no data layer wraps itsfetchthere, as in a host or a unit test without one). Not exported from the package entry./me/appsis not changed: it starts after the permission read, but nothing on a named app's record route waits for it (AppContentreads it only to pick a default app), as the waterfalls below show.Read first (risk order):
ui/packages/app-shell/src/console/appObjectScope.ts,useAppObjectScopePrefetch: therecordRouteeffect and the readers passed toreadAppObjectScope.ui/packages/app-shell/src/views/studio-design/packages-io.ts,fetchSessionPackages: the wait and the hold re-check after it.ui/packages/app-shell/src/observability/settleSignal.ts,whenQuiet.Why
The card measured 5 serial segments on an older hosted build. On
mainthe full-page record open is 4 waves:get-session→/auth/me/permissions(+/meta/app, bundle) →/meta/page+/meta/object?package+/me/apps→POST /data/{object}/{id}/page. The third wave existed only because the root prefetch could not read a record route's page list. And/api/v1/packages(1.3 MB unpacked on the showcase, 3.2 MB on the hosted CRM) started about 80 ms before the record's own read, on the same HTTP/2 connection; the card measured it downloading for 6.3 s while the record's 3 KB answer arrived 4.5 s after the server finished it.Verification
Before/after, the same record page (local, see the gap below)
examples/app-showcase(objectstack dev, seeded admin), behind a local HTTP/2 TLS proxy so the browser multiplexes like the hosted edge (a plain local dev server is HTTP/1.1 and its 6-connection cap adds a fake wave). Chromium 1280×800, zh-CN, JS cached, DevTools network throttling, 3 runs per row, full-page open of/_console/apps/com.example.showcase/showcase_project/record/<id>. Times in seconds from navigation start./meta/pagesent/api/v1/packagessent/meta/pageand the package object list now leave in the permission read's wave in every run, and/api/v1/packagesleaves after the page's requests in every run, so it is no longer among the record page's boot requests (the card's acceptance).AppContentand the record page still render before the record's read can leave (0.4 s of client time in this container), and that render is what Opening a record page full-page: draw the app shell as soon as the session is confirmed, not after all metadata arrives #35981 is for. On the hosted environment the saved wave was 1.4 s (card segment 4)./api/v1/packagescontention the card measured shows here only as the read moving after the page. A hosted before/after on the same record is owed once this is deployed.Raw waterfalls (every request, start → end, bytes), the measurement script and the proxy:
/mnt/project-files/build-seat1/35416/in the project files (h2-{before,after}-{300,600,slow}.txt,summary.txt).Tests
ui/packages/app-shell/src/console/__tests__/appObjectScope.rootRecordRoute-35416.test.tsx(new, 3 cases, realMetadataProvider, only the root prefetch mounted, every read held per wave): a record route asks the app list, then the page list and the package list together; CONTROL a bundle that is a miss starts the page list alone; CONTROL a list route asks no page list.ui/packages/app-shell/src/views/studio-design/sessionPackagesAfterPageQuiet-35416.test.ts(new, 7 cases, fake timers, fresh modules per case): waits while a page request is in flight and then for the quiet window; a request inside the window restarts it; the 8 s cap; readers in one commit share one read; CONTROLs: nothing counted reads at once, a read on the wire is joined at once, a held list answers with no read.console/__tests__/appObjectScope-12811.test.tsx(23),hooks/__tests__/navGateUnionScope-12980.test.tsx,observability/settleSignal.test.ts,hooks/useStudioDesignGate.sessionHold-29119.test.tsx. The whole@object-ui/app-shellpackage is left to CI's Test UI shards.pnpm --filter @object-ui/app-shell type-checkexit 0 (includestsconfig.test.json). ESLint on the five files: 0 errors.Ablations: each change reverted, its pin goes red
appObjectScope.tsrestored tomain: the record-route case and the miss CONTROL fail (the root asks no page list); the list-route CONTROL passes. Restored, 3 pass.await whenQuiet(…)line infetchSessionPackagesreplaced by a no-op: the three waiting cases fail (the list is read at once); the four CONTROLs pass. Restored, 7 pass.L1-b S2 (head
1e33395d):__resetSettleSignalnow also clears the newcountedflag, so a test that resets the signal getswhenQuiet's nothing-counted arm again.settleSignal.test.ts, the new 35416 test andRecordDetailView.namedRecordPage-12715.test.tsx(the reset's other caller) pass, 23/23.Follow-ups
/api/v1/packages每次整页都下载 472KB #35416's acceptance, "同一环境") is owed after deploy and is carried as an added acceptance line on Opening a record page full-page: draw the app shell as soon as the session is confirmed, not after all metadata arrives #35981 (comment 7057574117), per the seat's ruling on L1-b's S1./api/v1/packagesor an ETag: both change the response (a contract face), and this PR already takes the read off the boot path. Worth one if the hosted re-measure still shows it hurting an admin's first page.Human Minimum
packages/specholds no runtime logic. (Nopackages/specchange.)main, one pull request..changeset/35416-record-open-boot-waves.md, patch), and both declaration lines are filled in here and in the changeset.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUVVocvc9dVySV9DVf