fix(search): salvage Also-matches phone spacing without reverting #1616 - #1629
Conversation
Re-applies PR #1604's intended change on top of current main. That PR's merge commit c593e62 resolved tests/ui-smoke.spec.ts entirely to the branch side, discarding every change #1616 had already landed on main -- CI confirmed it, failing on a re-hardcoded 14px action font size against the current --text-sm of 0.8125rem. Only the three files carrying real work are carried over: - universal-search-also-matches.tsx: raised card, min-h-tap toggle with Layers icon, count badge and subtitle, subtitle excluded from the accessible name, phone bottom clearance. - globals.css and tests/helpers/style-contracts.ts: supporting tokens and contract entries. tests/ui-smoke.spec.ts gets only the one edit #1604 actually intended -- including vertical margins in the alsoMatchesHeight measurement, so the phone bottom margin does not eat the phantom-scroll budget. It is applied to main's current version of that test, so the +61/-152 revert is gone and the file stays at +13/-2. Also fixes a defect the original carried: the desktop "Across Clinical KB" label used --text-soft, a deprecated alias of --decoration-soft that the design system pins below 4.5:1 and bans on text nodes. It now uses --text-muted, matching the sibling subtitle. This is what made #1604 red on check:design-system-contract.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe responsive “Also matches” panel now shows match counts, mobile subtitles, disclosure controls, raised-card styling, and updated related-mode cards. CSS separates the patient strip from the panel. Style contracts and mobile geometry tests reflect the new layout. ChangesResponsive Also Matches panel
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Summary
Replaces #1604, which is being closed. That PR's merge commit
c593e624resolvedtests/ui-smoke.spec.tsentirely to the branch side, discarding every change #1616 had already landed onmain. CI confirmed it rather than merely predicting it —Production UI criticalfailed on a re-hardcoded14pxaction font size against the current--text-smof0.8125rem(13px).This branch re-applies only the work that was actually intended, on top of current
main:universal-search-also-matches.tsx— collapsed "Also matches in other modes" disclosure becomes a raised card; phone toggle gets a fullmin-h-tap(48px) hit target, leading Layers icon, count badge and short subtitle; subtitle and indeterminate…badge excluded from the accessible name; phone bottom clearance viamax-sm:mb-4as content spacing (not a chrome/dock reserve restore).globals.cssandtests/helpers/style-contracts.ts— supporting tokens and contract entries.tests/ui-smoke.spec.ts— only the one edit Improve “Also matches in other modes” phone spacing and tap target #1604 intended: include vertical margins in thealsoMatchesHeightmeasurement so the phone bottom margin does not eat the phantom-scroll budget. Applied tomain's current version of the test, so the file is +13/−2 rather than Improve “Also matches in other modes” phone spacing and tap target #1604's +61/−152.Additionally fixes a defect #1604 carried, which is what made it red on
check:design-system-contract: the desktop "Across Clinical KB" label used--text-soft, a deprecated alias of--decoration-softthat the design system pins below 4.5:1 and explicitly bans on text nodes (docs/design-system/GATES.md§1,TOKENS.md). It now uses--text-muted, matching the sibling subtitle. That is an accessibility fix, not a gate workaround.Verification
npm run test— 504 files passed, 5327 passed / 4 skipped, 0 failed. The full suite rather than a focused run becausetest:focusedfails closed on changed test infrastructure (tests/helpers/style-contracts.ts) and instructs exactly this.npm run check:design-system-contract— passes;Text-role ratchet: --text-soft consumers 0(was 1 on Improve “Also matches in other modes” phone spacing and tap target #1604), plusdesign-system adoption checked: 53 components, 55 rootsanddesign-sync contract checked: 53 components and 7 guidelines.npx eslint src/components/clinical-dashboard/universal-search-also-matches.tsx --max-warnings 0— exit 0.npm run formatrun and committed;npx prettier --check .repo-wide —All matched files use Prettier code style!git diff --stat origin/main -- tests/ui-smoke.spec.tsis+13/-2, confirming none of ui: complete and activate the v2 design system #1616's content is removed.npm run verify:ui— not run locally. The changed Chromium assertion is inui-smoke.spec.ts; CI'sProduction UI criticalon this head is the authoritative run, and it is the exact job that caught Improve “Also matches in other modes” phone spacing and tap target #1604. Treat this as unproven until that job reports green.Risk and rollout
sm+) behaviour unchanged. The--text-soft→--text-mutedswap raises contrast, so it cannot regress legibility.Clinical Governance Preflight
Not clinical-risk scope: phone spacing and tap-target chrome on an existing search disclosure. No ingestion, answer generation, retrieval/ranking, source rendering, document access, privacy, or production env changes.
RAG impact: no retrieval behaviour change — presentation-only changes to a cross-mode disclosure component; no file under any retrieval, ranking, selection, or answer-ranking surface is touched.
Generated by Claude Code
Summary by CodeRabbit
New Features
UI Improvements
Bug Fixes