Skip to content

fix(home): give the shared mode home the full hero design on phones - #2112

Merged
BigSimmo merged 15 commits into
mainfrom
claude/factsheets-homepage-routing-obr8g4
Aug 18, 2026
Merged

fix(home): give the shared mode home the full hero design on phones#2112
BigSimmo merged 15 commits into
mainfrom
claude/factsheets-homepage-routing-obr8g4

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • The mode pill never navigates to a mode's own route. changeMode (global-search-shell.tsx:675) sends every selection to /?mode=<id>, so the shared home at / is the only home most modes ever show. It rendered as a bare icon and title with the composer docked at the bottom, while the standalone routes it shadows (/factsheets, /dsm, …) carried a subtitle, the in-flow hero composer, the suggestion ticker, the privacy notice and the mode's caveat. Earlier work landed on those standalone routes, which the mode pill does not open.
  • Composer placement. The Tools phone-dock exception was keyed on resultKind, not on the Tools directory being mounted. Factsheets, Dictionary and Therapy Compass borrow kind: "tools" as a benign search kind (see their app-modes.ts comments), so on / they inherited the dock and lost the hero composer, ticker and privacy notice with it. shouldShowSharedHome already excludes mode=tools, so showSharedHome is the correct opt-back-in for heroComposerBreakpoint and centeredModeHome.
  • Per-mode copy.sharedHomePresentation carried only a title. It now carries a subtitle and an optional review-before-use caveat for every mode, taken verbatim from that mode's own standalone home so the wording matches whichever door a clinician came through. Previously only Answer showed a caveat here.
  • Geometry. Because the mode home is vertically centred, caveats of different lengths moved the composer between modes — Formulation sat 8px above Specifiers at 320px, which broke an existing guard. --mode-home-verification-reserve holds that slot at a constant height. Measured in Chromium across all 14 modes at 320/360/390/412px, the composer top is now pixel-identical for 12 of them.
  • Known gap, not addressed here. Therapy Compass and Dictionary have no entry in searchCommandSurfaceByMode, so they render no "Try this" suggestion row and sit 28px lower than the rest. Adding entries would also flip on remote search for those modes (commandSurfaceRemoteSearchEnabled defaults true), and the example queries are a clinical-content decision — left for a separate change rather than guessed at.

Verification

  • npm run verify:phone-chrome — exit 0, all five stages green:
    • lock-parity the complete installed tree matches package-lock.json
    • runtime Node and npm runtime match the repository contract
    • contractsTest Files 9 passed (9) / Tests 130 passed (130)
    • changed-browser (tests/ui-tools.spec.ts) — 95 passed (2.0m)
    • focused-browser10 passed (28.6s)
    • full-ui (verify:ui, complete Chromium suite) — 447 passed (14.1m)
  • npm run test (full offline unit suite) — Test Files 665 passed (665) / Tests 7101 passed | 4 skipped (7105)
  • npm run typecheck — clean
  • npm run format — run and committed

Note on the log: a [phone-chrome] stage "focused-browser" failed line appears in the contracts output. That is stderr from tests/verify-phone-chrome.test.ts > aborts on the first non-zero stage exit, which exercises the runner's own abort path. The stage itself passed and the gate exited 0.

Not run: verify:release, eval:*, check:supabase-project and any other provider-backed gate — none of the touched surfaces are retrieval, ranking, ingestion or answer-generation code, and provider access was not authorized for this task.

Risk and rollout

  • Risk: contained to the shared home's presentation and phone composer placement. pr-policy classifies the diff clinicalRisk: false, operationalRisk: false, ragRanking: false, ui: true. No retrieval, ranking, ingestion, auth or schema code is touched. The behavioural change is that three modes move from the phone bottom dock to the in-flow hero on / — the placement every other mode already used there — and that every mode now shows its own subtitle and caveat instead of only Answer.
  • Rollback: revert the commit. The new CSS token is only referenced by the shared home, so it leaves nothing behind.
  • Provider or production effects: None.

