Skip to content

fix(ui): standardize edge-to-edge phone header collapse#1259

Merged
cursor[bot] merged 24 commits into
mainfrom
codex/phone-header-hidden-edge
Jul 26, 2026
Merged

fix(ui): standardize edge-to-edge phone header collapse#1259
cursor[bot] merged 24 commits into
mainfrom
codex/phone-header-hidden-edge

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • release the visible phone top safe area with the hidden universal header so content paints to the physical top edge with no white band
  • give all 13 app modes one shared hide/reveal signal, and portal Therapy, DocumentViewer, and Differential detail navigation into the same collapse track
  • prevent 320px min-content overflow and add cross-mode, edge-to-edge, oscillation, and frame-by-frame no-jump regressions

Verification

  • npm run verify:pr-local
  • npm run verify:ui — 308/308 Chromium tests passed
  • npm run verify:cheap
  • node scripts/run-playwright.mjs tests/ui-phone-scroll.spec.ts --project=chromium — 38/38 passed on the final main-synced code
  • Focused merged-head contracts — 54/54 passed
  • npm run verify:release — not run because the repo classifies the release gate as provider-confirmation-required; local Chromium, production build, full unit, and hosted required CI are the approved gates for this UI-only change

Risk and rollout

  • Risk: Low-to-moderate UI chrome risk. The change affects shared phone header geometry; tablet and desktop retain their existing safe-area/sticky contracts.
  • Rollback: Revert the squash commit to restore the previous phone-safe-area and Therapy-only collapse behavior.
  • Provider or production effects: Merging to main invokes the repository's configured Railway auto-deploy. No manual Railway, Supabase, OpenAI, or other provider workflow was called.

Clinical Governance Preflight

Not applicable — this changes shared responsive UI chrome and offline tests only; it does not alter ingestion, retrieval/ranking, answers, source rendering, document access, privacy, environment configuration, or clinical output.

Notes

RAG impact: no retrieval behaviour change — shared phone UI chrome, tests, and documentation only.

Summary by CodeRabbit

  • New Features

    • Added a dedicated phone “header collapse” hosting portal to unify collapsing-header behavior across search, Therapy Compass, document viewing, and differential detail pages.
    • Added focus-aware handling to keep the correct chrome pinned during phone header collapse hide/reveal.
  • Bug Fixes

    • Improved phone safe-area release and collapse-budget accounting to prevent clamping, oscillation, and scroll-jump behavior.
    • Tightened collapse ownership so only the intended top-bar row collapses.
  • Documentation

    • Updated the shared search chrome behavior contract for phone top-bar release and collapse ownership rules.
  • Tests

    • Expanded phone scroll hide/reveal, contract, and responsive-slot coverage; adjusted a few UI flow assertions for more reliable timing.

@supabase

supabase Bot commented Jul 26, 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

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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 Plus

Run ID: addc0152-f737-44f7-99f6-4af144e302e9

📥 Commits

Reviewing files that changed from the base of the PR and between e1d35fd and 0025d17.

📒 Files selected for processing (2)
  • docs/branch-review-ledger.md
  • tests/header-scroll-hide-contract.test.ts
📝 Walkthrough

Walkthrough

Phone-owned headers now share a universal phone collapse host and portal. Safe-area release is included in collapse-budget calculations, with updated documentation, route wiring, static contracts, and phone UI regression coverage.

Changes

Phone header collapse

