Skip to content

test: harden phone chrome verification and merge safeguards - #1279

Merged
BigSimmo merged 13 commits into
mainfrom
codex/phone-chrome-testing-infra-20260727
Jul 27, 2026
Merged

test: harden phone chrome verification and merge safeguards#1279
BigSimmo merged 13 commits into
mainfrom
codex/phone-chrome-testing-infra-20260727

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • add installed/lock parity checks for Next, React, Playwright, and TypeScript across local verification and CI
  • add risk-scoped verify:phone-chrome coverage with focused ownership journeys before full UI escalation
  • add settled-owner and atomic DOM/scroll geometry helpers plus stable phone chrome diagnostics
  • extract the dashboard chrome coordinator and document physical Safari/PWA acceptance
  • add a read-only, fail-closed final merge audit
  • stabilize the differential compare endpoint assertion discovered by the full Chromium run

Why

Repeated phone Safari/PWA regressions and CI races were being misclassified because dependency drift, duplicate hydrated owners, split geometry reads, and changing scroll ranges were not guarded consistently.

Areas touched

CI and package scripts; phone chrome test helpers and Playwright journeys; ClinicalDashboard, GlobalSearchShell, and DocumentViewer diagnostics; review/testing documentation.

Verification

  • npm run verify:phone-chrome: 91/91 contracts, 12/12 focused journeys, 323/323 full Chromium
  • exact repaired differential dock journey: 1/1 production Chromium
  • ESLint: passed with zero warnings
  • TypeScript: passed
  • full Vitest: 396 files, 3,554 passed, 2 skipped
  • production build and client-bundle secret scan: passed
  • offline RAG fixtures: 36 golden cases passed
  • branch review ledger and local final merge audit: passed

Not run / limitations

  • Physical iPhone Safari and cold-launch Home Screen PWA acceptance was not available locally and remains the only device-paint limitation.
  • No live Supabase, OpenAI, Railway mutation, or live RAG evaluation was run.
  • No dependency upgrade or forced audit fix was attempted.

RAG impact: no retrieval behaviour change — test infrastructure and UI diagnostics only.

Summary by CodeRabbit

  • Improvements

    • Improved mobile scrolling and browser chrome behavior across dashboards, document views, search, and calculator pages.
    • Smoother, more consistent hiding and revealing of headers, footers, and composer controls.
    • Improved handling of Safari and Home Screen PWA layouts, including keyboard and light/dark display states.
  • Quality

    • Added broader automated checks for mobile layout ownership, geometry, and scroll behavior.
    • Added safeguards to detect installed dependency versions that differ from the lockfile.

BigSimmo added 5 commits July 27, 2026 19:29
Add lock parity, risk-scoped phone coverage, stable geometry diagnostics, physical iPhone acceptance guidance, and a fail-closed final merge audit.
Re-converge the document endpoint while phone chrome transitions change the scroll range, preserving the strict one-pixel clearance assertion.
@supabase

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

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b76a1bd-e8db-4678-9608-a73c7b5e13f6

📥 Commits

Reviewing files that changed from the base of the PR and between 49266cd and 7a9f5b8.

📒 Files selected for processing (35)
  • .github/workflows/ci.yml
  • AGENTS.md
  • docs/README.md
  • docs/branch-review-ledger.md
  • docs/codebase-index.md
  • docs/codex-review-protocol.md
  • docs/phone-chrome-physical-acceptance.md
  • docs/scripts-index.md
  • docs/search-chrome-behaviour.md
  • docs/testing.md
  • package.json
  • scripts/check-installed-lock-parity.mjs
  • scripts/check-maintainability-budgets.mjs
  • scripts/final-merge-audit.mjs
  • scripts/phone-chrome-plan.mjs
  • scripts/verify-phone-chrome.mjs
  • scripts/verify-pr-local.mjs
  • src/components/ClinicalDashboard.tsx
  • src/components/DocumentViewer.tsx
  • src/components/calculators/search-page.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/phone-footer-layer-portal.tsx
  • src/components/clinical-dashboard/use-active-scroll-owner.ts
  • src/components/clinical-dashboard/use-dashboard-chrome-coordinator.ts
  • tests/clinical-dashboard-merge-artifacts.test.ts
  • tests/final-merge-audit.test.ts
  • tests/header-scroll-hide-contract.test.ts
  • tests/installed-lock-parity.test.ts
  • tests/playwright-scroll.ts
  • tests/playwright-settlement.ts
  • tests/ui-phone-scroll.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts
  • tests/verify-phone-chrome.test.ts
  • tests/verify-pr-local.test.ts

