design(dictionary): measure the control row's intrinsic width in the fit strip, not its laid-out width - #2281
Conversation
…ut width Design-scratch mockup only; no production route or component changes. Addresses the Codex review finding on the fit strip. Summing the children's rendered rectangles measured what the flexbox had already handed out, not what the row wanted. `ml-auto` on Filter absorbed the slack in the idle state and `flex-1` on the query chip absorbed it in the search state, then truncated its own text to whatever it had been given — so every query width reported "one row · 0px spare" while the query was silently being cut off, which is precisely the failure the strip exists to expose. The verdict now probes the track under `max-content` for one synchronous read, so every child sizes to its content and `scrollWidth` is what the row actually wants. Truncation is reported as its own figure beside the fit, because a row can seat every control and still fail the reader. Verified in Chromium against the running dev server. Idle is unchanged in substance (390 px: one row, 55 px spare; 320 px wraps, 15 px short). The query states now tell the truth instead of reporting a dead heat: with "tardive" the row holds from 360 px up and 320 px is 31 px short with the query cut by 30 px; with "tardive dyskinesia" it is 28 px short at 390 px and only 430 px seats it. That is the measurement behind giving the search words their own line, and it was previously invisible. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:33 minutes Limit details: You’ve used the included review currently available. Your 90 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
FitRownow probes the track undermax-contentfor one synchronous read, so every child sizes to its own content regardless offlex-1orml-auto, andscrollWidthis what the row actually wants.This closes the last unresolved item from the Dictionary phone control-row task brief, tracked as A1 of issue #2270. The commit was written on the workstation on 2026-08-22 and never reached
origin, so no cloud session could see it.Why this replaces the fix already on
mainPR #2241 addressed the same Codex review finding (comment
3831169288) by tagging the query text withdata-fit-textand adding the clippedscrollWidth - clientWidthback into the summed width. That corrects the search states, but it patches the sum rather than the measurement, so the idle state is still read off post-layout rectangles and truncation stays folded into a single slack number.Probing under
max-contentremoves the need for the add-back entirely:neededis already an intrinsic width, so thetextOverflowterm becomes dead and is removed here. Thedata-fit-textmarker introduced by #2241 is kept and reused for the separate truncation figure, so the diff is the measurement change and nothing else.Design-scratch scope
src/components/dictionary-control-row-mockups.tsxis design scratch under/mockups/**, which 404s in production. No production route, component, or clinical surface changes. It is still typechecked and still weighed bycheck:bundle-budgetagainst themockupsbaseline.Verification
npm run verify:pr-localRun on the workstation against this commit.
check:runtime,check:installed-lock-parity,format:changed,lintandtypecheckall passed. The unit suite reportedTests 2 failed | 7728 passed | 72 skipped (7802); both failures are intests/gate-receipts.test.tsand are pre-existing and environmental, not caused by this change — they callchmodSync(file, 0o755)and assert the working-tree mode changes the signature, which cannot hold on this Windows ReFS Dev Drive wherecore.fileModeisfalseandchmodis a no-op. Reproduced identically on an unmodifiedmainat73b1e71a0with a clean working tree for those files:Tests 2 failed | 32 passed (34).The steps
verify:pr-localdid not reach after that failure were then run directly and all passed:npm run build(exit 0,Client bundle secret surface check passed),npm run check:bundle-budgetagainst a fresh.next(exit 0;mockups (design scratch, 404s in production, 100 routes, 119 exclusive chunks): 423.5 KiB gzip — baseline 370.2 KiB, within tolerance),check:rag:fixtures(36 golden cases, 26 suites),check:medication-interactionsandcheck:medication-lexicon-report.The bundle-budget run also emitted its known stale-baseline drift warnings (
production +5.3%,route / +7.8%,route /documents/search +6.7%, baseline 324 commits behind). Those are the pre-existing#QSHHGKbaseline-ownership issue and are not caused by this change; the check still exits 0.npm run verify:uiwas not run for this change. The Chromium suites exclude mockups by construction (test:e2e:prruns with--grep-invert "@quarantine|@mockup"), so the gate has no coverage of this file to offer. The full browser gates are being run separately against mergedmainas A2 of Local-only follow-ups after #2253 / #2266 / #2268 — browser gates, orphaned commits, dead reconcile branches, Dev Drive #2270.Because this is a measurement change that no automated gate can observe, it was verified live in Chromium against the local dev server at the URL
npm run ensureprinted, reading the rendered verdicts in all three fit modes:That reproduces the measurements recorded in the original commit message exactly, and it is the evidence behind the design decision to give the search term its own line:
"tardive dyskinesia"does not seat on one row until 430 px, which no phone in the width table provides.Risk and rollout
git revertthis single commit. It touches one file and depends on nothing else.Notes
The Codex review thread this addresses is
3831169288on PR #2241.