Extract ActivityCard model colors to lib/constants/model-colors.ts#143
Extract ActivityCard model colors to lib/constants/model-colors.ts#143ohong wants to merge 1 commit into
Conversation
Pure refactor per the ROADMAP "Model colors outside design system" item — same colors, same match order, no behavior change.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughModel chip color logic previously hardcoded in ActivityCard's modelColor function has been extracted into a new constants module (model-colors.ts) exporting MODEL_COLOR_PATTERNS and MODEL_COLOR_FALLBACK_PALETTE. ActivityCard now imports and uses these constants. CHANGELOG and ROADMAP docs updated accordingly. ChangesModel Color Extraction
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Roadmap item ("UX Polish" → "Model colors outside design system"):
ActivityCard.tsxused hardcoded hex colors inline for model chips. Extracted them toapps/web/lib/constants/model-colors.tsasMODEL_COLOR_PATTERNS(ordered pattern→color list) andMODEL_COLOR_FALLBACK_PALETTE(hash-based fallback palette), matching the existinglib/constants/regions.tsconvention.Pure refactor — same colors, same match order, no behavior change.
Changes
apps/web/lib/constants/model-colors.ts— new file with the extracted constants.apps/web/components/app/feed/ActivityCard.tsx—modelColor()now iteratesMODEL_COLOR_PATTERNSand falls back toMODEL_COLOR_FALLBACK_PALETTE.docs/CHANGELOG.md— entry under Unreleased/Changed.docs/ROADMAP.md— removed the now-completed item.Test plan
bun run lint— cleanbun run typecheck— cleanbun run test— 646/646 web tests pass, 199/199 CLI tests pass (unaffected)Generated by Claude Code
Summary by CodeRabbit