Skip to content

fix: restore phone-safe dock behavior - #1355

Closed
BigSimmo wants to merge 3 commits into
mainfrom
codex/phone-bottom-band-ci-repro
Closed

fix: restore phone-safe dock behavior#1355
BigSimmo wants to merge 3 commits into
mainfrom
codex/phone-bottom-band-ci-repro

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix calculator search-page phone dock behavior and tighten phone tool scroll assertions.

RAG impact

  • RAG impact: no retrieval behaviour change

Summary by CodeRabbit

  • Bug Fixes

    • Fixed a mobile Safari issue that could leave a bottom gap or clip live content when the dock was hidden.
    • Preserved phone layout alignment and scroll position when the visual viewport height changes.
    • Ensured calculator search inputs lose focus after closing the sheet.
  • Tests

    • Expanded mobile geometry and scrolling coverage.
    • Improved search interaction checks to wait for controls to finish loading before entering text.
  • Documentation

    • Updated guidance describing phone scrolling behavior and viewport handling.

@supabase

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

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The PR replaces phone fixed-inset viewport roots with a shared in-flow, viewport-bounded shell, updates calculator dock focus reset behavior, and strengthens phone geometry, resize, hydration, and source-structure tests.

Phone viewport behavior

Layer / File(s) Summary
Bounded phone shell contract
src/app/globals.css, src/components/ClinicalDashboard.tsx, src/components/clinical-dashboard/global-search-shell.tsx, src/components/clinical-dashboard/use-hide-on-scroll.ts, docs/search-chrome-behaviour.md
Adds .phone-viewport-shell viewport sizing and applies it to mobile dashboard and search shells while updating related documentation.
Calculator dock focus reset
src/components/calculators/search-page.tsx, tests/ui-phone-scroll.spec.ts
Clears dock focus through a microtask when the active calculator changes and verifies the search input loses focus after closing the sheet.
Phone geometry and hydration validation
tests/clinical-dashboard-merge-artifacts.test.ts, tests/ui-phone-scroll.spec.ts, tests/ui-tools.spec.ts, docs/branch-review-ledger.md
Checks shell structure, bottom paint ownership, visual viewport resizing, scroll stability, phone runway, hydrated search input handling, and records verification results.

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

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude, cursoragent

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only includes Summary and RAG impact; it misses the required Verification, Risk and rollout, Notes, and any needed governance checklist. Add the template sections with the required verification checkboxes, risk/rollback and notes, and complete the clinical governance preflight if applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: restoring phone-safe dock behavior.
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

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.

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/app/globals.css`:
- Around line 2341-2349: Update the .phone-viewport-shell declarations inside
the max-width 639px media query to retain 100vh as the fallback, then move the
100svh min-height and height overrides into an `@supports` block for svh. Preserve
the existing sizing behavior while eliminating duplicate declarations flagged by
Stylelint.
🪄 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

Run ID: ff8d646c-42fa-4b01-bed5-9e8b7cfcac64

📥 Commits

Reviewing files that changed from the base of the PR and between b92c272 and 45b6545.

📒 Files selected for processing (10)
  • docs/branch-review-ledger.md
  • docs/search-chrome-behaviour.md
  • src/app/globals.css
  • src/components/ClinicalDashboard.tsx
  • src/components/calculators/search-page.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/use-hide-on-scroll.ts
  • tests/clinical-dashboard-merge-artifacts.test.ts
  • tests/ui-phone-scroll.spec.ts
  • tests/ui-tools.spec.ts

Comment thread src/app/globals.css
Comment on lines +2341 to +2349
@media (max-width: 639px) {
.phone-viewport-shell {
position: relative;
width: 100%;
min-height: 100vh;
height: 100vh;
min-height: 100svh;
height: 100svh;
}

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Avoid duplicate declarations that fail Stylelint.

The 100vh/100svh fallback pattern triggers the configured declaration-block-no-duplicate-properties errors. Put the svh override in @supports so the stylesheet passes lint while preserving fallback behavior.

Proposed fix
 `@media` (max-width: 639px) {
   .phone-viewport-shell {
     position: relative;
     width: 100%;
     min-height: 100vh;
     height: 100vh;
-    min-height: 100svh;
-    height: 100svh;
   }
 }
+
+@supports (height: 100svh) {
+  `@media` (max-width: 639px) {
+    .phone-viewport-shell {
+      min-height: 100svh;
+      height: 100svh;
+    }
+  }
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@media (max-width: 639px) {
.phone-viewport-shell {
position: relative;
width: 100%;
min-height: 100vh;
height: 100vh;
min-height: 100svh;
height: 100svh;
}
`@media` (max-width: 639px) {
.phone-viewport-shell {
position: relative;
width: 100%;
min-height: 100vh;
height: 100vh;
}
}
`@supports` (height: 100svh) {
`@media` (max-width: 639px) {
.phone-viewport-shell {
min-height: 100svh;
height: 100svh;
}
}
}
🧰 Tools
🪛 Stylelint (17.14.0)

[error] 2345-2345: Duplicate property "min-height" (declaration-block-no-duplicate-properties)

(declaration-block-no-duplicate-properties)


[error] 2346-2346: Duplicate property "height" (declaration-block-no-duplicate-properties)

(declaration-block-no-duplicate-properties)

🤖 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/app/globals.css` around lines 2341 - 2349, Update the
.phone-viewport-shell declarations inside the max-width 639px media query to
retain 100vh as the fallback, then move the 100svh min-height and height
overrides into an `@supports` block for svh. Preserve the existing sizing behavior
while eliminating duplicate declarations flagged by Stylelint.

Source: Linters/SAST tools

@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: 45b6545917

ℹ️ 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".

useEffect(() => {
if (!activeCalc) return undefined;
let cancelled = false;
if (!activeCalc) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the stale calculator contract assertion

When the required unit suite runs, tests/mobile-chrome-paint-contract.test.ts:62 still requires the exact source text if (!activeCalc) return undefined, so changing this branch to bare return makes that test—and therefore verify:cheap—fail before the UI fix can be handed off. Update the contract assertion to reflect the intentional cleanup-free effect form.

AGENTS.md reference: AGENTS.md:L167-L168

Useful? React with 👍 / 👎.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Reviewed at exact head 45b6545. No replacement hunk. The Safari scroll-owner/100dvh approach was stale and current main supersedes it. Source branch and worktree are preserved; this PR is closed only to remove the superseded review queue entry.

@BigSimmo BigSimmo closed this Jul 28, 2026
@BigSimmo
BigSimmo deleted the codex/phone-bottom-band-ci-repro branch July 30, 2026 09:10
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.

1 participant