Repository navigation
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 intoOct 8, 2026
Conversation
…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>
Contributor
✅ Console Performance Budget
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
Size Limits
|
objectstack-fleet
Bot
deleted the
claude/issue-11978-hooks-target-label-wait
branch
October 8, 2026 16:22
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.
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.Invoice (invoice),Invoice line (invoice_line)) and the two "Other objects" checkbox reads (User (sys_user),Employee (hr_employee)) useawait within(…).findByRole(…)at the default timeout instead of a synchronousgetByRole.await screen.findByRoletoo: that group is drawn only once the roster answers.src/, andcheck-changeset-presence.mjshas 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.
ObjectHooksPanelreads this package's objects in a mount effect and hands them to the editor asHookTargetScopeContext. That draws the "This package" group.HookDefaultInspectorreads the object roster itself (useObjectOptions), after New opens it. Until the roster answers,pickerOptionsholds only the selected object, labelled by its bare name.So "This package" can be on screen holding one checked checkbox named
invoicewhile "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'sTest (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 onmain(989b19082), one of the test as changed here.main(the lit control)Invoice (invoice)read. The dump shows "This package" holding one checked checkbox namedinvoice: the queue's signature.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.tsxthrough objectstack'sscripts/ablation-replace.mjsin wrap mode. Each was restored to the HEAD blob3bb69262f529withgit diff HEADempty, and a bash trap re-checked the same hash.invoicemoved from "This package" to "Other objects" (bothscope.packageObjects.has(o.value)partition reads replaced; anchor 2 to 0, blob changed). The test went red at the newawait within(own).findByRole('checkbox', { name: 'Invoice (invoice)' })after its default timeout.hook-object-outside-reachparagraph deleted; anchor 1 to 0). Red atgetByTestId('hook-object-outside-reach').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/andpackages/app-shell/src/views/metadata-admin/. Each has a lit positive control: run onmain, each hits this card's test; on this branch, neither does.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 interposedawait waitFor(() => expect(picker).toHaveValue('retired_section')), which can pass only once the books answered.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 asValues (measures),role (deprecated)).HookDefaultInspector.reach-11820.test.tsxawaitsfindByRole('checkbox', { name: 'Account (crm_account)' }), the roster's answer, before its synchronous reads.AccessExplainPanel.test.tsxwaits for the Object field to become a select, which is drawn once the roster answered.ObjectFieldInspector.usePicklist-10202.test.tsxawaits 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
04a3cad2apnpm 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 runstsc --noEmit && tsc -p tsconfig.test.json): exit 0, afterturbo run build --filter='@object-ui/app-shell^...'built the dependency closure (28 of 28 tasks).tsc -p tsconfig.test.json --listFilesOnlylists 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.--print-configshows 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-widepnpm lintand the full shardedpnpm testare CI's.Acceptance notes
HookDefaultInspector.reach-11820.test.tsx, already waits the way this change does: its mount helper awaits the roster-labelled checkbox before any synchronous read.Blocked-by: #11978). PR feat(types): form fields declarescaleandcurrencyConfigby spec reference; M3 class (ii) reads 0 (objectui#11070 round 13) #11972 re-enters the queue once this lands.Session:
https://claude.ai/code/session_01DBZ9bntPZ7VKyQNtJeNsgwGenerated by Claude Code