Skip to content

test(app-shell): the new-hook target test waits for the roster's labels before reading them (objectui#11978) - #11986

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-11978-hooks-target-label-wait
Oct 8, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-11978-hooks-target-label-wait

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11978
Clause-②: no

What changed

One test, ObjectHooksPanel.newHookTarget-11820.test.tsx, "opens with this package's objects first and every other object under the reach warning": every read whose answer the object roster draws now waits for that answer.

  • The two "This package" checkbox reads (Invoice (invoice), Invoice line (invoice_line)) and the two "Other objects" checkbox reads (User (sys_user), Employee (hr_employee)) use await within(…).findByRole(…) at the default timeout instead of a synchronous getByRole.
  • The "Other objects" group is found with await screen.findByRole too: that group is drawn only once the roster answers.
  • An empty-frontmatter changeset declares no release. The file sits under src/, and check-changeset-presence.mjs has no carve-out for tests.

The component is unchanged: HookDefaultInspector's bare-name interim state is deliberate (objectui#10585).

Why it was red on timing alone

Two reads answer at their own pace.

  • ObjectHooksPanel reads this package's objects in a mount effect and hands them to the editor as HookTargetScopeContext. That draws the "This package" group.
  • HookDefaultInspector reads the object roster itself (useObjectOptions), after New opens it. Until the roster answers, pickerOptions holds only the selected object, labelled by its bare name.

So "This package" can be on screen holding one checked checkbox named invoice while "Other objects" is not drawn yet. The test awaited only the group, then read the label synchronously. Which read answered first decided the verdict: this is the red that took PR #11972 out of the merge queue and turned PR #11973's Test (shard 6/8) red.

Measurements, on this branch

H1: the fix closes the window. A throwaway, untracked copy of the test (deleted afterwards) delays only the catalog list('object') answer; the package-scoped read is not delayed. One copy of the test as on main (989b19082), one of the test as changed here.

copy roster delay runs result
as on main (the lit control) 120 ms 3 3 failed, each at the Invoice (invoice) read. The dump shows "This package" holding one checked checkbox named invoice: the queue's signature.
as changed here 120 ms 3 3 passed
as changed here 300 ms 1 passed
as changed here 600 ms 1 passed
as changed here 1500 ms 1 failed at the new findByRole('checkbox', { name: 'Invoice (invoice)' }): the wait is bounded by the default 1000 ms timeout.

H2: the test still tests its claim. Two ablations of HookDefaultInspector.tsx through objectstack's scripts/ablation-replace.mjs in wrap mode. Each was restored to the HEAD blob 3bb69262f529 with git diff HEAD empty, and a bash trap re-checked the same hash.

  • invoice moved from "This package" to "Other objects" (both scope.packageObjects.has(o.value) partition reads replaced; anchor 2 to 0, blob changed). The test went red at the new await within(own).findByRole('checkbox', { name: 'Invoice (invoice)' }) after its default timeout.
  • The reach warning removed (the hook-object-outside-reach paragraph deleted; anchor 1 to 0). Red at getByTestId('hook-object-outside-reach').
  • The first attempt at the first ablation was a no-op. Its replacement text contained the anchor, so the anchor count could not drop; the tool refused with exit 1 before running the test, and restored. The reading above is the retake, with a replacement that does not contain the anchor.

H3: the same pattern elsewhere. Read only; no other test file is touched. Two text scans over the 594 test files under packages/app-shell/src/views/studio-design/ and packages/app-shell/src/views/metadata-admin/. Each has a lit positive control: run on main, each hits this card's test; on this branch, neither does.

  1. An awaited container (const X = await …findBy…), then a synchronous named read inside it: 15 hits in 10 files. None shares the race. The names are static i18n strings drawn in the same commit as their container (buttons, a tab, a placeholder). The one data-derived name, DocPreview.test.tsx "keeps a group key no book declares visible", is gated by an interposed await waitFor(() => expect(picker).toHaveValue('retired_section')), which can pass only once the books answered.
  2. A synchronous read of a roster-shaped Label (api_name) name: 25 hits in 11 files. None shares the race. Most are synchronous renders with no async read at all (static strings such as Values (measures), role (deprecated)). HookDefaultInspector.reach-11820.test.tsx awaits findByRole('checkbox', { name: 'Account (crm_account)' }), the roster's answer, before its synchronous reads. AccessExplainPanel.test.tsx waits for the Object field to become a select, which is drawn once the roster answered. ObjectFieldInspector.usePicklist-10202.test.tsx awaits one served option before reading its sibling from the same answer.

