Skip to content

Fix Safety Plan phone header safe-area layout - #1711

Merged
BigSimmo merged 15 commits into
mainfrom
cursor/safety-plan-phone-safe-area-624a
Aug 8, 2026
Merged

Fix Safety Plan phone header safe-area layout#1711
BigSimmo merged 15 commits into
mainfrom
cursor/safety-plan-phone-safe-area-624a

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • /safety-plan sits outside the search shell and never padded for the OS top inset, so the tool header collided with the phone status bar.
  • The tool header now owns pt-[max(...var(--safe-area-top))] (same contract as /privacy and colour-coding) and restacks the phone chrome: back on its own tap row, then shield + title.
  • Desktop lg+ keeps the existing two-column header via lg:contents.
  • Added a focused DOM assertion that the header bakes in --safe-area-top and does not use axis py-*.
  • Follow-up CI fix: Scope Escape focus-restore onto the composer + trigger no longer reopens the command listbox via onFocusCapture (that overlay covered Browse library and failed Production UI critical). Mode-menu open also clears the command dropdown.

RAG impact: no retrieval behaviour change — UI-only standalone tool chrome spacing plus composer focus/dismiss behaviour; no retrieval, ranking, or answer surfaces touched.

Verification

  • npm run testtests/patient-safety-plan.dom.test.tsx + tests/patient-safety-plan-privacy.dom.test.tsx — 14 passed
  • Prettier check on changed files — clean
  • npm run ensurehttp://localhost:4461 (project identity confirmed)
  • Phone viewport check of /safety-plan — back on own row below top pad; title block below; no status-bar collision under the shared safe-area token
  • Focused Playwright: dashboard defers source and administration requests until their surfaces open @critical1 passed (3.1s)
  • UI verification not run: full npm run verify:ui deferred — change is standalone tool-header spacing outside the search shell plus a narrow composer focus/dismiss fix; phone viewport proof of /safety-plan already covered the original chrome; the failing Production UI critical journey is covered by the focused Playwright proof above

Risk and rollout

  • Risk: low; presentation-only phone header safe-area/stack for Safety Plan, plus narrow composer focus restore so Scope Escape does not reopen the command listbox over mode-home actions. No clinical content, privacy, storage, or export behaviour changes.
  • Rollback: revert the commits on cursor/safety-plan-phone-safe-area-624a.
  • 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
Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes

    • Closing search mode now also dismisses the command dropdown.
    • Restoring focus to other controls no longer reopens search suggestions.
    • Search suggestions remain closed when switching to document search.
  • UI Improvements

    • Improved safety-plan header layout across mobile and desktop.
    • Added safe-area spacing for mobile devices.
    • Ensured the mobile back button has a dedicated, touch-friendly row.
  • Tests

    • Added coverage for responsive safety-plan header spacing and search dropdown behavior.

Own the OS top inset on the standalone tool header and restack the
phone chrome so the back control sits below the status bar.

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

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 46 minutes

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: 5938ed19-986a-4f42-ad5c-c7d45e63c08a

📥 Commits

Reviewing files that changed from the base of the PR and between 5d8f13d and e7336c1.

📒 Files selected for processing (4)
  • docs/branch-review-ledger.md
  • src/components/clinical-dashboard/master-search-header.tsx
  • tests/patient-safety-plan.dom.test.tsx
  • tests/ui-smoke.spec.ts
📝 Walkthrough

Walkthrough

The changes update search-surface dismissal and focus handling. They also restructure the safety-plan header for safe-area-aware responsive layout and add regression coverage for both behaviors.

Changes

Search surface behavior

Layer / File(s) Summary
Search dismissal and focus handling
src/components/clinical-dashboard/master-search-header.tsx, src/components/clinical-dashboard/universal-search-command-surface.tsx, tests/ui-smoke.spec.ts
Mode dismissal now clears the command dropdown. Focus capture opens the command panel only for the global search input. Smoke tests verify that the search listbox stays closed.

Safety-plan header layout

Layer / File(s) Summary
Responsive safety-plan header
src/components/patient-safety-plan.tsx, tests/patient-safety-plan.dom.test.tsx
The header now uses safe-area top padding, mobile back-button grouping, and desktop grid layout. DOM tests verify the spacing and heading.

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

Possibly related PRs

Suggested labels: codex, skip-branch-sync