Layer / File(s) Summary
Collapse contract and host wiring
docs/search-chrome-behaviour.md, src/components/clinical-dashboard/master-search-header.tsx, src/components/clinical-dashboard/global-search-shell.tsx, src/lib/mode-home-composer.ts
The phone collapse slot replaces the therapy-specific slot, the top-bar host is always rendered, focus within portaled controls pins the collapse owner, and hidden phone chrome releases its safe-area height.
Phone portal integration
src/components/clinical-dashboard/phone-header-collapse-portal.tsx, src/components/therapy-compass/*, src/components/DocumentViewer.tsx, src/components/differentials/differential-detail-page.tsx
A shared responsive portal moves phone navigation and page headers into the universal collapse track.
Collapse budget accounting
src/components/clinical-dashboard/use-hide-on-scroll.ts
Phone safe-area release height is measured and included in collapseBudget.
Contract and UI validation
tests/header-scroll-hide-contract.test.ts, tests/ui-phone-scroll.spec.ts, tests/therapy-compass-*.test.ts, tests/ui-smoke.spec.ts, tests/ui-tools.spec.ts, docs/branch-review-ledger.md
Tests validate host ownership, portal wiring, safe-area geometry, route-based hide/reveal behavior, animation monotonicity, viewport setup, locator scoping, mode wiring, and review-ledger updates.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PageHeader
  participant PhoneHeaderCollapsePortal
  participant MasterSearchHeader
  participant ScrollMetrics
  PageHeader->>PhoneHeaderCollapsePortal: render phone-owned header
  PhoneHeaderCollapsePortal->>MasterSearchHeader: portal into phone collapse host
  ScrollMetrics->>MasterSearchHeader: measure collapsed header and safe-area release
  MasterSearchHeader-->>PageHeader: hide or reveal shared chrome
Loading

Possibly related PRs

Suggested labels: codex

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change to phone header collapse behavior.
Description check ✅ Passed The description matches the required template with summary, verification, risk/rollout, governance preflight, and notes, and includes the needed UI verification context.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/phone-header-hidden-edge

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/header-scroll-hide-contract.test.ts (1)

154-164: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Whitespace-exact string assertions are brittle.

Lines 159-160 assert on a literal substring that embeds a \n plus the exact 12-space indentation of the ternary in master-search-header.tsx. A harmless reformat (e.g., Prettier re-wrapping that ternary) would fail this test with no functional change, even though the surrounding toContain checks in this same test file (e.g., Lines 111-113) already use this pattern more safely (single-line strings). Consider splitting into two whitespace-insensitive checks (e.g., separate toContain calls for headerChromeHidden and "max-sm:h-0, or a regex) to decouple the assertion from incidental formatting.

♻️ Suggested refactor to decouple from exact indentation
-    expect(headerSource).toContain('headerChromeHidden\n            ? "max-sm:h-0');
-    expect(headerSource).toContain(': "max-sm:h-[var(--safe-area-top)]');
+    expect(headerSource).toMatch(/headerChromeHidden\s*\?\s*"max-sm:h-0/);
+    expect(headerSource).toMatch(/:\s*"max-sm:h-\[var\(--safe-area-top\)\]/);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/header-scroll-hide-contract.test.ts` around lines 154 - 164, Update the
whitespace-sensitive assertions in the test named “releases the phone top
safe-area with hidden chrome while retaining the wide inset” so they no longer
require the exact newline and indentation between headerChromeHidden and the
max-sm:h-0 branch. Split the expectation into independent substring checks or
use a whitespace-insensitive pattern, while preserving validation of both the
condition and hidden-state class.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/header-scroll-hide-contract.test.ts`:
- Around line 154-164: Update the whitespace-sensitive assertions in the test
named “releases the phone top safe-area with hidden chrome while retaining the
wide inset” so they no longer require the exact newline and indentation between
headerChromeHidden and the max-sm:h-0 branch. Split the expectation into
independent substring checks or use a whitespace-insensitive pattern, while
preserving validation of both the condition and hidden-state class.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 49c361d4-43b1-4ed4-b72f-d176c3ec1a92

📥 Commits

Reviewing files that changed from the base of the PR and between dbcd4ce and 7cd4638.

📒 Files selected for processing (16)
  • docs/branch-review-ledger.md
  • docs/search-chrome-behaviour.md
  • src/components/DocumentViewer.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/clinical-dashboard/phone-header-collapse-portal.tsx
  • src/components/clinical-dashboard/use-hide-on-scroll.ts
  • src/components/differentials/differential-detail-page.tsx
  • src/components/therapy-compass/nav.tsx
  • src/components/therapy-compass/therapy-compass.css
  • src/lib/mode-home-composer.ts
  • tests/header-scroll-hide-contract.test.ts
  • tests/therapy-compass-mode-wiring.test.ts
  • tests/therapy-compass-responsive-contract.test.ts
  • tests/ui-phone-scroll.spec.ts
  • tests/ui-smoke.spec.ts
💤 Files with no reviewable changes (1)
  • src/components/clinical-dashboard/global-search-shell.tsx

@github-actions

Copy link
Copy Markdown
Contributor

CI triage

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

  • Production UImain-side: the same job also failed on the latest completed main CI run.
  • PR requiredmain-side: the same job also failed on the latest completed main CI run.

Compared with main CI run #5872 (failure).

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01c04ae1a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/clinical-dashboard/phone-header-collapse-portal.tsx
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 01c04ae1a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

cursoragent and others added 7 commits July 26, 2026 06:27
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…into codex/phone-header-hidden-edge

# Conflicts:
#	src/components/clinical-dashboard/master-search-header.tsx
#	tests/ui-phone-scroll.spec.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/clinical-dashboard/master-search-header.tsx`:
- Around line 413-434: Update the focus-listener effect around
phoneHeaderCollapseAddonRef to react to the addon host and collapse-strategy
lifecycle, not only hideOnScrollEnabled, so listeners attach when a conditional
host is created or replaced. When attaching, recompute headerChromeFocused from
the host’s current focus state; when detaching or cleaning up, clear
headerChromeFocused so removed portal content cannot leave sharedChromePinned
active.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9e1dafb-6a8c-46e8-bb38-1dafce61920c

📥 Commits

Reviewing files that changed from the base of the PR and between 1166fcf and 2622c60.

📒 Files selected for processing (4)
  • docs/branch-review-ledger.md
  • src/components/clinical-dashboard/master-search-header.tsx
  • tests/header-scroll-hide-contract.test.ts
  • tests/ui-phone-scroll.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/header-scroll-hide-contract.test.ts
  • tests/ui-phone-scroll.spec.ts
  • docs/branch-review-ledger.md

Comment thread src/components/clinical-dashboard/master-search-header.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2622c6026c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/clinical-dashboard/master-search-header.tsx
cursoragent and others added 3 commits July 26, 2026 07:06
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
BigSimmo added 3 commits July 26, 2026 15:12
…into codex/phone-header-hidden-edge

# Conflicts:
#	src/components/clinical-dashboard/master-search-header.tsx
#	tests/header-scroll-hide-contract.test.ts
@cursor
cursor Bot merged commit ecf54db into main Jul 26, 2026
26 checks passed
@cursor
cursor Bot deleted the codex/phone-header-hidden-edge branch July 26, 2026 07:30
cursor Bot pushed a commit that referenced this pull request Jul 26, 2026
Append final land/close rows for the authorized open-PR triage:
closed unsafe audit tips #1255/#1253, and prlanded #1257/#1212/#1241/#1248/#1254/#1259.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Sign up for free to 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