Skip to content

Fix differentials results top clipped on mobile#938

Merged
cursor[bot] merged 20 commits into
mainfrom
cursor/fix-differentials-results-top-d760
Jul 19, 2026
Merged

Fix differentials results top clipped on mobile#938
cursor[bot] merged 20 commits into
mainfrom
cursor/fix-differentials-results-top-d760

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes differentials mobile search results being vertically clipped: tall results reused ModeHomeMain’s justify-center flex shell (from the edge-to-edge mobile layout), so Best Answer and the top of the list sat above the phone scrollport.
  • Introduces an exclusive contentAlign API (center | start | startOnPhone) on ModeHomeMain, strips stray justify-* className tokens (including responsive prefixes), and top-aligns differentials results while keeping empty homes centred.
  • Migrates content-rich mode homes (therapy, formulation, specifiers, DSM) to startOnPhone, and top-aligns forms/services only when their registries are seeded so short empty/loading notices stay centred.
  • Hardens compact Best Answer / chip typography so size overrides do not rely on cn() Tailwind conflict resolution, and stabilizes the home header wait in overlap Playwright coverage.

Verification

  • npx vitest run tests/mode-home-main-align.test.ts — 5/5 ModeHomeMain alignment contract.
  • Focused Chromium: differentials search badges stay single-line on narrow viewport — Best Answer fold + rank 1 proof.
  • tests/ui-overlap.spec.ts — 12/12; header wait tolerates transient hydration double-mount of header#search.
  • npm run verify:ui — hosted Production UI gate green on this PR head (includes the differentials fold + overlap journeys).

Risk and rollout

  • Risk: low — layout/alignment and test-only changes; no retrieval, answer generation, auth, RLS, or migrations.
  • Rollback: revert the PR commit; mode homes return to always-centred ModeHomeMain behavior.
  • Provider or production effects: none.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Notes

  • Root cause: commit 39d14a51 made ModeHomeMain a flex-1 justify-center shell. cn() concatenates classes and does not merge Tailwind, so call-site justify-start overrides were non-deterministic.
  • Prefer contentAlign over any justify-* in className on ModeHomeMain.

Tall search results were vertically centered inside ModeHomeMain, so on
phones the Best Answer and header band sat above the scrollport. Top-align
results via an explicit contentAlign prop (cn cannot override justify-*),
and prove Best Answer remains in the fold at scrollTop 0.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@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

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

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds configurable ModeHomeMain vertical alignment, migrates content-rich home screens to the new prop, adjusts compact best-answer rendering, and adds source-level and browser tests for alignment and visibility.

Changes

Differentials alignment

Layer / File(s) Summary
Configurable content alignment
src/components/mode-home-template.tsx, src/components/differentials/...
ModeHomeMain supports center, start, and startOnPhone, strips conflicting justify-* utilities, and the differentials page selects alignment from autoRunSearch.
Content-rich home integration
src/components/formulation/..., src/components/specifiers/..., src/components/therapy-compass/..., src/components/dsm/..., src/components/forms/..., src/components/services/..., src/components/clinical-dashboard/...
Home screens use contentAlign="startOnPhone", while mobile chips and compact best-answer content receive conditional density, spacing, sizing, and test identifiers.
Layout selectors and validation
tests/..., docs/..., PR_POLICY_BODY.md
Tests enforce the alignment contract, reject justify-based overrides, verify best-answer placement, stabilize header detection, and document the regression follow-up.

Estimated code review effort: 3 (Moderate) | ~25 minutes

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 20.00% 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
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.
Title check ✅ Passed The title is concise, specific, and accurately summarizes the main change: fixing the differentials results clipping on mobile.
Description check ✅ Passed The description matches the required template with summary, verification, risk/rollout, governance preflight, and notes sections filled in.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/fix-differentials-results-top-d760

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

Trace the clipped differentials top to 39d14a5's always-centered flex
shell. Expose exclusive contentAlign values (center/start/startOnPhone),
strip stray justify-* className tokens, migrate therapy/formulation/
specifiers off fragile overrides, and add static + Playwright guards so
tall results cannot silently re-center and hide their top again.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Completion checklist for this PR

  1. API hardeningModeHomeMain now uses exclusive contentAlign (center | start | startOnPhone); stray justify-* className tokens are stripped. Therapy / Formulation / Specifiers migrated off fragile overrides.
  2. Regression guardstests/mode-home-main-align.test.ts forbids ModeHomeMain className justify overrides; Playwright asserts Best Answer stays in the fold at scrollTop === 0; cause documented in docs/process-hardening.md (introduced by 39d14a51).
  3. Verify / push — Head 2df31818 pushed to cursor/fix-differentials-results-top-d760. Focused unit + Playwright proofs passed.