Suggested reviewers: cursoragent, claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: fixing the Safety Plan phone header safe-area layout.
Description check ✅ Passed The description covers the required summary, verification, risk, rollback, production effects, and governance sections with clear UI-specific evidence.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/safety-plan-phone-safe-area-624a

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

@supabase

supabase Bot commented Aug 7, 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 ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review August 8, 2026 04:58
@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.

@BigSimmo
BigSimmo enabled auto-merge (squash) August 8, 2026 04:58
@cursor
cursor Bot force-pushed the cursor/safety-plan-phone-safe-area-624a branch from 37f958d to 65d165b Compare August 8, 2026 05:34
@BigSimmo
BigSimmo disabled auto-merge August 8, 2026 05:35
@BigSimmo

BigSimmo commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@cursoragent Work the current open PR end-to-end. Confirm the PR number and GitHub head first from context. If more than one open PR could apply, stop and say which one you would use and why.

Fetch and start from the remote tip that matches that GitHub head. If the named branch ref is missing or stale, use the PR head ref. Preserve unrelated local WIP, including any local-only ledger commits; do not discard dirty work, and do not treat a local-ahead commit as the reviewed tip. Do not merge the PR, force-push, rebase, or arm auto-merge unless I explicitly ask. No provider-backed gates without separate approval. If you cannot push or resolve threads, diagnose and comment only; if inline replies fail, resolve when possible and put dispositions in the summary comment. If auto-merge is already armed, push only for a real blocker, and avoid pushes that would cancel in-flight required CI unless the push itself clears that blocker.

If the PR is already merged or closed: confirm the head and merge commit, note required-CI outcome, post one summary, and stop.

Goal: deep review plus Bugbot, fix actionable issues with the smallest correct changes, clear merge / required-CI / thread blockers, run strong local offline verification, push fixes, append the review ledger, and post one PR summary. Prefer thoroughness over speed. Regenerate large assets only when a fix requires it; then run the asset check and keep compatibility aliases byte-identical where the repo uses them.

Snapshot the GitHub head SHA: tip, base, behind/ahead, mergeable state, merge-tree versus origin/main (real conflict versus behind-but-clean), required checks on that tip including Production UI when selected, advisory separately, unresolved actionable threads. Missing checks while dirty are not green. If the tip moves mid-work, re-snapshot and continue from the new head.

Ledger-lookup against that GitHub head under the heavy review-and-fix scope for this PR. Already reviewed at this head with clean merge-tree, green required checks, and no new actionable threads → summarize, comment, stop unless I asked for a fresh superseding pass. Follow the repo review protocol.

Unblock once: real conflict → merge origin/main (prefer main’s shared queues; keep this PR’s notes); behind-but-clean → one sync, late if required CI is in flight; clean → leave. Labels like skip-branch-sync do not block a manual sync needed to clear a real blocker. No sync thrash. After any sync or push, re-snapshot tip, merge-tree, and required checks before declaring done. Dedupe the ledger if a merge touched it.

Review high-confidence delta risks only. Separate PR-introduced defects from pre-existing re-emitted debt. For generated assets, review contracts, aliases, cache, and manifests—not every generated line. If protected RAG or ranking surfaces are touched, say so before editing; fix PR-body policy text only when wrong or missing. Ignore bot noise. No nit spam or broad rewrites. Escalate verification by touched risk: clinical / RAG / privacy / migrations / auth → domain check plus production-readiness when warranted; UI / phone-chrome / routing / styling → ensure plus phone-chrome or UI gates when warranted; generated assets or docs inventory/links → asset or docs checks when warranted.

Fix P0/P1 always; clear scoped P2 when locally provable; else disposition and resolve. Required-check failures on this tip only; ignore advisory. Prefer reverting a bad autofix commit. After fixes: format and commit before push; smallest targeted proof; repo cheap gate; repo PR-local gate. No release, lighthouse, live eval, or live provider gates without approval.

Push only this PR’s fix commits. Append ledger for the final GitHub head under the heavy scope. Never push a ledger-only tip—include ledger in a real fix push, or leave a no-change ledger append local and unpushed.

One PR comment: tip, sync/merge-tree, fixed versus dispositioned, threads, required CI, decisive local gate lines, residual risks; merge left to me. Inline only for remaining human-needed P0/P1.

Stop when merge-tree is clean on the current GitHub tip, actionable threads are clear, required checks are green or clearly in progress, heavy gates for scope passed, summary posted, merge left to me.

