From 180db07b4f866a302b2f9d4d6fe6eba2dea95ea7 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Aug 2026 04:29:34 +0000 Subject: [PATCH 1/2] fix(chrome): reserve the smart-search hint in the phone mode-home composer slot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --spacing-mode-home-composer-phone reserved 106px while the settled block is 162px on every mode home. The 56px difference is the smart-search hint, which UniversalSearchCommandSurface renders inside that slot above the composer; the token was last measured as "composer pill plus privacy notice", before the hint existed. Under-reserving meant the slot grew when the portal adopted and pushed the action and pill stacks down — the layout shift chrome invariant 15 exists to prevent. Measured at 390px across six mode homes, before -> after: specifiers 0.0548 -> 0.0128 forms 0.0185 -> 0.0071 dsm 0.0465 -> 0.0108 factsheets 0.0170 -> 0.0045 therapy 0.0420 -> 0.0096 / 0.0196 -> 0.0051 The settled layout is unchanged: min-height now equals the settled height (162px), so only the pre-adoption reserve grows and committed visual baselines still match. This also makes the existing lighthouse-budget baseline correct for mobile-therapy-compass, whose recorded 0.000 predates Therapy having the hint at all — the graded gate measured 0.032 against it and would have inherited that red onto the next unrelated PR. The wide token is deliberately left short. Above sm the surface swaps the fixed phone ticket for a prompt-chip row that rewraps with viewport width (settled 160px at 1280, 199px at 800), so no single static value is correct everywhere; that needs a different mechanism and is tracked separately. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W5HsA9TpWxAN6KbqFAx7GA --- src/app/globals.css | 23 ++++++++++++++++++----- tests/search-route-ownership.test.ts | 6 +++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index cd58fffb27..08d4d14798 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -120,11 +120,24 @@ client host adopts them. Without this structural reserve, Therapy moved the entire action stack when hydration relocated the composer (CLS 0.248). These are layout tokens, not a second v2 colour/theme source. */ - /* Re-measured after the privacy notice stopped spending a full 48px tap box - on its own wrapped line: the settled phone composer block is 106px, so the - old 7.625rem (122px) left a 16px empty band under it. The wide value was - already exact (88px) and the notice is a single 16px line from sm up. */ - --spacing-mode-home-composer-phone: 6.625rem; + /* Re-measured 2026-08-19 at 390px across six mode homes (therapy-compass, + dsm, forms, factsheets, specifiers, and the shared `/` home): every one + settles at 162px, not the 106px this reserved. The 56px difference is the + smart-search hint, which `UniversalSearchCommandSurface` renders INSIDE + this slot above the composer — the earlier measurement counted only the + composer pill plus the privacy notice, before that hint existed. Under- + reserving it meant the slot grew on portal adoption and pushed the action + and pill stacks down on every ticket-bearing mode home (measured CLS: + specifiers 0.055, dsm 0.047, therapy 0.042, `/` 0.020, forms 0.019, + factsheets 0.017). The phone hint is a fixed 48px row, so 162px is exact + and the settled layout is unchanged — only the pre-adoption reserve grows. + + The wide value is knowingly still short (88px against a settled 160px at + 1280 and 199px at 800). It is NOT simply raised to match: the sm+ surface + swaps the phone ticket for a prompt-chip row that rewraps with viewport + width, so no single static value is correct at every width. That needs a + different mechanism and is tracked separately. */ + --spacing-mode-home-composer-phone: 10.125rem; --spacing-mode-home-composer-wide: 5.5rem; /* Hero medallion. Scales continuously with the viewport the way --text-hero diff --git a/tests/search-route-ownership.test.ts b/tests/search-route-ownership.test.ts index 062e62d8bb..fe526519e3 100644 --- a/tests/search-route-ownership.test.ts +++ b/tests/search-route-ownership.test.ts @@ -214,7 +214,11 @@ describe("shared-search route ownership", () => { expect(homeTemplateSource).not.toMatch( /mode-home-composer-slot block min-h-\[var\(--spacing-mode-home-composer-phone\)\]/, ); - expect(globalsSource).toContain("--spacing-mode-home-composer-phone: 6.625rem"); + // 162px: the settled phone composer block, measured across six mode homes. + // It must equal that height, not merely be non-zero — a reserve short of the + // settled height is what shifted the action/pill stacks on adoption, and a + // reserve above it would leave a permanent empty band. + expect(globalsSource).toContain("--spacing-mode-home-composer-phone: 10.125rem"); expect(globalsSource).toContain("--spacing-mode-home-composer-wide: 5.5rem"); }); From 24b8614f9a1bb255cbadd6e8f03167142bc58cde Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Aug 2026 05:00:40 +0000 Subject: [PATCH 2/2] docs(chrome): reconcile the 48px/56px measurements in the reserve comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment attributed the whole 56px increase to the smart-search hint and then described that hint as a fixed 48px row, without reconciling the two. Both numbers are right: the remaining 8px is the flex gap separating the hint from the composer (`gap-2` on `.universal-command-surface`; the `gap-1` in the same expression is the bottom-dock placement, not this slot). Comment only — the token, the measurements and the settled geometry are unchanged. Raised by CodeRabbit on PR #2171. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01W5HsA9TpWxAN6KbqFAx7GA --- src/app/globals.css | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 08d4d14798..8f4e9fcb90 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -124,13 +124,16 @@ dsm, forms, factsheets, specifiers, and the shared `/` home): every one settles at 162px, not the 106px this reserved. The 56px difference is the smart-search hint, which `UniversalSearchCommandSurface` renders INSIDE - this slot above the composer — the earlier measurement counted only the - composer pill plus the privacy notice, before that hint existed. Under- - reserving it meant the slot grew on portal adoption and pushed the action - and pill stacks down on every ticket-bearing mode home (measured CLS: - specifiers 0.055, dsm 0.047, therapy 0.042, `/` 0.020, forms 0.019, - factsheets 0.017). The phone hint is a fixed 48px row, so 162px is exact - and the settled layout is unchanged — only the pre-adoption reserve grows. + this slot above the composer: a 48px hint row plus the 8px flex gap that + separates it from the composer (`gap-2` on `.universal-command-surface` — + the `gap-1` in that same expression is the bottom-dock placement, not this + slot). The earlier measurement counted only the composer pill plus the + privacy notice, before that hint existed. Under-reserving it meant the slot + grew on portal adoption and pushed the action and pill stacks down on every + ticket-bearing mode home (measured CLS: specifiers 0.055, dsm 0.047, + therapy 0.042, `/` 0.020, forms 0.019, factsheets 0.017). Both the hint row + and its gap are fixed-height on phone, so 162px is exact: the settled + layout is unchanged and only the pre-adoption reserve grows. The wide value is knowingly still short (88px against a settled 160px at 1280 and 199px at 800). It is NOT simply raised to match: the sm+ surface