fix(ui): repair dead text-4xs classes and six hydration races from #1375 - #1391
Conversation
The Chromium suite failed a different random subset on each contended run — always the same shape: a control that never enables, a menu that never opens. The repo already had the fix documented on `fillVisibleQuestionInput`: "Production HTML can be visible before React owns the controlled input. Filling during that gap is immediately overwritten by hydration and leaves the submit button disabled." The flaky sites bypassed that helper and filled raw. - ui-smoke "offline browser gate": raw fill -> fillVisibleQuestionInput. - ui-smoke "desktop mode options": retry open-then-assert together, since a click landing before React attaches the trigger handler is swallowed. - ui-tools submitDifferentialSearch: the helper now owns the fill and confirms the value stuck before submitting, so all three callers get hydration safety; their redundant raw fills are removed. - ui-accessibility differential filter: retry fill-then-enabled inline (that file has no React-internals helper). Previously flaky cases now pass 13/13 across three consecutive runs. Also record in docs/design-system.md that intermediate font weights (520/540/560/580/640/650/680) are deliberate on a variable face rather than drift — normalising Therapy Compass onto 600/700 was attempted on 2026-07-28 and reverted — plus the leading vocabulary and the trap that redefining Tailwind's --leading-tight/-snug silently retunes every existing call site. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 73879c63980bda09adbb9b5743c96cfefcb9a9f9)
Fifth instance of the same hydration race: the Settings trigger becomes visible before React attaches its handler, so the click is swallowed and "Account & app" never opens — `guide opens and dismisses at tablet` then fails on `expect(settings).toBeVisible()` after 30s. Wrap all three viewport branches in one retry of click-plus-resulting-dialog, matching the shape used for the composer, the mode menu and the header measurement. A swallowed first click retries; a dialog that never opens still fails. Passes 3/3 across three consecutive runs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit ba5893a095b2ec2a73f52c68481ad3dfccda1975)
Retiring --text-4xs killed its utility: Tailwind emits no `text-4xs` rule, so every remaining class is a no-op and that text silently falls back to inherited size. Two files carrying it landed from main while this port was in flight (#1273 phone in-page navigation mockups, #1362 therapy navigation mockups), so they were dead on arrival — five classes, nothing failing. Repoint all five to text-3xs, the 10px floor, and guard it: the design-token contract now fails if any tracked file under src/ references the retired class outside a comment. Mockups are deliberately NOT exempt from this one — a dead utility breaks a mockup exactly as it breaks production. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 314ca51fb5f36fd71a0722aab85365155bdddece)
Same shape as the width cases: the geometry was sampled once, so a React remount mid-layout produced transient boxes. Assertions are unchanged and still strict — a genuinely asymmetric header fails once the retry budget is spent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 996fccdc88b7482589a8df91307be97412f0c1f0)
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 6 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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughRetires ChangesTypography and UI stability
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 906c5a1cfc
ℹ️ 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".
Resolves the `docs/outstanding-issues.md` conflict. Two independent causes: 1. Rows #98–#105 diverged. `main` carries the newer text (PR #1377 landed "Done 2026-07-29" outcomes and rewrote several summaries); this branch carried the pre-#1377 wording. Took `main`'s rows wholesale — the branch made no edits to that range, it simply forked before them. 2. `#108`/`#109` were allocated twice. `main` used them for the verified-landed branch deletions and the shallow-clone finding; this branch had used the same two ids for the design-system token manifest and the `ui-overlap` flake. The `issues:next-id` marker has no concurrency protection, which is exactly the failure the branch's own PR notes predicted. Renumbered this branch's two rows to #110/#111 and bumped the marker to 112. No content was dropped from either side; all 111 rows are unique. Also records #111 as done, since this branch is what fixes it: the ui-overlap inset measurement now retries inside `toPass` with the 2px symmetry tolerance and the assertions unchanged. Leaving it open with a "Next: apply the retry shape" action would have re-queued work this PR already did.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvU8z73P6TXUXoYBqN5K1P
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: baecef05ca
ℹ️ 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".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvU8z73P6TXUXoYBqN5K1P
Three review findings, all correct. `openGuide` and the mode-menu retry both re-ran an action that had already succeeded. `toPass` schedules another attempt whenever the inner assertion's own deadline expires, which can happen a moment AFTER the click landed — so under the contention these retries exist to tolerate: - `openGuide` clicked a Settings trigger the modal was already covering, or reopened the phone menu on top of it, and timed out. - the mode-menu retry clicked a TOGGLE a second time, closing a menu that had just opened, and could oscillate until the budget ran out — failing a UI that was working. Both now return early when the thing they were about to produce already exists. The mobile branch needed a second guard: a swallowed Settings click leaves the phone menu OPEN, so `openMobileClinicalGuideMenu` on the retry would toggle it shut and then fail to find Settings inside it. It now reuses an open menu and only summons one when there is none. Without this the <768px branch could not recover on retry at all, which is the branch the PR claims to fix. Also moves #111 from Open items to Resolved / archive. The row recorded the ui-overlap fix as done and simultaneously sat in the queue describing the test as still flaking, so an operator reading the file as a work queue would have scheduled the investigation again. The repo's own conventions say a resolved item is archived, not left open with a done note. verify:cheap exit 0 — Test Files 429 passed (429), Tests 4404 passed | 4 skipped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvU8z73P6TXUXoYBqN5K1P
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #6582 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvU8z73P6TXUXoYBqN5K1P
Summary
Follow-ups to PR #1375 (Clinical Sky design system), which merged before these landed. One is a live defect on
main; the rest remove a class of test flake that predates the port.text-4xsis dead onmainand five classes still reference it. #1375 retired the--text-4xstoken, so Tailwind emits no such rule — every remainingtext-4xsclass is a no-op and that text silently falls back to inherited size. Two files carrying it landed frommainwhile #1375 was in flight (#1273 phone in-page navigation mockups, #1362 therapy navigation mockups) and were dead on arrival. Repointed totext-3xs, the 10px floor, and guarded: the design-token contract now fails if any tracked file undersrc/references the retired class outside a comment. Mockups are deliberately not exempt — a dead utility breaks a mockup exactly as it breaks production.Six hydration races fixed at the source. The Chromium suite failed a different random subset on each contended run — always the same shape: a control that never enables, a menu that never opens, geometry read mid-remount. In this app visible never implies interactive: the server-rendered tree paints before React owns it, so any single un-retried action asserted once is a coin flip under load. The repo already documented this on
fillVisibleQuestionInput("Filling during that gap is immediately overwritten by hydration and leaves the submit button disabled"); the flaky sites simply bypassed that helper.ui-smokeoffline gate.fill()before React owned the inputui-smokemode menu.click()before the handler attachedui-smokeopenGuide.click(), all 3 viewport branchesui-toolssubmitDifferentialSearchui-accessibilitydifferential filterui-overlap× 2Every fix retries the action together with the effect it should produce, so a swallowed first attempt retries while a genuine regression still fails. These are pre-existing defects, not consequences of the token port — #1375 only ran the suite hard enough to expose them. Left alone they keep costing CI reds on unrelated PRs.
Documentation.
docs/design-system.mdnow records that intermediate font weights (520/540/560/580/640/650/680) are deliberate on a variable face rather than drift — normalising Therapy Compass onto 600/700 was attempted during #1375 and reverted — plus the leading vocabulary and the trap that redefining Tailwind's--leading-tight/-snugsilently retunes every existing call site.RAG impact: no retrieval behaviour change — test robustness, two mockup class names, and docs only; nothing under
src/lib/rag/**, clinical-search, ranking-config, the eval harness or the golden fixture is touched.Verification
npm run verify:pr-local—Test Files 426 passed (426),Tests 4381 passed | 3 skippedui-overlapfull spec — 14 passed across 4 consecutive runs (previously failed at a different arbitrary width per contended run)check:installed-lock-paritycaught a stale worktree mid-review (next16.2.11 vs locked 16.2.12,react19.2.7 vs 19.2.8,playwright1.61.1 vs 1.62.0); results above are post-npm cion matching versionsRisk and rollout
Test-only plus two mockup class names and docs. The single production-visible change is five
text-4xs→text-3xsswaps in mockup components, which restores intended rendering rather than altering it. Revert is a clean single-commit revert.Clinical Governance Preflight
No ingestion, answer generation, search/ranking, document access, privacy or clinical output path is touched.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
#108(design-system project token manifest lags its stylesheet —resync.mjsships with the/design-syncskill and is not a published package, so the manifest cannot be regenerated without it) and#109(ui-overlapphone-inset flake, now fixed here).#096/#097then#098/#099were both claimed by other agents' work within the hour. Theissues:next-idmarker has no concurrency protection.🤖 Generated with Claude Code
Summary by CodeRabbit
UI Improvements
Bug Fixes
Documentation