📝 Walkthrough

Walkthrough

This PR adds installed-lock parity checking, a final-merge-audit CLI, and a phone-chrome verification planner/CLI with supporting docs and CI wiring. It also refactors dashboard/document scroll ownership into shared active-scroll-owner and chrome-coordinator hooks, adding phone data-* attributes and updated Playwright test helpers.

Changes

Verification & CI Tooling Infrastructure

Layer / File(s) Summary
Installed dependency lock parity check
scripts/check-installed-lock-parity.mjs, package.json, .github/workflows/ci.yml, scripts/verify-pr-local.mjs, tests/installed-lock-parity.test.ts, tests/verify-pr-local.test.ts
New CLI compares installed package versions to package-lock.json, wired into verify:preflight, verify:ui, verify:release, CI, and verify-pr-local, with ordering/unit tests.
Final merge audit script
scripts/final-merge-audit.mjs, package.json, docs/codex-review-protocol.md, docs/scripts-index.md, tests/final-merge-audit.test.ts
Adds validatePullRequestSnapshot, local/provider merge audits, and audit:final-merge script with dry-run/health-check documentation and tests.
Phone-chrome verification planner and CLI
scripts/phone-chrome-plan.mjs, scripts/verify-phone-chrome.mjs, package.json, AGENTS.md, docs/scripts-index.md, docs/search-chrome-behaviour.md, docs/testing.md, tests/verify-phone-chrome.test.ts
Classifies changed files to build a staged verification plan (docs, lock parity, contracts, journeys, full UI), exposed via verify:phone-chrome CLI with --dry-run/--files/--full options.
Acceptance checklist docs and ledger updates
docs/phone-chrome-physical-acceptance.md, docs/README.md, docs/codebase-index.md, docs/branch-review-ledger.md, scripts/check-maintainability-budgets.mjs
Adds physical iPhone acceptance checklist, ledger entries for PR #1279, and lowers ClinicalDashboard.tsx maintainability budget from 4160 to 4140.

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

Phone Chrome Scroll-Ownership Coordinator

Layer / File(s) Summary
Active scroll owner and chrome coordinator hooks
src/components/clinical-dashboard/use-active-scroll-owner.ts, src/components/clinical-dashboard/use-dashboard-chrome-coordinator.ts
New hooks resolve "pending"/"main"/"document" scroll ownership and coordinate hide/transition state with throttled scroll reporting.
ClinicalDashboard coordinator integration
src/components/ClinicalDashboard.tsx
Replaces local hide-on-scroll/reserve logic with coordinator outputs, consolidates navigateMobileSection/focusComposerInput, and adds phone data-* attributes on <main>.
Phone footer layer scrollHidden context and shell/document wiring
src/components/clinical-dashboard/phone-footer-layer-portal.tsx, src/components/clinical-dashboard/global-search-shell.tsx, src/components/DocumentViewer.tsx, src/components/calculators/search-page.tsx
Extends footer-layer context with scrollHidden, adds usePhoneFooterLayerScrollHidden, and wires activeScrollOwner/phone data attributes across shell, document viewer, and calculator footer.
Coordinator/scroll-owner contract test updates
tests/header-scroll-hide-contract.test.ts, tests/clinical-dashboard-merge-artifacts.test.ts
Validates coordinator delegation, phone-owner data attributes, and updated PhoneFooterLayerContext naming.
Playwright geometry/settlement helpers and spec updates
tests/playwright-scroll.ts, tests/playwright-settlement.ts, tests/ui-phone-scroll.spec.ts, tests/ui-smoke.spec.ts, tests/ui-tools.spec.ts
Adds readPrimaryScrollAndDomGeometry and expectSingleSettledOwner helpers, used across specs to assert phone-owner attributes and settled ownership.

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

