Repository navigation
fix(components): re-measure the record header's width fold on another record - #36260
Conversation
… record (#35997) Claude-Session: https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oLLK7uoxp33riiBJL Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL Final green head for L1: |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5ozidcgr4FYrKfmrjD 维护者速读
席位核对 — ACCEPT (L1-d) · repo:objectstack#4 · head
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL Landing · head
State: ready + auto-merge; on MERGED |
Requested by Leehom · project thread
Fixes #35997
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
PageHeaderActions(record header bar,fitWidth): the width cap the row's wrapping lowers is now stored with the key it was measured on, the record id from the record context plus the names of the page's own inline-eligible actions. A render whose key differs (another record, or a changed action set) draws the full budget (3, or the page'smaxVisible), and the existing layout effect measures again, so a row that still wraps folds again one action at a time. The host-resize path (ResizeObserverclearing the cap) is unchanged.Read first, by risk:
ui/packages/components/src/renderers/layout/containers.tsx— the hunk at "A cap holds only for the record and action set it was measured on" (the key and the keyed read of the cap).setWidthCap({ key, cap: inline - 1 }).ui/packages/components/src/__tests__/page-header-record-bar-35593.test.tsx— the new top-level describe "re-measures the width fold on another record (objectstack#35997)".Two-minute verification:
pnpm --dir ui exec vitest run packages/components/src/__tests__/page-header-record-bar-35593.test.tsxfrom the repo root; expect 17 passed, among them "a record with fewer actions that fit draws min(maxVisible, count) again" and its CONTROL.Tests
widthCap ? widthCap.cap : null) throughscripts/ablation-replace.mjs: the first pin goes red withexpected [ 'Convert', 'Edit', 'More actions' ] to include 'Log call', 1 failed / 16 passed; restore verified by the tool (blob equals HEAD,git diff HEADempty). The test imports the renderer from source, so no build sits between the mutation and the run.Acceptance notes
key=; the drawers swaprecordIdOverride), so the row instance and its cap do survive a record switch; the defect reproduced in the new pin before the fix (the ablation leg is that reproduction).Verification
Every reading below is at head
621ca521, taken underscripts/pm/os-verify-lock.sh(shared box).Target file and package (green)
pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/src/__tests__/page-header-record-bar-35593.test.tsx: Test Files 1 passed (1), Tests 17 passed (17).pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/: Test Files 503 passed, 1 skipped (504); Tests 4847 passed, 24 skipped (4871); lock VERDICT command-exit 0.pnpm --filter @object-ui/components run type-check(bothtsc --noEmitandtsc -p tsconfig.test.json; the test project lists the edited test file): lock VERDICT command-exit 0.turbo run build --filter='@object-ui/components^...' --concurrency=2, 48 of 48 tasks successful.Ablation (red as expected, restored)
scripts/ablation-replace.mjs(anchor 1 to 0, blob 4de451fd to cd81ae01).expected [ 'Convert', 'Edit', 'More actions' ] to include 'Log call'. The CONTROL stays green under the mutation, as a control should.git diff HEADempty.Derived gates (dispatch-gates, 38 of 38 exit 0)
node scripts/pm/dispatch-gates.mjs --commandsderived 38 commands for this diff; all 38 ran and exited 0, among themcheck:nul-bytes,check:published-files,check:cross-package-test-inputs,check:test-source-alias,check:type-check-coverage,check:type-check-debt,check:sdui-manifest,check-adr-0087-registration --base origin/main,check-empty-changeset --base origin/main,check-changeset-no-major --base origin/mainandpnpm --dir ui exec vitest run scripts/(Test Files 172 passed, 2 skipped; Tests 5122 passed, 2 skipped).--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN, every line carrying its exit code.pnpm check:changeset-fixedexit 0 (its roster lives under.changeset/), andpnpm --dir ui run check:new-line-citations: 0 new citations.