Skip to content

Pay down group-2 visual debt without raising design-system ratchets - #2421

Merged
BigSimmo merged 7 commits into
mainfrom
cursor/ds-group2-visual-debt
Aug 27, 2026
Merged

Pay down group-2 visual debt without raising design-system ratchets#2421
BigSimmo merged 7 commits into
mainfrom
cursor/ds-group2-visual-debt

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Split the mixed ui-primitives barrel into primitive-recipes modules so product surfaces share named recipes instead of a 700-line grab-bag, without changing registered design-sync exports (still 55, not 57).
  • Land AppliedFilters and CopyButton as built, proof-migrated, DOM-tested components that remain unregistered; COMPONENTS.md no longer lists them as specified-not-built.
  • Pay down legacy shadow-alias use onto --e2 and ratchet legacyShadowAliases 87 → 34 with matching GATES prose. CSS aliases --shadow-card / --shadow-soft / --shadow-lift are kept.

Verification

  • npm run format — Prettier rewrote docs/design-system/FIX-GUIDE.md and GATES.md (CRLF cleanup); verify:pr-local then reported All matched files use Prettier code style!
  • npm run check:design-system-contractDesign-system contract passed (1030 production files; … legacy shadow aliases 34; …) then design-system adoption checked: 55 components, 76 roots and design-sync contract checked: 55 components and 7 guidelines
  • npm run verify:pr-local — ran; lint and typecheck completed. Unit suite ended Test Files 3 failed | 888 passed | 3 skipped (894) / Tests 8 failed | 10754 passed | 75 skipped (10837) on unrelated files (claude-cloud-profile.test.ts exit 127, dead-code-candidate.test.ts timeout, document-viewer-page-virtualization.dom.test.tsx flake). Build and offline RAG evals were not reached.
  • npm run verify:ui when UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changed