The scans' blind spot: a data-derived name in another form, read through screen.getBy… after an unrelated await, is outside both.

Gates, at 04a3cad2a

  • pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/studio-design/ packages/app-shell/src/views/metadata-admin/inspectors/ (verify lock): Test Files 296 passed (296), Tests 2935 passed | 1 skipped (2936).
  • pnpm exec vitest run --maxWorkers=2 scripts/__tests__/ (verify lock): Test Files 179 passed | 2 skipped (181), Tests 5452 passed | 2 skipped (5454).
  • pnpm --filter @object-ui/app-shell type-check (verify lock; echoes @object-ui/app-shell@17.7.0 type-check, which runs tsc --noEmit && tsc -p tsconfig.test.json): exit 0, after turbo run build --filter='@object-ui/app-shell^...' built the dependency closure (28 of 28 tasks). tsc -p tsconfig.test.json --listFilesOnly lists this test file. A first run before the closure was built could not resolve the @object-ui/* declarations: NOT MEASURED, not a red.
  • node scripts/check-changeset-presence.mjs: exit 0 (an empty frontmatter, the explicit exemption). check-changeset-no-major.mjs, check-changeset-overwrite.mjs, pnpm check:changeset-claims, pnpm check:pending-changeset-literals: exit 0.
  • pnpm check:new-line-citations: 0 new citation(s), exit 0. pnpm check:control-bytes: exit 0.
  • pnpm check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:test-path-roots: exit 0.
  • ESLint, narrowed to the changed file, with an unchanged sibling test as control: 2 files in the JSON result, 0 errors and 0 warnings each. --print-config shows 119 rules active on the changed file, so it is in ESLint's population. The config enables no type-aware linting, so this diff cannot move another file's verdict. The repo-wide pnpm lint and the full sharded pnpm test are CI's.

Acceptance notes

Session: https://claude.ai/code/session_01DBZ9bntPZ7VKyQNtJeNsgw


Generated by Claude Code

…ls before reading them

ObjectHooksPanel.newHookTarget-11820 awaited only the "This package"
group, then read the checkbox labels synchronously. The group is drawn
by the panel's read of this package's objects; the labels, and the
"Other objects" group, are drawn by the hook editor's own read of the
object roster. Until the roster answers, the selected object is drawn by
its bare name on purpose, so the group could be on screen while its
checkbox was still named `invoice`, and the read failed on timing alone.

Every read whose answer the roster draws now waits for it with
findByRole at the default timeout. The component is unchanged.

Claude-Session: https://claude.ai/code/session_01DBZ9bntPZ7VKyQNtJeNsgw
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 337 chunks) 3311.1 KB 3312.0 KB
Main entry chunk (gzip) 71.4 KB 350 KB
Entry file index-Bq3qjaXY.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 18.33KB 6.73KB
app-shell (runtime-config.js) 22.59KB 7.89KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 41.19KB 11.12KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.11KB 7.97KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.50KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 587.49KB 141.58KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 240.39KB 67.09KB
fields (index.js) 268.74KB 68.04KB
i18n (LocalizationContext.js) 2.92KB 1.42KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.52KB 2.39KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 36.87KB 9.88KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.50KB 11.82KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.04KB 3.92KB
plugin-calendar (index.js) 53.43KB 15.54KB
plugin-charts (index.js) 84.71KB 23.25KB
plugin-chatbot (index.js) 199.63KB 47.46KB
plugin-dashboard (index.js) 144.20KB 38.95KB
plugin-designer (index.js) 231.46KB 48.87KB
plugin-detail (index.js) 248.57KB 65.47KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 177.11KB 45.88KB
plugin-gantt (index.js) 179.17KB 45.07KB
plugin-grid (index.js) 248.22KB 68.84KB
plugin-kanban (index.js) 52.22KB 16.38KB
plugin-list (index.js) 117.68KB 29.40KB
plugin-map (index.js) 27.24KB 9.03KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 39.10KB 11.81KB
plugin-tree (index.js) 15.07KB 5.33KB
plugin-view (index.js) 91.09KB 22.94KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.81KB 3.58KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 120.63KB 39.56KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.31KB 2.07KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.07KB 1.30KB
sdui-parser (index.js) 7.30KB 3.12KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 23.87KB 7.83KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.44KB 2.07KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 1.13KB 0.65KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 5.78KB 2.70KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (node-slots.js) 7.18KB 2.34KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.25KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants