Skip to content

test(app-shell): fold ten Interfaces rail label pins onto one shared StudioDesignSurface harness - #26255

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-5g7620
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-5g7620

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Part of #25911

Slice 1a of #25911: the shared-setup pilot on the StudioDesignSurface.* app-shell tests. Five Interfaces-rail label pins rendered the real InterfacesPillar over the same three mocks and differed only in their metadata-client double. They are now folded into one file, StudioDesignSurface.railLabels.test.tsx. The file declares the three mocks once, and each former file is a top-level describe named after it. Each of those blocks installs its own client double in a beforeEach. No test is deleted, and every assertion moves verbatim. The seat split the original ten-file fold to keep this PR under the 3,000-line bar. The other five pins (interfacesRailLabelMap-11158, interfacesAppLabelMap-11181, railServedLabels-12688, zhPillarNames-11801, navEntryIdentity-11774) join this file in the next PR from this branch.

Clause-②: no
Metadata-protocol: none

Measured first (base f143cd8, this container, under os-verify-lock, --maxWorkers=2)

Per-file vitest module diagnostics over the 95 StudioDesignSurface.* files (656 tests). Fixed cost = environment + prepare + setup + import:

  • Fixed cost: 678 s, which is 66.4 % of 1022 s CPU. Test bodies: 344 s.
  • Median file: 6.8 s fixed against 1.2 s of tests. The per-file import of the module graph is the lever, and a shared setup removes it.
  • Outlier, not touched here: autosaveSwitch-11232 takes 94 s, 72 s of it inside its tests (19 real 2.5 s debounce sleeps). That is not setup cost.

Before / after (same command, same box, --maxWorkers=2, shared-box seconds)

files tests fixed CPU test CPU total CPU wall
before (f143cd8) 95 656 678.3 s 343.8 s 1022.1 s 528.4 s
after (76d53f2) 91 656 644.9 s 335.3 s 980.2 s 507.0 s
the five pins alone 5 → 1 25 → 25 34.4 s → 7.3 s 3.7 s → 3.0 s 38.1 s → 10.3 s

The family-level test CPU moves by about ±10 s from run to run on this shared box. The per-file rows are the clean reading: each folded file saves about 5 to 6 s of fixed cost.

Issue number → describe (reviewer check: no assertion dropped)

former file describe in StudioDesignSurface.railLabels.test.tsx tests
StudioDesignSurface.railLabelInherits-11196.test.tsx StudioDesignSurface.railLabelInherits-11196 (objectui#11196) 3
StudioDesignSurface.surfaceLabelInherits-11196.test.tsx StudioDesignSurface.surfaceLabelInherits-11196 (objectui#11196) 5
StudioDesignSurface.surfaceIdentity.test.tsx StudioDesignSurface.surfaceIdentity 4
StudioDesignSurface.navRailLabels-11862.test.tsx StudioDesignSurface.navRailLabels-11862 (objectui#11862) 6
StudioDesignSurface.railSeparatorBadge-11791.test.tsx StudioDesignSurface.railSeparatorBadge-11791 (objectui#11791) 7

Each block keeps its former file's header comment, fixtures, hooks and inner describe names verbatim, indented one level. The mechanical check against the five files at f143cd8 gives the same it titles, 25 of 25 as an identical sorted list, and the same expect( count, 70 against 70. The run reports 25 tests passed in the folded file, the same 25 the five files reported.

What changed besides the indentation:

  • The three vi.mock factories read studio.client, a vi.hoisted slot, instead of each file's mockClient. Each block's first beforeEach sets the slot to its own mockClient. The fetchPackages and useAdapter doubles were identical in all five files.
  • Three comments named a test file this PR deletes, and now name the block that replaced it: two inside the folded blocks, and one in StudioDesignSurface.interfacesRailLabelMap-11158.test.tsx.
  • NavTree's JSDoc in StudioDesignSurface.tsx names the folded file. tsc keeps comments, so the published dist changes by that one comment, and the PR carries a patch changeset for @object-ui/app-shell.

Isolation: RTL cleanup() and react-i18next's global reset run after every test, as before. No block in the file registers into a metadata or component registry.

Not in this PR

  • The other five rail pins: they go in the next PR from this branch, once this one merges.
  • date-only-zone-pins-10183: premise stale, not split. ui/scripts/__tests__/date-only-zone-pins-10183.test.ts already drives all 26 pins through ONE memoized forked child vitest (73 s measured), so the card's "collapse into one spawn" is already true. Splitting it would only rebalance shard legs, not cut CPU, and the seat ruled it out.
  • cli-bin split (ui/packages/cli/src/__tests__/cli-bin.test.ts, 81 s here: a 33 s self-build in beforeAll plus 48 serial CLI spawns): this is slice 2, which comes after both rail PRs.

Acceptance notes

  • autosaveSwitch-11232 (94 s, real-time debounce sleeps) is the next-largest single lever in this family. It is noted here and not touched.

Verification (head 76d53f2)

  • pnpm exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface --maxWorkers=2 (from ui/): 91 files, 656 tests passed.
  • tsc -p tsconfig.test.json --noEmit in ui/packages/app-shell: 0 error TS. eslint on the changed test files: 0 problems.
  • Derived gates (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, re-derived with the changeset): 35 derived, 35 run, every one exit 0, and --ran reconciles as a derived zero. CI on 76d53f2 is green: all eight required contexts passed, as did Check Changeset and the 16 Test UI legs.

No sdui record change: this is test-only in app-shell apart from the comment.


Generated by Claude Code

https://claude.ai/code/session_012Vh1mJSJN3FeocpnWPNdH1


Generated by Claude Code

@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 26, 2026
…ve return for the next slice

Claude-Session: https://claude.ai/code/session_012Vh1mJSJN3FeocpnWPNdH1
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot removed the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 26, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · seat domain:ui#1 · 2026-10-26T18:03Z

Head 76d53f205 (read from the PR object). The seat wrote the dev's replacement body for the 5-file fold.

  • Shape. Draft on main, with Part of #25911 (slice 1a; the other five pins follow from this branch). Root changeset .changeset/25911-studio-rail-labels-fold.md is an @object-ui/app-shell patch with Clause-②: no and Metadata-protocol: none. It is needed because one JSDoc line in StudioDesignSurface.tsx changes published dist, so skip-changeset was removed. 1603 changed lines, under the 3,000 bar.
  • Checks pinned to the head. All check runs completed: 0 failing, 0 pending, including Check Changeset. The seat's landing script checked this before posting.
  • Governed surface. check-governed-merges.mjs --pr 26255: not governed.
  • Diff read. Five StudioDesignSurface.* rail-label pins (railLabelInherits-11196, surfaceLabelInherits-11196, surfaceIdentity, navRailLabels-11862, railSeparatorBadge-11791) fold into StudioDesignSurface.railLabels.test.tsx. The three shared mocks are declared once, each former file becomes a named describe installing its own client double in beforeEach, and the assertions move verbatim. Two comments that named deleted files now name the block. No source logic changes.
  • Equivalence. it-titles 25/25 identical, expect( 70/70. The family runs 91 files, 656 tests, all green, with the same test count as before the fold. The five pins go from 38.1 s to 10.3 s total. The whole family goes from 1022 s to 980 s CPU and from 528 s to 507 s wall at 2 workers.
  • Serial constraints. Test files plus one comment in app-shell, which is outside the sdui closure. No open PR touches these files.

Landing: ready + auto-merge through the relay.

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

Labels

documentation Improvements or additions to documentation size/xl tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants