fix(chrome): keep tablet/desktop search page-anchored outside sticky header#1239
fix(chrome): keep tablet/desktop search page-anchored outside sticky header#1239BigSimmo wants to merge 6 commits into
Conversation
…header PR #1222 wrapped header+composer in the sticky collapse wrapper, so results search stuck under the top bar on sm+. Only the mode/new-chat bar stays sticky; the composer scrolls with the page. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughTablet/desktop search composers now remain page-anchored in normal document flow, while only the top-bar chrome participates in sticky collapse behavior. Documentation, component comments, static contracts, and breakpoint UI tests were updated accordingly. ChangesSearch composer placement
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Page as Page content
participant Header as MasterSearchHeader
participant Composer as Search composer
Page->>Header: report scroll direction
Header->>Header: hide or reveal top-bar chrome
Page->>Composer: retain in-flow document position
Composer->>Page: scroll with results content
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Prettier re-indented the collapse sticky gate when the composer moved outside the wrapper; match whitespace-flexibly so the contract stays stable. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #5710 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a719225dc0
ℹ️ 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".
|
@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. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/clinical-dashboard/master-search-header.tsx (1)
1446-1463: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winGate the hero fallback class on
desktopHomeComposerFallback, notisHeroDesktopComposer.
renderSearchComposer("default")is the inline fallback when the mode-home hero slot is unavailable, and the fallback is documented to keep search from vanishing. WithdesktopHomeComposerSlotIdpresent anddesktopHomeComposerFallbackstill false during the active portal path,isHeroDesktopComposeris true, sosm:hiddensuppresses that fallback inline composer at tablet/desktop. UseisHeroDesktopComposer && !desktopHomeComposerFallback ? "sm:hidden" : nullor otherwise gate on the portal failure state.🤖 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 `@src/components/clinical-dashboard/master-search-header.tsx` around lines 1446 - 1463, Update the conditional class selection in the composer className to apply "sm:hidden" only when isHeroDesktopComposer is true and desktopHomeComposerFallback is false. Preserve the fallback inline composer visibility when the portal slot is unavailable, while leaving the existing layout classes unchanged.
🧹 Nitpick comments (1)
tests/header-scroll-hide-contract.test.ts (1)
85-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winContract asserts on comment prose, which any reword breaks.
Line 90 pins an English sentence from a code comment, so a harmless comment edit fails the suite while a real regression (composer moved back inside the wrapper) could still pass. The behavioural assertions here are Lines 91–93 plus the new Playwright coverage; consider dropping the prose check or replacing it with a structural one (e.g. that
searchComposerBlockis rendered as a sibling ofuniversal-header-collapse, not a child).🤖 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 85 - 94, Update the test named “keeps tablet/desktop search composers page-anchored outside sticky header chrome” to remove the assertion on comment prose and replace it with a structural assertion that searchComposerBlock is rendered as a sibling of universal-header-collapse rather than inside it. Preserve the existing behavioral class assertions and Playwright coverage.
🤖 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.
Outside diff comments:
In `@src/components/clinical-dashboard/master-search-header.tsx`:
- Around line 1446-1463: Update the conditional class selection in the composer
className to apply "sm:hidden" only when isHeroDesktopComposer is true and
desktopHomeComposerFallback is false. Preserve the fallback inline composer
visibility when the portal slot is unavailable, while leaving the existing
layout classes unchanged.
---
Nitpick comments:
In `@tests/header-scroll-hide-contract.test.ts`:
- Around line 85-94: Update the test named “keeps tablet/desktop search
composers page-anchored outside sticky header chrome” to remove the assertion on
comment prose and replace it with a structural assertion that
searchComposerBlock is rendered as a sibling of universal-header-collapse rather
than inside it. Preserve the existing behavioral class assertions and Playwright
coverage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7f53e256-0831-48f7-96ee-ec8b5385a977
📒 Files selected for processing (5)
docs/search-chrome-behaviour.mdsrc/components/clinical-dashboard/global-search-shell.tsxsrc/components/clinical-dashboard/master-search-header.tsxtests/header-scroll-hide-contract.test.tstests/ui-chrome-scroll.spec.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a719225dc0
ℹ️ 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".
| </div> | ||
| </div> | ||
| </div> | ||
| {searchComposerBlock} |
There was a problem hiding this comment.
Keep internal-scroll composers with their scroller
On tablet/desktop ClinicalDashboard result views such as /?mode=prescribing&q=a&run=1, this places the composer outside the collapse wrapper but still before the independently scrolling <main> (ClinicalDashboard.tsx uses overflow-y-auto). Scrolling the results therefore cannot move the supposedly page-anchored composer, so it remains as a permanent top band after the header hides instead of scrolling away with the content. Keep this composer in the collapsible region or render it inside the dashboard scrollport; the smallest regression proof is to extend the existing dashboard-results Playwright case and assert that the form's bottom leaves the viewport after scrolling <main>.
AGENTS.md reference: AGENTS.md:L214-L220
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Updated
MasterSearchHeaderso tablet and desktop dashboard result composers collapse with the header row whenClinicalDashboarduses its internal<main>scrollport. Phone docks and document-scrolled shell composers remain outside the collapsing row. src/components/clinical-dashboard/master-search-header.tsxL1982-L2006 src/components/clinical-dashboard/master-search-header.tsxL2043-L2057 - Documented the distinction between internally scrolled dashboards and document-scrolled search shells. docs/search-chrome-behaviour.mdL40-L46
- Strengthened the static contract to verify both composer placements and preserve the non-sticky tablet/desktop styling. tests/header-scroll-hide-contract.test.tsL85-L98
- Added tablet and desktop Playwright regression coverage proving the prescribing-results composer belongs to the collapse row and leaves the viewport during internal scrolling. tests/ui-chrome-scroll.spec.tsL187-L209
- Committed the changes as
55a30ea(fix(chrome): collapse dashboard result composer) and created the requested follow-up PR metadata.
Testing
- ✅
npx vitest run tests/header-scroll-hide-contract.test.ts— 11 tests passed. - ✅
npx vitest run tests/test-runner-safety.test.ts— focused rerun passed all 18 tests. - ✅
npm run test:e2e -- tests/ui-chrome-scroll.spec.ts --project=chromium— the isolated production build and TypeScript validation completed successfully. ⚠️ npm run verify:cheap— all static, documentation, lint, and type checks passed; the suite reached 3,466 passing tests before three heavyweight-lock tests timed out under the environment load. Their focused rerun passed 18/18.⚠️ npm run test:e2e -- tests/ui-chrome-scroll.spec.ts --project=chromium— browser execution could not start because the required Playwright Chromium binary was absent.⚠️ npx playwright install chromium— Chromium download was blocked by HTTP 403 from the Playwright CDN, so browser screenshots could not be captured.- ✅
git diff --check— no whitespace errors. - ✅
git status --short --branch— worktree clean after commit.
|
@cursoragent fix merge conflict please |
|
Closing as superseded. #1238 already landed the durable tablet/desktop chrome fix (sticky [top bar | search] stack; only the top bar collapses). After merging main to resolve conflicts, this PR has 0 files changed vs main, so there is nothing left to ship here. |
Pull request was closed
|
Hygiene review (2026-07-26): this PR is MERGEABLE against current main with green required checks (or Production UI finishing). Prior contaminated Antigravity originals were closed; this clean supersede/fix is the intended land path. No code change from this note — ready for human merge when review/blockers clear. |


Summary
On tablet/desktop results pages (e.g.
/services?q=…), the search pill was glued under the sticky top bar. That was a regression from PR #1222: the sticky collapse wrapper wrapped header + composer, so hide-on-scroll chrome pulled the search into the header strip.Root cause:
MasterSearchHeaderputheaderAndComposerinside[data-testid="universal-header-collapse"]withsm:sticky. Combined with the composer’s ownsm:sticky top-[4.75rem], the search behaved as header chrome instead of page content.Fix:
header#search(mode / new chat / etc.) lives in the sticky collapse wrappersm:static/relative(page-anchored)/servicesresultsVerification
npx vitest run tests/header-scroll-hide-contract.test.ts(11 passed)npm run verify:cheap(3462 tests passed)npm run test:e2e -- tests/ui-chrome-scroll.spec.ts --project=chromium(14 passed, including new services page-anchored cases)/services?q=services&focus=1&run=1— search scrolls away; not stuck under headerRisk and rollout
Notes
No RAG / clinical / schema impact.
Summary by CodeRabbit