@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR #1711 — tip 7bdb623fabcd6c98fa8d85ae55aaa413a04ec3c5#1711

Worked this PR only (Safety Plan phone safe-area). No product code fix this pass.

Snapshot

  • Merge-tree clean vs origin/main; behind cleared with one sync of #1712
  • 0 review threads; auto-merge off
  • Pre-sync tip 9d63a2f5 required CI was fully green
  • Post-sync required CI restarted and is in progress (PR policy / mergeability already pass)

Review

  • No high-confidence P0–P2 on the safe-area header delta
  • Bugbot/CodeRabbit/Codex had no usable findings (limits); manual review used instead
  • Residual: lg:contents quirks on older Safari (non-blocking)

Verification

  • DOM: Tests 14 passed (14) (pre- and post-sync)
  • verify:pr-local: 5538 passed | 4 skipped; build + RAG fixtures OK
  • verify:cheap: Gate-manifest OK (33); same unit suite green

Ledger / comment

  • Review ledger append kept local/unpushed (no ledger-only tip)
  • One summary comment posted on the PR

Merge left to you once post-sync PR required goes green.

Open in Web Open in Cursor 

Sync behind-but-clean tip with origin/main (#1712 design-system COMPONENTS §0.4).

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

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR #1711 review-and-fix summary

Tip: 7bdb623fabcd6c98fa8d85ae55aaa413a04ec3c5 on cursor/safety-plan-phone-safe-area-624a
Base: main @ 2675e6e1 (post-sync)

Snapshot

  • Mergeable: MERGEABLE; merge-tree vs origin/main: clean (behind-but-clean cleared by one sync of #1712)
  • Ahead/behind after sync: ahead 5 / behind 0
  • Unresolved review threads: 0
  • Auto-merge: not armed
  • Required CI on new tip: restarted after sync — Change scope / PR policy / Static / Production UI / PR required in progress (not green yet; not treated as green while settling)
  • Pre-sync tip 9d63a2f5 required CI: all green (PR required, Production UI 1–3 + critical, Static PR, Build, Unit coverage, Safety/config)

Findings

  • No high-confidence P0/P1/P2 in the Safety Plan phone safe-area delta (patient-safety-plan.tsx + DOM test only).
  • Header owns pt-[max(...var(--safe-area-top))] outside the search shell (same contract as /privacy / searchPageShellStandalone); avoids axis py-*; phone restack + lg:contents desktop restore; dirty leave confirm preserved.
  • Bugbot / CodeRabbit / Codex: no actionable findings available this pass (usage/rate limits / review cap). Manual deep review used instead.
  • Fixed: none (no product code change this pass).
  • Dispositioned: none (no actionable threads).

Sync

  • One behind-but-clean sync: merged origin/main (#1712 design-system COMPONENTS §0.4). Product files in this PR unchanged by the sync.
  • ledger:dedupe: no duplicates.

Local gates (decisive lines)

  • npx vitest run tests/patient-safety-plan.dom.test.tsx tests/patient-safety-plan-privacy.dom.test.tsxTest Files 2 passed (2) / Tests 14 passed (14) (pre- and post-sync)
  • npm run verify:pr-local -- --files src/components/patient-safety-plan.tsx,tests/patient-safety-plan.dom.test.tsxTests 5538 passed | 4 skipped (5542); Client bundle secret surface check passed.; Offline RAG fixture and manifest validation passed (36 golden cases, 23 suites). (exit 0)
  • npm run verify:cheapGate-manifest OK: all 33 verify:cheap gates…; Tests 5538 passed | 4 skipped (5542) (exit 0)
  • Not run: verify:ui / verify:phone-chrome / provider / release (UI chrome already covered by prior phone viewport proof + Production UI on pre-sync tip; no new product chrome change this pass; provider gates need separate approval)

Ledger

  • Local unpushed append for head 7bdb623f… scope pr-1711 heavy review-and-fix (no ledger-only push).

Residual risk

  • lg:contents phone→desktop restack can be quirky on older Safari; low severity, not a merge blocker for this inset fix.
  • Required CI must finish green on 7bdb623f before merge confidence is complete.

Merge left to you.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

CI triage

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

  • Production UI criticalneeds 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 #8987 (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 2 commits August 8, 2026 06:28
Focus restore onto the composer + trigger was reopening the documents
actions panel via onFocusCapture, covering Browse library and failing
the deferred-request @critical journey after the Button ref sync.

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

🧹 Nitpick comments (1)
src/components/patient-safety-plan.tsx (1)

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

Move safe-area header spacing to named theme tokens.

The component and its test duplicate raw spacing values. Define named Tailwind 4 @theme tokens in src/app/globals.css. Use those tokens in the max() expressions. Update the DOM assertions to match the token-based classes.

  • src/components/patient-safety-plan.tsx#L603-L603: replace 0.75rem and 1.25rem with named safe-area header spacing tokens.
  • tests/patient-safety-plan.dom.test.tsx#L35-L36: assert the token-based class names instead of raw spacing values.
Proposed fix
+/* src/app/globals.css */
+@theme {
+  --safety-plan-header-top-pad-phone: 0.75rem;
+  --safety-plan-header-top-pad-desktop: 1.25rem;
+}
- className="... pt-[max(0.75rem,var(--safe-area-top))] sm:pt-[max(1.25rem,var(--safe-area-top))]"
+ className="... pt-[max(var(--safety-plan-header-top-pad-phone),var(--safe-area-top))] sm:pt-[max(var(--safety-plan-header-top-pad-desktop),var(--safe-area-top))]"
- expect(className).toContain("pt-[max(0.75rem,var(--safe-area-top))]");
- expect(className).toContain("sm:pt-[max(1.25rem,var(--safe-area-top))]");
+ expect(className).toContain("pt-[max(var(--safety-plan-header-top-pad-phone),var(--safe-area-top))]");
+ expect(className).toContain("sm:pt-[max(var(--safety-plan-header-top-pad-desktop),var(--safe-area-top))]");

Confirm Tailwind emits both token references in the final stylesheet. As per coding guidelines, use Tailwind 4 @theme tokens rather than hardcoded design values.

🤖 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/patient-safety-plan.tsx` at line 603, Define named safe-area
header spacing tokens in src/app/globals.css using Tailwind 4 `@theme`, then
update the className in src/components/patient-safety-plan.tsx at lines 603-603
to use those tokens in both max() expressions. Update the DOM assertions in
tests/patient-safety-plan.dom.test.tsx at lines 35-36 to expect the token-based
classes, and verify Tailwind emits both token references in the final
stylesheet.

Source: Coding guidelines

🤖 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 `@tests/patient-safety-plan.dom.test.tsx`:
- Line 37: Update the className assertion in the patient safety plan regression
test to reject both unprefixed and variant-prefixed vertical padding utilities,
including classes such as sm:py-*. Preserve acceptance of unrelated utilities
and keep the check scoped to py-* axis classes.

---

Nitpick comments:
In `@src/components/patient-safety-plan.tsx`:
- Line 603: Define named safe-area header spacing tokens in src/app/globals.css
using Tailwind 4 `@theme`, then update the className in
src/components/patient-safety-plan.tsx at lines 603-603 to use those tokens in
both max() expressions. Update the DOM assertions in
tests/patient-safety-plan.dom.test.tsx at lines 35-36 to expect the token-based
classes, and verify Tailwind emits both token references in the final
stylesheet.
🪄 Autofix

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

Run ID: c96e0ae4-2850-4d0a-8841-26d799dd4c88

📥 Commits

Reviewing files that changed from the base of the PR and between 00826bc and 5d8f13d.

📒 Files selected for processing (5)
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/clinical-dashboard/universal-search-command-surface.tsx
  • src/components/patient-safety-plan.tsx
  • tests/patient-safety-plan.dom.test.tsx
  • tests/ui-smoke.spec.ts

Comment thread tests/patient-safety-plan.dom.test.tsx
@BigSimmo

BigSimmo commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@cursoragent Work the current open PR end-to-end. Confirm the PR number and GitHub head first from context. If more than one open PR could apply, stop and say which one you would use and why.

Fetch and start from the remote tip that matches that GitHub head. If the named branch ref is missing or stale, use the PR head ref. Preserve unrelated local WIP, including any local-only ledger commits; do not discard dirty work, and do not treat a local-ahead commit as the reviewed tip. Do not merge the PR, force-push, rebase, or arm auto-merge unless I explicitly ask. No provider-backed gates without separate approval. If you cannot push or resolve threads, diagnose and comment only; if inline replies fail, resolve when possible and put dispositions in the summary comment. If auto-merge is already armed, push only for a real blocker, and avoid pushes that would cancel in-flight required CI unless the push itself clears that blocker.

If the PR is already merged or closed: confirm the head and merge commit, note required-CI outcome, post one summary, and stop.

Goal: deep review plus Bugbot, fix actionable issues with the smallest correct changes, clear merge / required-CI / thread blockers, run strong local offline verification, push fixes, append the review ledger, and post one PR summary. Prefer thoroughness over speed. Regenerate large assets only when a fix requires it; then run the asset check and keep compatibility aliases byte-identical where the repo uses them.

Snapshot the GitHub head SHA: tip, base, behind/ahead, mergeable state, merge-tree versus origin/main (real conflict versus behind-but-clean), required checks on that tip including Production UI when selected, advisory separately, unresolved actionable threads. Missing checks while dirty are not green. If the tip moves mid-work, re-snapshot and continue from the new head.

Ledger-lookup against that GitHub head under the heavy review-and-fix scope for this PR. Already reviewed at this head with clean merge-tree, green required checks, and no new actionable threads → summarize, comment, stop unless I asked for a fresh superseding pass. Follow the repo review protocol.

Unblock once: real conflict → merge origin/main (prefer main’s shared queues; keep this PR’s notes); behind-but-clean → one sync, late if required CI is in flight; clean → leave. Labels like skip-branch-sync do not block a manual sync needed to clear a real blocker. No sync thrash. After any sync or push, re-snapshot tip, merge-tree, and required checks before declaring done. Dedupe the ledger if a merge touched it.

Review high-confidence delta risks only. Separate PR-introduced defects from pre-existing re-emitted debt. For generated assets, review contracts, aliases, cache, and manifests—not every generated line. If protected RAG or ranking surfaces are touched, say so before editing; fix PR-body policy text only when wrong or missing. Ignore bot noise. No nit spam or broad rewrites. Escalate verification by touched risk: clinical / RAG / privacy / migrations / auth → domain check plus production-readiness when warranted; UI / phone-chrome / routing / styling → ensure plus phone-chrome or UI gates when warranted; generated assets or docs inventory/links → asset or docs checks when warranted.

Fix P0/P1 always; clear scoped P2 when locally provable; else disposition and resolve. Required-check failures on this tip only; ignore advisory. Prefer reverting a bad autofix commit. After fixes: format and commit before push; smallest targeted proof; repo cheap gate; repo PR-local gate. No release, lighthouse, live eval, or live provider gates without approval.

Push only this PR’s fix commits. Append ledger for the final GitHub head under the heavy scope. Never push a ledger-only tip—include ledger in a real fix push, or leave a no-change ledger append local and unpushed.

One PR comment: tip, sync/merge-tree, fixed versus dispositioned, threads, required CI, decisive local gate lines, residual risks; merge left to me. Inline only for remaining human-needed P0/P1.

Stop when merge-tree is clean on the current GitHub tip, actionable threads are clear, required checks are green or clearly in progress, heavy gates for scope passed, summary posted, merge left to me.

BigSimmo and others added 4 commits August 8, 2026 16:22
Match the standalone shell contract so breakpoint-prefixed py utilities
cannot bypass the safe-area top-pad regression check.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Late sync behind-but-clean tip with origin/main (#1720) after required CI
settled green on 78c1420.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Review outcome for the post-sync tip after the sm:py guard fix and late
main sync (#1720).

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

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

PR #1711 review-and-fix summary

Tip: 9f3b5a29ca45f2017fff379d641068d13363ab71 on cursor/safety-plan-phone-safe-area-624a
Product/sync tip recorded in ledger: ad1b1f5db24ed68ee4c0d5963620e4562829884e (tip = that + ledger append)
Base: main @ 5c0504a4 (#1720)

Snapshot

  • Mergeable: MERGEABLE; merge-tree vs origin/main: clean (behind-but-clean cleared by one late sync of #1720 after required CI settled on 78c14205)
  • Ahead/behind after sync: ahead 12 / behind 0
  • Auto-merge: not armed
  • Unresolved actionable threads: 0 (CodeRabbit sm:py-* thread resolved; inline reply API returned 403 — disposition below)
  • Bugbot: no Bugbot findings on this PR
  • Required CI: green on pre-sync tip 78c14205 (Production UI critical + (1)(2)(3) + PR required SUCCESS). Re-queued on post-sync tip 9f3b5a29 — in progress. Advisory Lighthouse fail ignored.
  • RAG/ranking: not touched

Review

  • No high-confidence P0/P1 in the PR delta (safety-plan phone safe-area header + Scope Escape / command-listbox focus fix).
  • Pre-existing debt: none that this PR introduced or is obliged to fix.

Fixed

  • CodeRabbit thread on tests/patient-safety-plan.dom.test.tsx: added sm:py-* rejection to match tests/search-page-shell-standalone.contract.test.ts (commit 78c14205).

Dispositioned (inline reply failed — 403)

  • Thread tests/patient-safety-plan.dom.test.tsx / CodeRabbit variant-prefixed py-*: fixed at 78c14205 (parity with standalone shell contract). GraphQL resolve succeeded; comment reply denied.

Local gates (decisive lines)

  • Targeted vitest: Test Files 3 passed (3) / Tests 18 passed (18)
  • verify:cheap: Test Files 523 passed (523) / Tests 5582 passed | 4 skipped (5586) (exit 0)
  • verify:pr-local: All matched files use Prettier code style! · same unit suite · Client bundle secret surface check passed. · Offline RAG fixture and manifest validation passed (36 golden cases, 23 suites). (exit 0)
  • Hosted required CI on 78c14205: Production UI critical+(1)(2)(3) + PR required pass

Not run

  • verify:ui / verify:phone-chrome / verify:release / live provider gates — not approved; prior tip already had Production UI green; this pass only added a DOM-test guard + main sync.

Residual risks

  • Safe-area proof remains class-string/DOM; Chromium cannot certify physical Safari/PWA paint under real insets.
  • Header-local pad can still drift from privacy/colour-coding token values later.

Merge left to you.

@BigSimmo

BigSimmo commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@cursoragent Unblock the current open PR. Confirm the PR number and GitHub head first from context. If more than one open PR could apply, stop and say which one you would use and why.

Fetch and start from the remote tip that matches that GitHub head. If the named branch ref is missing or stale, use the PR head ref. Preserve unrelated local WIP; do not discard dirty work; do not treat a local-ahead commit as the reviewed tip. Do not merge the PR, force-push, rebase, or arm auto-merge. No provider-backed gates without approval. If you cannot push or resolve threads, diagnose and comment only; if inline replies fail, resolve when possible and put blocker dispositions in the summary comment. If auto-merge is already armed, push only for a real blocker and avoid cancelling in-flight required CI unless the push clears that blocker.

If the PR is already merged or closed: confirm outcome, post one summary, and stop.

Primary job: clear mergeability and required-CI blockers on this tip. Do a full product review only if needed to explain or fix a blocker. Stay light otherwise—no broad verification suites or Playwright unless needed to prove one concrete unblock fix.

Snapshot the GitHub head: tip, behind/ahead, mergeable state, merge-tree versus origin/main (real conflict versus behind-but-clean), required checks on that tip including Production UI when selected, and unresolved threads that block merge or required CI. Missing checks while dirty are not green. Tip moved → re-snapshot.

Ledger-lookup against that GitHub head under an unblock/fix scope for this PR. If already handled at this head for unblock work, merge-tree clean, required checks green, and no blocking threads: summarize, comment, stop.

Unblock once: real conflict → merge origin/main with the smallest correct resolution (prefer main’s shared queues; keep this PR’s notes); behind-but-clean → one sync, late if required CI is in flight; clean → leave. skip-branch-sync and similar labels do not block a manual sync needed to clear a real blocker. No sync thrash. After any sync or push, re-snapshot tip, merge-tree, and required checks before declaring done. Dedupe the ledger if a merge touched it.

Fix only what blocks required checks or mergeability on this tip. Ignore advisory red unless it reveals a real required failure. Prefer the smallest safe fix; if a bot/autofix commit caused the break, prefer revert. Prove with the smallest targeted check only. Format and commit before push.

Push only blocker-fix commits. Append ledger for the final GitHub head under the unblock scope. Never push a ledger-only tip.

One PR comment: tip, sync/merge-tree, what blocked and what you fixed or dispositioned, required CI status, residual risks; merge left to me.

Stop when merge-tree is clean on the current GitHub tip, no blocking threads remain for merge/required CI, and required checks are green or clearly in progress.

@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Taking a look!

Open in Web Open in Cursor 

@BigSimmo

BigSimmo commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@cursoragent Unblock the current open PR. Confirm the PR number and GitHub head first from context. If more than one open PR could apply, stop and say which one you would use and why.

Fetch and start from the remote tip that matches that GitHub head. If the named branch ref is missing or stale, use the PR head ref. Preserve unrelated local WIP; do not discard dirty work; do not treat a local-ahead commit as the reviewed tip. Do not merge the PR, force-push, rebase, or arm auto-merge. No provider-backed gates without approval. If you cannot push or resolve threads, diagnose and comment only; if inline replies fail, resolve when possible and put blocker dispositions in the summary comment. If auto-merge is already armed, push only for a real blocker and avoid cancelling in-flight required CI unless the push clears that blocker.

If the PR is already merged or closed: confirm outcome, post one summary, and stop.

Primary job: clear mergeability and required-CI blockers on this tip. Do a full product review only if needed to explain or fix a blocker. Stay light otherwise—no broad verification suites or Playwright unless needed to prove one concrete unblock fix.

Snapshot the GitHub head: tip, behind/ahead, mergeable state, merge-tree versus origin/main (real conflict versus behind-but-clean), required checks on that tip including Production UI when selected, and unresolved threads that block merge or required CI. Missing checks while dirty are not green. Tip moved → re-snapshot.

Ledger-lookup against that GitHub head under an unblock/fix scope for this PR. If already handled at this head for unblock work, merge-tree clean, required checks green, and no blocking threads: summarize, comment, stop.

Unblock once: real conflict → merge origin/main with the smallest correct resolution (prefer main’s shared queues; keep this PR’s notes); behind-but-clean → one sync, late if required CI is in flight; clean → leave. skip-branch-sync and similar labels do not block a manual sync needed to clear a real blocker. No sync thrash. After any sync or push, re-snapshot tip, merge-tree, and required checks before declaring done. Dedupe the ledger if a merge touched it.

Fix only what blocks required checks or mergeability on this tip. Ignore advisory red unless it reveals a real required failure. Prefer the smallest safe fix; if a bot/autofix commit caused the break, prefer revert. Prove with the smallest targeted check only. Format and commit before push.

Push only blocker-fix commits. Append ledger for the final GitHub head under the unblock scope. Never push a ledger-only tip.

One PR comment: tip, sync/merge-tree, what blocked and what you fixed or dispositioned, required CI status, residual risks; merge left to me.

Stop when merge-tree is clean on the current GitHub tip, no blocking threads remain for merge/required CI, and required checks are green or clearly in progress.

@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Taking a look!

Open in Web Open in Cursor 

Copilot AI 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.

Pull request overview

Updates the standalone Safety Plan tool’s phone header to correctly respect the OS top safe-area inset (since it’s outside the search shell), and tightens universal search focus/close behavior so closing Scope or mode surfaces can’t unintentionally reopen the command dropdown overlay on mode homes.

Changes:

  • Adjust /safety-plan header layout to own pt-[max(...,var(--safe-area-top))] and restack phone chrome (back row → shield/title), preserving the existing lg+ layout via lg:contents.
  • Add focused DOM test coverage to assert the safe-area pt-* contract and guard against introducing py-* on the header.
  • Prevent UniversalSearchCommandSurface from opening the command dropdown on focus restore unless focus lands on the actual search input; additionally ensure mode-surface close dismisses the command dropdown, with smoke coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/components/patient-safety-plan.tsx Makes the Safety Plan header own top safe-area padding and adjusts mobile vs lg+ layout stacking.
tests/patient-safety-plan.dom.test.tsx Adds a DOM assertion for the safe-area pt-* header contract and guards against py-* regression.
src/components/clinical-dashboard/universal-search-command-surface.tsx Restricts focus-capture dropdown opening to the actual global search input (avoids overlay reopening on focus restore).
src/components/clinical-dashboard/master-search-header.tsx Ensures closing mode surfaces also closes the command dropdown (in addition to scope/action menu).
tests/ui-smoke.spec.ts Adds UI smoke assertions that scope close and mode switching do not leave/reopen the suggestions listbox/popover.
docs/branch-review-ledger.md Updates the review ledger entries related to the work.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@BigSimmo
BigSimmo enabled auto-merge (squash) August 8, 2026 17:31
@BigSimmo
BigSimmo merged commit 2c492e2 into main Aug 8, 2026
26 checks passed
@BigSimmo
BigSimmo deleted the cursor/safety-plan-phone-safe-area-624a branch August 8, 2026 17:31
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.

3 participants