UI verification not run: handoff explicitly skipped verify:ui / verify:release / live evals. Styling is token/recipe swaps and contract ratchets; Chromium journeys are left to CI Production UI.

  • npm run verify:release before release or handoff confidence claims
  • npm run eval:retrieval:quality (must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed — CI cannot run it (needs live keys), so run it locally and paste the summary. A metadata/governance-weighting change once buried correct docs (recall 1.0→0.76) and only this eval caught it.

Verification not run: no retrieval, ranking, selection, chunking, or scoring behaviour change.

  • npm run eval:rag -- --limit 15 + npm run eval:quality -- --rag-only when answer generation, the synthesis prompt, or answer post-processing changed (grounded-supported must not drop; citation-failure 0)

Verification not run: answer generation, synthesis prompt, and post-processing are unchanged.

  • npm run check:production-readiness when clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changed
  • npm run check:deployment-readiness when deployment startup, hosting, or rollout behavior changed

Verification not run: no production-env, Supabase, or deployment-startup change.

Risk and rollout

  • Risk: visual class/token swaps and a primitives barrel split could miss a surface still importing a moved recipe, or a contract baseline that does not match measured debt. Mitigated by walking production sources in check:design-system-contract (passed at 34 aliases / 55 registered components) and keeping CSS --shadow-card / --shadow-soft / --shadow-lift aliases in place.
  • Rollback: revert this commit; design-sync registration count is unchanged so there is no 55→57 remote publication to unwind.
  • Provider or production effects: None
  • RAG impact: no retrieval behaviour change — UI, design-system docs, primitive recipes, and contract baselines only; no src/lib/rag/, retrieval RPCs, golden fixtures, or ranking tests.

Clinical Governance Preflight

Path classifier treats data/repo-awareness-snapshot.json and auth-panel.tsx as clinical-risk even though this diff only catalogues FIX-GUIDE and replaces --shadow-soft with --e2 on the auth form shell. Preflight completed against that classification:

  • 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

No clinical decision-support behaviour changed; TGA/SaMD classification is unchanged.

Notes

  • AppliedFilters and CopyButton stay off the design-sync registry on purpose (Chip/Button add path is a 55-row cascade).
  • Do not delete --shadow-card / --shadow-soft CSS aliases, --shadow-lift, type-scale steps, or split master-search-header.
  • Stash stash@{0} (ds-group2-wip-before-ff) is leftover local WIP from the stalled handoff and can be dropped after this PR is confirmed.

Note

Medium Risk
Touches many surfaces via shadow token swaps and changes design-system contract/adoption tooling; risk is mostly visual/regression in styling and CI gates, not clinical or auth logic.

Overview
Refactors the ui-primitives barrel into primitive-recipes/ modules while keeping the same public exports; design-sync and adoption scripts now follow export * from hops so AsyncButton and recipe scans still resolve from ui-primitives.tsx.

Adds AppliedFilters and CopyButton as built, proof-migrated UI pieces (catalogue toolbar chips, answer copy control); answer-status re-exports CopyButton from copy-button.tsx instead of a local hand-rolled control. They stay off the 55-row design-sync registry; docs and adoption manifest reflect import counts and tests without counting them as specified-not-built.

Pays down --shadow-soft / --shadow-card usage onto --e2 across production and mockups (including chat composer shell in globals.css), ratcheting legacyShadowAliases87 → 34 while keeping the legacy CSS alias tokens in place.

Introduces sameFileTextSmMinusMix (warn + per-path ratchet, baseline 26) in check:design-system-contract, with matching guidance in GATES, TOKENS, and FIX-GUIDE (catalogued in docs index and repo snapshot). Updates adoption manifest test wiring, AnswerCard baseline harness note, and GATES prose (HCM/z-index suites already implemented; shadow-alias debt figures aligned).

Reviewed by Cursor Bugbot for commit 4b6e8a0. Configure here.

Split ui-primitives into primitive recipes, land built-but-unregistered AppliedFilters/CopyButton, and align GATES prose to the measured 34 shadow-alias baseline.
Co-authored-by: Cursor <cursoragent@cursor.com>
@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, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitaiBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 25 minutes.

View limit details

Limit details: You’ve used the included review currently available. Your 102 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 755e7666-db88-4da6-a20a-d68f309cb104

📥 Commits

Reviewing files that changed from the base of the PR and between 28b1fef and ce13cdb.

⛔ Files ignored due to path filters (6)
  • docs/README.md is excluded by !docs/**, !**/*.md
  • docs/design-system/COMPONENTS.md is excluded by !docs/**, !**/*.md
  • docs/design-system/FIX-GUIDE.md is excluded by !docs/**, !**/*.md
  • docs/design-system/GATES.md is excluded by !docs/**, !**/*.md
  • docs/design-system/TOKENS.md is excluded by !docs/**, !**/*.md
  • docs/design-system/adoption-manifest.json is excluded by !docs/**
📒 Files selected for processing (100)
  • data/repo-awareness-snapshot.json
  • scripts/check-design-sync-contract.mjs
  • scripts/check-design-system-contract.mjs
  • scripts/design-system-contract-baseline.json
  • scripts/design-system-contract-utils.mjs
  • scripts/generate-design-sync-contract.mjs
  • scripts/generate-design-system-adoption.mjs
  • src/app/globals.css
  • src/app/mockups/answer-evidence-popups/page.tsx
  • src/app/mockups/mode-dropdown/page.tsx
  • src/app/mockups/recent-searches-bottom/page.tsx
  • src/components/answer-chat-perfected-mockups.tsx
  • src/components/answer-chat-perfected-v2-mockups.tsx
  • src/components/answer-chat-redesign-mockups.tsx
  • src/components/applications-launcher-page.tsx
  • src/components/calculator-mockups/bedside-sheet-mockup.tsx
  • src/components/calculator-mockups/clinical-console-mockup.tsx
  • src/components/calculator-mockups/directory-grid-mockup.tsx
  • src/components/calculator-mockups/guided-flow-mockup.tsx
  • src/components/calculator-mockups/search-detail-mockup.tsx
  • src/components/calculator-mockups/search-page-mockup.tsx
  • src/components/calculator-mockups/show-all-directions-mockup.tsx
  • src/components/calculators/bedside-sheet.tsx
  • src/components/calculators/clinical-console.tsx
  • src/components/calculators/guided-flow.tsx
  • src/components/calculators/search-detail.tsx
  • src/components/calculators/search-page.tsx
  • src/components/clinical-dashboard/ClinicalSidebar.tsx
  • src/components/clinical-dashboard/answer-status.tsx
  • src/components/clinical-dashboard/auth-panel.tsx
  • src/components/clinical-dashboard/differentials-home.tsx
  • src/components/clinical-dashboard/document-search-results.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/clinical-dashboard/library-health-strip.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/clinical-dashboard/medication-prescribing-workspace.tsx
  • src/components/clinical-dashboard/medication-record-page.tsx
  • src/components/clinical-dashboard/settings-dialog.tsx
  • src/components/differentials/diagnosis-map-panel.tsx
  • src/components/differentials/differential-detail-page.tsx
  • src/components/differentials/differential-presentation-actions.tsx
  • src/components/differentials/differential-presentation-workflow-page.tsx
  • src/components/document-navigation-contract-mockups.tsx
  • src/components/document-navigation-final-mockups.tsx
  • src/components/document-navigation-final-review-mockups.tsx
  • src/components/document-navigation-pane-mockups.tsx
  • src/components/document-navigation-perfected-mockups.tsx
  • src/components/document-phone-fused-directions-mockups.tsx
  • src/components/document-phone-title-mockups.tsx
  • src/components/document-phone-title-refined-mockups.tsx
  • src/components/document-phone-zero-chrome-mockups.tsx
  • src/components/document-search-mockups.tsx
  • src/components/document-top-navigation-mockups.tsx
  • src/components/dsm/dsm-comparison-page.tsx
  • src/components/dsm/dsm-diagnosis-page.tsx
  • src/components/dsm/dsm-differential-considerations-page.tsx
  • src/components/factsheets/factsheets-compact-view-mockups.tsx
  • src/components/factsheets/factsheets-search-page.tsx
  • src/components/filter-sheet-restyle-mockups.tsx
  • src/components/formulation/formulation-builder-page.tsx
  • src/components/formulation/formulation-home-page.tsx
  • src/components/formulation/formulation-map-page.tsx
  • src/components/master-document-flow-mockups.tsx
  • src/components/mode-home-template.tsx
  • src/components/phone-mode-sheet-yes-mockups.tsx
  • src/components/primitive-recipes/clinical.tsx
  • src/components/primitive-recipes/composer.ts
  • src/components/primitive-recipes/feedback.tsx
  • src/components/primitive-recipes/recipes.ts
  • src/components/registry-record-loader.tsx
  • src/components/services-filter-options-mockups.tsx
  • src/components/sidebar-live-mockup.tsx
  • src/components/specifiers/specifier-map-page.tsx
  • src/components/specifiers/specifier-ui.tsx
  • src/components/specifiers/specifiers-home-page.tsx
  • src/components/therapy-compass/screens/compare-screen.tsx
  • src/components/therapy-navigation-mockups/shared.tsx
  • src/components/tools-page-mockups/rectangle-direction-mockups.tsx
  • src/components/tools-page-mockups/split-pane-refined-mockups.tsx
  • src/components/tools-page-mockups/tools-page-mockup-page.tsx
  • src/components/tools-search-directions-mockups.tsx
  • src/components/ui-primitives.tsx
  • src/components/ui/answer-card.tsx
  • src/components/ui/applied-filters.tsx
  • src/components/ui/catalogue-toolbar.tsx
  • src/components/ui/copy-button.tsx
  • tests/applied-filters.dom.test.tsx
  • tests/clinical-dashboard-merge-artifacts.test.ts
  • tests/copy-button.dom.test.tsx
  • tests/dashboard-degraded-notice.dom.test.tsx
  • tests/decoration-on-text.contract.test.ts
  • tests/design-sync-contract.test.ts
  • tests/design-system-adoption.test.ts
  • tests/design-system-contract-utils.test.ts
  • tests/disabled-encoding.contract.test.ts
  • tests/search-shell-focus.contract.test.ts
  • tests/status-semantics-contract.test.ts
  • tests/ui-overlay-css-contract.test.ts
  • tests/ui-style-contract.spec.ts
  • tests/ui-visual-baseline.spec.ts

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

@supabase

supabaseBot commented Aug 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 ↗︎.

@cursor

cursorBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_00404ec9-90fe-438e-945c-688d9d9c781b)

BigSimmoand others added 2 commits August 27, 2026 18:39
Apply #2419's sm:grow page-shell change on the moved searchPageShell recipes so the PR is no longer CONFLICTING.
Co-authored-by: Cursor <cursoragent@cursor.com>
…al-debt
# Conflicts:
#	data/repo-awareness-snapshot.json
@cursor

cursorBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5393113c-981d-4081-94d7-d6f804db2819)

…al-debt
# Conflicts:
#	data/repo-awareness-snapshot.json
Merging origin/main brought in a refactor that split
pathways-screen.tsx into a new pathway-picker-sheet.tsx, moving one
file's pre-existing text-sm/text-sm-minus density-mix debt with it.
Regenerate the per-path baseline from source so the ratchet tracks the
renamed file; the aggregate count is unchanged (26) and several other
tracked metrics improved (raw padding/gap/margin literals all down).
@BigSimmo
BigSimmo enabled auto-merge (squash) August 27, 2026 12:31
@BigSimmoClaude

Copy link
Copy Markdown
OwnerAuthor

CI status: Advisory UI is red, but it's not this PR's and doesn't block merge.

Both CI runs on this branch (4b6e8a0 and 0e242d1) failed the same way in tests/ui-ward-roles.spec.ts: a Playwright strict-mode violation (getByTestId('ward-unit-screen') resolving to 2 elements) in an unrelated ward-flow mockup screen. This file has no changes in this PR or in the two merge commits I pushed to resolve conflicts — its last change was in an unrelated PR (#2392). This job is continue-on-error: true and deliberately excluded from pr-required (see ci.yml around the ui-advisory job), so it does not gate merging.

No fix ported here since it's out of scope for a design-system visual-debt PR; leaving it for a separate fix to the ward-flow mockup test/component.


Generated by Claude Code

@BigSimmo
BigSimmo merged commit 49653bb into mainAug 27, 2026
29 checks passed
@BigSimmo
BigSimmo deleted the cursor/ds-group2-visual-debt branch August 27, 2026 12:56
BigSimmo pushed a commit that referenced this pull request Aug 27, 2026
Two failures the merge surfaced, both from this branch replaying work that
main has since taken in a different shape:
- factsheet-detail-page: drop `aria-hidden="true"` from the print portal.
It came from this branch's local replay of PR #2426, but the version
that merged to main deliberately does not carry it — hiding the portal
removes the printed document's `<h1>` and its fact-table row headers
from the accessibility tree, which is what
`tests/factsheet-detail-header.dom.test.tsx` exists to prevent.
- design-system-contract-utils: ratchet the globals.css raw CSS z-index
pin from 8 (set by #2421) to 4. The motion/z tokenisation in this branch
legitimately paid that debt down; the pin is a floor to lower, not raise.
Evidence: 898 test files / 10862 tests passed; lint, typecheck and
check:design-system-contract clean.
Sign up for freeto 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.

2 participants

@BigSimmo@claude