Sequence Diagram(s)

sequenceDiagram
  participant Dev
  participant CLI as verify-phone-chrome.mjs
  participant Scope as ci-change-scope.mjs
  participant Plan as phoneChromePlan
  Dev->>CLI: npm run verify:phone-chrome
  CLI->>Scope: get changed files (or --files)
  Scope-->>CLI: file list
  CLI->>Plan: phoneChromePlan(files, fullMode)
  Plan-->>CLI: stage commands and notes
  CLI->>CLI: run stages sequentially, stop on failure
Loading
sequenceDiagram
  participant MainEl as main scroll element
  participant Coordinator as useDashboardChromeCoordinator
  participant OwnerHook as useActiveScrollOwner
  participant Reporter as reportChromeScrollHide
  MainEl->>Coordinator: scroll event
  Coordinator->>Coordinator: throttle via requestAnimationFrame
  Coordinator->>Reporter: offset, collapse metrics, source element
  Coordinator->>OwnerHook: resolve owner from element geometry
  OwnerHook-->>Coordinator: "pending"|"main"|"document"
  Coordinator-->>MainEl: hidden/transition state, activeScrollOwner
Loading

Possibly related PRs

  • BigSimmo/Database#699: Both modify scripts/verify-pr-local.mjs, this PR adding check:installed-lock-parity to its default plan.
  • BigSimmo/Database#1270: Both touch phone-footer-layer-portal.tsx, ClinicalDashboard.tsx, DocumentViewer.tsx, and global-search-shell.tsx for phone chrome/scroll-hide wiring.
  • BigSimmo/Database#1234: Both modify global-search-shell.tsx and the related header-scroll-hide-contract.test.ts/ui-phone-scroll.spec.ts coverage around phone chrome/safe-area behavior.

Suggested labels: codex

✨ 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 codex/phone-chrome-testing-infra-20260727

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.

@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: 9fb8008dbc

ℹ️ 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 scripts/final-merge-audit.mjs Outdated
@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

Summary

  • Limited unsettled-state validation to the configured required checks, preventing failed advisory jobs such as Advisory UI from blocking the final merge audit. scripts/final-merge-audit.mjsL44-L54
  • Added a focused regression test covering a successful required aggregate alongside a failed advisory check. tests/final-merge-audit.test.tsL58-L68
  • Created commit 13cb96f (fix(ci): ignore advisory checks in final audit).
  • Prepared a new pull request titled “fix(ci): limit final merge audit to required checks.”
  • The GitHub review thread was not replied to or resolved because the trigger explicitly prohibited external API use. It therefore remains open for an authorized human or workflow to post the disposition marker.

Testing

  • node --input-type=module <<'EOF' … EOF — focused assertions confirmed advisory failures are ignored while required-check failures remain blocking.
  • git diff --check
  • ⚠️ node scripts/run-vitest.mjs run tests/final-merge-audit.test.ts --reporter=dot — could not run because node_modules/vitest/vitest.mjs is not installed; dependencies were not installed because the task prohibited dependency actions.
  • git status --short --branch — worktree is clean on branch work.

View task →

@github-actions

Copy link
Copy Markdown
Contributor

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 #5943 (success).

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: 16fe430d74

ℹ️ 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 scripts/phone-chrome-plan.mjs Outdated
@BigSimmo
BigSimmo merged commit b3c5e18 into main Jul 27, 2026
27 checks passed
@BigSimmo
BigSimmo deleted the codex/phone-chrome-testing-infra-20260727 branch July 27, 2026 15:58
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