PR description note: a sync workflow previously overwrote this PR body with unrelated #932 administrator/migration text. The code on this branch is the differentials top-clip fix only — please restore the correct Summary/Verification/Risk/Clinical Governance text from the agent commits if the GitHub UI still shows the wrong description.

@github-actions

Copy link
Copy Markdown

CI triage

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

  • Production UIneeds 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 #3627 (cancelled).

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

cursoragent and others added 3 commits July 19, 2026 19:38
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Rewrite PR_POLICY_BODY.md so Sync PR policy body no longer overwrites #938
with the stale #932 admin/migration summary. Strip responsive justify-*
tokens, give Chip an exclusive density scale, top-align remaining
content-rich mode homes, harden the home header wait against hydration
double-mount, and bind the Best Answer fold check to the header band.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

@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 `@PR_POLICY_BODY.md`:
- Around line 17-19: Update the risk, rollback, and provider/production-effects
statements in PR_POLICY_BODY.md to reflect PR `#938`’s full scope, including
administrator-only access hardening, favourites/preferences persistence,
Supabase migrations, ingestion-worker redeployment, and production verification.
Do not claim the change is layout-only or has no auth, RLS, migration, provider,
or production impact; alternatively, explicitly scope the document to the
alignment stack and retain the required domain check and npm run
check:production-readiness.
🪄 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: 04c1cc13-d17d-4685-924a-cfbb611427e3

📥 Commits

Reviewing files that changed from the base of the PR and between 300f8b0 and ceb3505.

📒 Files selected for processing (10)
  • PR_POLICY_BODY.md
  • docs/branch-review-ledger.md
  • src/components/clinical-dashboard/differentials-home.tsx
  • src/components/dsm/dsm-home-page.tsx
  • src/components/forms/forms-home-page.tsx
  • src/components/mode-home-template.tsx
  • src/components/services/services-home-page.tsx
  • tests/mode-home-main-align.test.ts
  • tests/ui-overlap.spec.ts
  • tests/ui-tools.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/mode-home-main-align.test.ts
  • tests/ui-tools.spec.ts
  • src/components/mode-home-template.tsx

Comment thread PR_POLICY_BODY.md Outdated
cursoragent and others added 2 commits July 19, 2026 19:51
Record hosted Production UI / verify:ui evidence in PR_POLICY_BODY.md so
the Sync PR policy body job keeps the description policy-compliant.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

CodeRabbit disposition (PR_POLICY_BODY risk lines): that comment is not actionable for this PR. It appears to have read the previous synced body from #932 (admin/favourites/migrations). Current PR_POLICY_BODY.md and the live PR description correctly describe #938 as a layout-only ModeHomeMain/contentAlign fix with no auth, RLS, migrations, or provider effects. No change needed for that finding.

cursoragent and others added 2 commits July 19, 2026 20:01
Seeded forms/services homes stay startOnPhone to avoid phone clipping;
loading and unseeded notices are short, so keep those vertically centred
instead of pinning them under the header.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursor Bot enabled auto-merge (squash) July 19, 2026 20:08
cursoragent and others added 9 commits July 19, 2026 20:08
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Resolve ledger conflict by keeping both #933 Safari edge-to-edge and
#938 ModeHomeMain review rows. Product auto-merge kept contentAlign,
Chip density, and Best Answer fold assertions intact.

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>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Accept #942's deletion of the stale PR policy template so squash-merge
does not reintroduce it. Keep the already-synced #938 PR description.
Resolve ledger conflict by retaining both #942 closeout and #938 rows.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Resolve ledger-only conflict; product auto-merge clean.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
The #936 merge commit accidentally retained conflict markers in
docs/branch-review-ledger.md. Keep both #936 and #938 review rows.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Resolve ui-overlap gotoHome wait conflict by keeping the settled
single-header assertion with a short-circuit when already unique.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursoragent and others added 2 commits July 19, 2026 21:04
Keep ModeHomeMain contentAlign on Specifiers home while taking the
elevated results chrome. Resolve branch-review ledger by retaining both
review rows.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Adopt mode=answer pin + single header#search wait from #944 so
Production UI overlap checks avoid landing-preference dual-mount flakes.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@cursor
cursor Bot merged commit 3ea9946 into main Jul 19, 2026
16 checks passed
@cursor
cursor Bot deleted the cursor/fix-differentials-results-top-d760 branch July 19, 2026 21:22
cursor Bot pushed a commit that referenced this pull request Jul 19, 2026
Note the plan-scoped header gutter fix and the compare-dock pointer
poll after integrating latest main differentials work.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 20, 2026
Keep main closeout rows from #936/#941/#938 and the #940 review row.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 20, 2026
Note the plan-scoped header gutter fix and the compare-dock pointer
poll after integrating latest main differentials work.

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