Extract cn() into src/lib/cn.ts - #2430
Conversation
Keep the ui-primitives re-export so existing importers stay unchanged. Pin the new module location with a source contract on the cn() tests. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Warning Review limit reachedNext included review available in 17 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Comment |
This pull request has been ignored for the connected project Preview Branches by Supabase. |
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot 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_8737929c-b445-4389-a49b-4ec110ca44da) |
Re-applies PR #2430's intent onto main's current structure. #2430 was authored before main split ui-primitives.tsx into primitive-recipes/*, so its diff no longer applies: cn() now lives in primitive-recipes/recipes.ts, not ui-primitives.tsx. recipes.ts re-exports cn from the new module, so ui-primitives.tsx's `export *` and the existing `import { cn } from "./recipes"` callers in clinical.tsx and feedback.tsx are unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JiaghcKco9xE3vLS4PJHdd
# Conflicts: # src/components/ui-primitives.tsx
Bugbot couldn't run - usage limit reachedBugbot 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_487003e7-7ed3-445a-ba76-df2fcfdb7687) |
Pull request was closed
Summary
cn()fromsrc/components/ui-primitives.tsxtosrc/lib/cn.tsso the className helper is a lib module rather than a UI-primitives export.cnfromui-primitivesso existing importers do not have to move.src/lib/cn.ts, and primitives re-export the same function from@/lib/cn.Verification
npm run verify:pr-localArbiter:
RUN "verify:pr-local" — CI does not re-run verify:pr-local for this change — local is the only gate.Decisive lines:
Test Files 3 passed (3)/Tests 135 passed (135)fortests/ui-primitives.dom.test.tsx(12),tests/ui-v2-components.dom.test.tsx(89), andtests/tailwind-merge-config.test.ts(34, including the newcn module locationpin).verify:pr-local:Test Files 894 passed (894)/Tests 10830 passed | 1 skipped (10831).All matched files use Prettier code style![gate-receipts] recorded a pass for "lint:internal"[gate-receipts] recorded a pass for "typecheck:internal"✓ Compiled successfully in 45sOffline RAG fixture and manifest validation passed (36 golden cases, 26 suites).PR-local verification summary:completedcheck:runtime, check:installed-lock-parity, format:changed, lint, typecheck, test, check:repo-awareness-snapshot, build, check:rag:fixtures, check:medication-interactions, check:medication-lexicon-report; failed(none).During development, use
npm run verify:cheapas the faster iteration gate before the final PR-local preflight.verify:releaseis out of scope for this PR.For retrieval, ranking, selection, chunking, source/citation rendering, or answer-contract changes,
verify:pr-localrunseval:rag:offlineautomatically. Run the offline command directly during iteration before spending a live eval.Risk and rollout
cn()behavior is unchanged;ui-primitivesstill exports the same function. Existingcn()contract tests continue to import from@/components/ui-primitives.@/components/ui-primitives.Clinical Governance Preflight
Not required: this change does not touch ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.
Notes
PR 3d only — extract
cn. No other primitives split.