From 8b2ac1cd1cffcb92a13d66341e5d82d3f8067aa8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 08:00:48 +0000 Subject: [PATCH 1/4] fix(factsheets): restore composer suggestions and phone centering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two follow-up gaps surfaced after PR #2091 landed: `factsheets` was never added to the per-mode search-command-surface config table, so the shared composer silently fell back to a bare input with no "Try this" ticker, autocomplete suggestions, or cross-mode chips (every other hero-placement mode already had an entry). Separately, ModeHomeMain's "center" alignment — used by Factsheets since it has no action/pill content — never actually centered on phone: `
`'s flex-1 has no effect because its real DOM parent in GlobalSearchShell is a plain block element, not a flex container, so the box collapsed to its own content height and pinned to the top instead of centering in the viewport. Mirror the existing sm+ min-height rule for phone, scoped to the "center" variant only so startOnPhone/start pages are unaffected. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014aSV4sbw6iFqEA7Y7JeVes --- src/components/mode-home-template.tsx | 12 ++++++++++-- src/lib/search-command-surface.ts | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/mode-home-template.tsx b/src/components/mode-home-template.tsx index 70865572ed..0d6ed179f0 100644 --- a/src/components/mode-home-template.tsx +++ b/src/components/mode-home-template.tsx @@ -140,8 +140,16 @@ export function ModeHomeHero({ export type ModeHomeMainAlign = "center" | "start" | "startOnPhone"; const MODE_HOME_MAIN_ALIGN_CLASS: Record = { - // Short empty homes — centre in the visible canvas. - center: "justify-center pt-[clamp(1.25rem,4vh,2.25rem)] sm:pt-[clamp(1.75rem,5vh,3.25rem)]", + // Short empty homes — centre in the visible canvas. `justify-center` alone + // has no visible effect on phone: `
`'s immediate parent + // (`mobile-composer-reserve-pad` in GlobalSearchShell) is a plain block + // element, not a flex container, so `
`'s `flex-1` never fires there + // and the box shrinks to its own content height instead of stretching to + // fill the viewport — there is nothing to centre within. The sm+ rule + // already carries an explicit `min-h` for the same reason; mirror it below + // sm so short phone content actually centres instead of pinning to the top. + center: + "max-sm:min-h-[calc(100dvh-var(--shell-header-h))] justify-center pt-[clamp(1.25rem,4vh,2.25rem)] sm:pt-[clamp(1.75rem,5vh,3.25rem)]", // Tall results / content — keep the top reachable on every breakpoint. start: "justify-start pt-3 sm:pt-4", // Content-rich homes that still fit after sm — top-align on phone only. diff --git a/src/lib/search-command-surface.ts b/src/lib/search-command-surface.ts index 506782033a..c7da653a39 100644 --- a/src/lib/search-command-surface.ts +++ b/src/lib/search-command-surface.ts @@ -153,6 +153,16 @@ const searchCommandSurfaceByMode: Partial Date: Tue, 18 Aug 2026 08:03:53 +0000 Subject: [PATCH 2/4] chore: record branch review ledger entry for PR #2101 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014aSV4sbw6iFqEA7Y7JeVes --- ...1acdbe61d91c20665e02df1aa60d3560900cd46e5c272b72d0a.record.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/branch-review-records/c7d5291702bbc1acdbe61d91c20665e02df1aa60d3560900cd46e5c272b72d0a.record.md diff --git a/docs/branch-review-records/c7d5291702bbc1acdbe61d91c20665e02df1aa60d3560900cd46e5c272b72d0a.record.md b/docs/branch-review-records/c7d5291702bbc1acdbe61d91c20665e02df1aa60d3560900cd46e5c272b72d0a.record.md new file mode 100644 index 0000000000..ff6749e856 --- /dev/null +++ b/docs/branch-review-records/c7d5291702bbc1acdbe61d91c20665e02df1aa60d3560900cd46e5c272b72d0a.record.md @@ -0,0 +1 @@ +| 2026-08-18 | claude/patient-factsheets-search-regression-8iyvnd | 8b2ac1cd1cffcb92a13d66341e5d82d3f8067aa8 | src/lib/search-command-surface.ts,src/components/mode-home-template.tsx | approved | test:focused (283 passed), typecheck clean, eslint clean, prettier clean, live Playwright verification at 390x844 against /factsheets, /dsm, /differentials | From a0c3395b24dffa3d9ccc341b2e8d1bb42158a5cf Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 08:19:10 +0000 Subject: [PATCH 3/4] fix(mode-home): correct phone min-height calc, fix broken alignment test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A frontend-ui-reviewer pass on the prior commit caught two real defects before merge: - The phone min-height only subtracted --shell-header-h, mirroring the sm+ formula verbatim. On phone, main's real parent (mobile-composer-reserve-pad) also carries real top/bottom padding (--phone-overlay-chrome-h, --mobile-composer-reserve) that is zero at sm+ but not on phone, so the under-subtraction pushed the document height ~40px past the viewport on /factsheets and /differentials (live-verified via document.documentElement.scrollHeight vs window.innerHeight — the actual scroll owner on phone per docs/search-chrome-behaviour.md; #main-content's own scrollHeight/ clientHeight is not a meaningful check since it isn't the bounded scrollport here). Subtract both padding terms instead; both are live CSS custom properties, so this composes correctly rather than baking in a snapshot value. - tests/mode-home-main-align.test.ts asserted a literal `center: "justify-center` adjacency, which the longer value broke once Prettier moved it onto its own line. Relaxed the regex to tolerate the whitespace Prettier legitimately introduces, without weakening what it actually checks (the value still starts with justify-center, the ordering the test cares about). test:focused's import-graph selection doesn't cover this test (it reads mode-home-template.tsx via readFileSync, not an import), so it passed focused review while this was broken; caught by running the full suite and the file directly this time. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014aSV4sbw6iFqEA7Y7JeVes --- src/components/mode-home-template.tsx | 16 +++++++++++++--- tests/mode-home-main-align.test.ts | 5 ++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/mode-home-template.tsx b/src/components/mode-home-template.tsx index 0d6ed179f0..2bf9e1cb31 100644 --- a/src/components/mode-home-template.tsx +++ b/src/components/mode-home-template.tsx @@ -146,10 +146,20 @@ const MODE_HOME_MAIN_ALIGN_CLASS: Record = { // element, not a flex container, so `
`'s `flex-1` never fires there // and the box shrinks to its own content height instead of stretching to // fill the viewport — there is nothing to centre within. The sm+ rule - // already carries an explicit `min-h` for the same reason; mirror it below - // sm so short phone content actually centres instead of pinning to the top. + // already carries an explicit `min-h` for the same reason, but its formula + // (`100dvh - shell-header-h`) is NOT safe to reuse verbatim below sm: on + // phone, `mobile-composer-reserve-pad` also adds real top/bottom padding + // (`--phone-overlay-chrome-h`, `--mobile-composer-reserve`) that is zero at + // sm+ but not on phone. Subtracting only the header there under-accounts + // for that padding and pushes the document past the viewport (~40px + // overflow, live-verified) — so both padding terms are subtracted here too. + // `--mobile-composer-reserve` is a live CSS var, not a baked-in constant: + // this composes correctly if its value ever changes for a route that + // adopts `center`, at the cost of animating alongside it exactly as the + // reserve pad's own padding does — that's the correct behaviour, not jank, + // since the available space genuinely is changing too. center: - "max-sm:min-h-[calc(100dvh-var(--shell-header-h))] justify-center pt-[clamp(1.25rem,4vh,2.25rem)] sm:pt-[clamp(1.75rem,5vh,3.25rem)]", + "justify-center pt-[clamp(1.25rem,4vh,2.25rem)] sm:pt-[clamp(1.75rem,5vh,3.25rem)] max-sm:min-h-[calc(100dvh-var(--phone-overlay-chrome-h)-var(--mobile-composer-reserve))]", // Tall results / content — keep the top reachable on every breakpoint. start: "justify-start pt-3 sm:pt-4", // Content-rich homes that still fit after sm — top-align on phone only. diff --git a/tests/mode-home-main-align.test.ts b/tests/mode-home-main-align.test.ts index 7c9ba0f4d8..301856aff3 100644 --- a/tests/mode-home-main-align.test.ts +++ b/tests/mode-home-main-align.test.ts @@ -28,7 +28,10 @@ describe("ModeHomeMain alignment contract", () => { expect(modeHomeSource).toMatch(/export type ModeHomeMainAlign/); expect(modeHomeSource).toMatch(/MODE_HOME_MAIN_ALIGN_CLASS/); expect(modeHomeSource).toMatch(/withoutJustifyUtilities/); - expect(modeHomeSource).toMatch(/center: "justify-center/); + // `\s*` (not a literal space) tolerates Prettier moving a long value onto + // its own line — this only asserts the value itself starts with the + // right justify-* utility, not source-line adjacency to the key. + expect(modeHomeSource).toMatch(/center:\s*"justify-center/); expect(modeHomeSource).toMatch(/start: "justify-start/); expect(modeHomeSource).toMatch(/startOnPhone: "justify-start/); // Must strip responsive/prefixed justify utilities, not only bare ones. From 28aa0f2a561f1191df3b81af823c464cf3b5699e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 08:21:02 +0000 Subject: [PATCH 4/4] chore: record corrected review ledger entry for PR #2101 Supersedes the prior record for this branch: that verification missed a broken test and a live phone scroll-overflow regression that a frontend-ui-reviewer pass caught before merge. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014aSV4sbw6iFqEA7Y7JeVes --- ...b8080a941b3ba8e54540b842a4341cf4b38c4b6f6a3b91ce316.record.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/branch-review-records/81997d38c381bb8080a941b3ba8e54540b842a4341cf4b38c4b6f6a3b91ce316.record.md diff --git a/docs/branch-review-records/81997d38c381bb8080a941b3ba8e54540b842a4341cf4b38c4b6f6a3b91ce316.record.md b/docs/branch-review-records/81997d38c381bb8080a941b3ba8e54540b842a4341cf4b38c4b6f6a3b91ce316.record.md new file mode 100644 index 0000000000..8573b0b878 --- /dev/null +++ b/docs/branch-review-records/81997d38c381bb8080a941b3ba8e54540b842a4341cf4b38c4b6f6a3b91ce316.record.md @@ -0,0 +1 @@ +| 2026-08-18 | claude/patient-factsheets-search-regression-8iyvnd | 1d16190bf74bd92faf272f17eab426ed08f37776 | src/components/mode-home-template.tsx,tests/mode-home-main-align.test.ts (correction to prior record's src/components/mode-home-template.tsx claim) | approved | corrected the min-height calc flagged by frontend-ui-reviewer (prior record understated verification: missed a broken tests/mode-home-main-align.test.ts and a live 40px phone scroll-overflow regression); full npm run test now green (661 files, 7079 passed, 4 skipped), tests/mode-home-main-align.test.ts run directly (5 passed), typecheck/eslint/prettier clean, live check of document.documentElement.scrollHeight vs window.innerHeight on /factsheets /differentials /dsm shows zero overflow |