refactor(dashboard) Switch component: drop overrides and cleanup#6131
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe ChangesSwitch Component Size Prop Refactoring
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
e22e7bb to
4ca5cf5
Compare
d56a705 to
c9573f6
Compare
Five callsites were hand-rolling track colors, rings, and sizes — inconsistent and at odds with the rest of the design system, where ring is reserved for focus indicators. Move size variation onto a 'sm' prop on the base Switch and delete every per-callsite override. - drop thumbClassName (no callers, didn't match shadcn pattern) - add size: 'default' | 'sm' driven by data-size attr - collapse env-vars/sensitive, env-vars/secret, sentinel-policies/row, auto-deploy, and metadata/protection-switch to bare props
c9573f6 to
27a33ac
Compare
Summary
size: 'default' | 'sm'prop on the base for the smaller variant a couple of callsites needed,<Switch checked onCheckedChange />(withsize="sm"where applicable). .Test plan
If you're reviewing this PR, please test each switch manually and confirm each switch appears correctly, and check light and dark modes too just to be safe.
/<workspaceSlug>/projects/<projectId>/settings→ Auto deploy card/<workspaceSlug>/projects/<projectId>/sentinel-policies→ per-env toggles on each policy row/<workspaceSlug>/projects/<projectId>/env-vars→ Add panel → Sensitive toggle/<workspaceSlug>/projects/<projectId>/env-vars→ click an existing row → Sensitive toggle/<workspaceSlug>/apis/<apiId>→ Create key → Expiration / Credits / Rate limit toggles