Notes

  • docs/search-chrome-behaviour.md is updated: the first ownership row now names the shared home explicitly, and a note records that the Tools row is scoped to the mounted directory rather than to resultKind, so the exception cannot leak back onto /.
  • The reserve is flat rather than banded, unlike --mode-home-copy-reserve next to it: Calculators' caveat wraps to three lines at every phone width, so a per-width band would resolve to the same value three times. The rationale and the measurements are in the CSS comment.
  • The hero copy block needed no work — measurement confirmed --mode-home-copy-reserve already absorbs every title/subtitle pair identically (103/83/83/73px at 320/360/390/412px across all modes), so adding subtitles cost nothing geometrically.
  • Two Playwright assertions that pinned the old bare shape were updated rather than deleted: the 320px test now pins the subtitle and caveat text instead of a paragraph count, and the hero-sizing test no longer exempts the shared home from the subtitle assertions. /?mode=factsheets and /?mode=dictionary were added to the in-flow-hero loop as regression cases for the composer-placement fix.

Generated by Claude Code

The mode pill never navigates to a mode's own route — `changeMode` sends
every selection to `/?mode=<id>` (global-search-shell.tsx), so the shared
home at `/` is the only home most modes ever show. It rendered as a bare
icon and title with the composer docked at the bottom, while the standalone
routes it shadows carried a subtitle, the in-flow hero composer, the
suggestion ticker, the privacy notice and the mode's caveat.
Two independent causes:
- The Tools phone-dock exception was keyed on `resultKind`, not on the Tools
directory being mounted. Factsheets, Dictionary and Therapy Compass borrow
`kind: "tools"` as a benign search kind, so on `/` they inherited the dock
and lost the hero composer, ticker and privacy notice with it.
`shouldShowSharedHome` already excludes `mode=tools`, so `showSharedHome`
is the correct opt-back-in for both `heroComposerBreakpoint` and
`centeredModeHome`.
- `sharedHomePresentation` carried only a title. It now carries the subtitle
and the review-before-use caveat for every mode, taken verbatim from that
mode's own standalone home so the wording matches whichever door a
clinician came through.
Because the mode home is vertically centred, per-mode caveats of different
lengths moved the composer between modes (Formulation sat 8px above
Specifiers at 320px). `--mode-home-verification-reserve` holds that slot at a
constant height, measured across every mode at 320/360/390/412px: the
composer top is now pixel-identical for 12 of 14 modes. The two that still
differ (Therapy Compass, Dictionary) have no entry in
`searchCommandSurfaceByMode`, so they render no suggestion ticker at all —
a content gap in a separate subsystem, reported rather than guessed at here.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@supabase

supabaseBot commented Aug 18, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitaiBot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in:57 minutes

Limit details: You’ve used all 1 included review currently available under your plan. You completed 102 included PR reviews in the past 7 days; at that activity level, included reviews refill 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?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cb7e9047-7712-495d-8580-d510f5ee529e

📥 Commits

Reviewing files that changed from the base of the PR and between 5ef065c and 3c90b37.

📒 Files selected for processing (10)
  • docs/branch-review-records/ca54149d26828a62369fda1bd657d46478a4ddb68cb50fa71963d5ee01c7a1e0.record.md
  • docs/branch-review-records/cf160394d2edd122aee9520f4ce17df15019615222cc8897febbc4f381054ffd.record.md
  • docs/search-chrome-behaviour.md
  • src/app/globals.css
  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/answer-status.tsx
  • src/lib/ui-copy.ts
  • tests/mobile-composer-reserve.test.ts
  • tests/shared-home-empty-state.dom.test.tsx
  • tests/ui-tools.spec.ts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actionsBot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Lighthouse budgetneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #12142 (success).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo
BigSimmo enabled auto-merge August 18, 2026 10:48
BigSimmoand others added 6 commits August 18, 2026 19:49
`check:maintainability-budgets` failed CI at 4149 lines against the
4140-line no-growth ceiling for ClinicalDashboard.tsx (Static PR checks
> Maintainability hotspot budgets). The two rationale comments this PR
added around heroComposerBreakpoint/centeredModeHome accounted for the
overage; condense them to the same information in fewer lines. No
logic change — heroComposerBreakpoint and centeredModeHome are
byte-identical expressions.
Run PR sweep fix for PR #2112.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@BigSimmo
BigSimmo disabled auto-merge August 18, 2026 12:47
@BigSimmo
BigSimmo enabled auto-merge August 18, 2026 13:32
@BigSimmo
BigSimmo disabled auto-merge August 18, 2026 14:15
@BigSimmo
BigSimmo enabled auto-merge (squash) August 18, 2026 14:59
@BigSimmo
BigSimmo merged commit 533989f into mainAug 18, 2026
25 checks passed
@BigSimmo
BigSimmo deleted the claude/factsheets-homepage-routing-obr8g4 branch August 18, 2026 15:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@BigSimmo@claude