Skip to content

Extract cn() into src/lib/cn.ts - #2430

Closed
BigSimmo wants to merge 2 commits into
mainfrom
cursor/extract-cn-ac98
Closed

Extract cn() into src/lib/cn.ts#2430
BigSimmo wants to merge 2 commits into
mainfrom
cursor/extract-cn-ac98

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move cn() from src/components/ui-primitives.tsx to src/lib/cn.ts so the className helper is a lib module rather than a UI-primitives export.
  • Re-export cn from ui-primitives so existing importers do not have to move.
  • Pin the new location with a source contract: the implementation lives in src/lib/cn.ts, and primitives re-export the same function from @/lib/cn.
  • No Button/Sheet migration.

Verification

  • npm run verify:pr-local

Arbiter: 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) for tests/ui-primitives.dom.test.tsx (12), tests/ui-v2-components.dom.test.tsx (89), and tests/tailwind-merge-config.test.ts (34, including the new cn module location pin).
  • Full suite inside 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 45s
  • Offline RAG fixture and manifest validation passed (36 golden cases, 26 suites).
  • PR-local verification summary: completed check: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:cheap as the faster iteration gate before the final PR-local preflight.

  • UI verification not run: module-location change only; no visual, routing, or interaction behavior change.
  • Release verification not run: verify:release is out of scope for this PR.

For retrieval, ranking, selection, chunking, source/citation rendering, or answer-contract changes, verify:pr-local runs eval:rag:offline automatically. Run the offline command directly during iteration before spending a live eval.

  • Retrieval/ranking eval not run: this change does not touch retrieval, ranking, selection, chunking, or scoring.
  • Answer-generation eval not run: this change does not touch answer generation, the synthesis prompt, or answer post-processing.
  • Production-readiness not run: this change does not touch clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior.
  • Deployment-readiness not run: this change does not touch deployment startup, hosting, or rollout behavior.

Risk and rollout

  • Risk: Low. cn() behavior is unchanged; ui-primitives still exports the same function. Existing cn() contract tests continue to import from @/components/ui-primitives.
  • Rollback: Revert this commit. Importers keep using @/components/ui-primitives.
  • Provider or production effects: None
  • RAG impact: none

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.

Open in WebOpen in Cursor

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>
@coderabbitai

coderabbitaiBot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 17 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: 0dacabc4-f901-49ac-b897-04cc261010c2

📥 Commits

Reviewing files that changed from the base of the PR and between 902ccee and 3518065.

📒 Files selected for processing (3)
  • src/components/primitive-recipes/recipes.ts
  • src/lib/cn.ts
  • tests/tailwind-merge-config.test.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 ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review August 27, 2026 12:03
@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.

@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_8737929c-b445-4389-a49b-4ec110ca44da)

BigSimmo pushed a commit that referenced this pull request Aug 27, 2026
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
@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_487003e7-7ed3-445a-ba76-df2fcfdb7687)

@BigSimmo
BigSimmo enabled auto-merge (squash) August 27, 2026 16:06
auto-merge was automatically disabled August 27, 2026 16:09

Pull request was closed

BigSimmo added a commit that referenced this pull request Aug 27, 2026
Bundle: Geist fonts, cn() extraction, and design-system doc/token pins (#2432 + #2430 + #2440 + #2431 + #2438)
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.

3 participants

@BigSimmo@cursoragent@claude