Skip to content

cleanup(ui): centralize duplicate badge colors and align Helm wizard with brand#594

Merged
nadaverell merged 3 commits intomainfrom
cleanup/design-system-adherence
Apr 30, 2026
Merged

cleanup(ui): centralize duplicate badge colors and align Helm wizard with brand#594
nadaverell merged 3 commits intomainfrom
cleanup/design-system-adherence

Conversation

@nadaverell
Copy link
Copy Markdown
Contributor

@nadaverell nadaverell commented Apr 30, 2026

Summary

Three buckets of design-system cleanup driven by an audit against DESIGN.md. All token / centralization changes; no behavior changes.

Mechanical centralization (no visual change).

  • CAPACITY_TYPE_BADGE moved from resource-utils-karpenter.ts into badge-colors.ts alongside the other shared palettes (EVENT_TYPE_COLORS, BP_CATEGORY_BADGE, VULN_SEVERITY_BADGE, …). Added NODEPOOL_MODE_BADGE for the AKS System/User pattern that was hand-rolled in two places. Five inline-duplicated badge strings across AzureManagedMachinePoolRenderer, AWSManagedMachinePoolRenderer, azure-capi-cells, aws-capi-cells, karpenter-cells, and KarpenterNodeClaimRenderer now reference the shared constants.
  • Replaced template-literal Tailwind class construction (`bg-amber-500${opacity}`) in TimelineSwimlanes and timeline/shared with explicit static strings so the Tailwind scanner can see them. Same runtime output.

Helm wizard brand alignment (visual fix). InstallWizard.tsx and ChartBrowser.tsx were the largest concentration of raw bg-blue-* / text-blue-* violations — generic Tailwind #3B82F6, noticeably different from the app's brand accent (#4A7CC9 light / #6A9FE0 dark, used in 28 other files via .btn-brand / bg-accent / text-accent-text). Converted active step pills, hyperlinks, focus rings, checkbox accents, decorative icons, and the standalone "Ready to install" info banners to the accent tokens. Replaced bg-white/10 chart-logo backdrops with bg-theme-elevated (works in both modes; the original was effectively invisible in light mode).

Deliberately preserved deviations. Three blue usages in InstallWizard.tsx are intentionally kept raw: the values diff hunk header (paired with bg-green-500/10 add and bg-red-500/10 remove rows) and the install progress panel + spinner (paired with bg-green-500/10 complete and bg-red-500/10 error). In each case blue is part of a categorical/status triple — converting just the blue would break the semantic set.

Test plan

  • make tsc (passes locally)
  • Open the Helm install wizard — active step, focus rings, checkboxes, info banners, links should now match the rest of the app's brand blue
  • Verify Helm install in-progress panel still shows blue (paired with green/red on complete/error)
  • Open a Karpenter NodeClaim, AKS Managed Machine Pool, EKS Managed Machine Pool — capacity-type and mode badges render unchanged
  • Open the timeline — event marker dots render unchanged for both live (solid) and historical (dimmed) states

Note

Low Risk
Primarily mechanical styling/token refactors with limited surface area outside UI appearance; main risk is minor visual regressions from class name changes.

Overview
Centralizes badge styling by adding shared constants in badge-colors.ts (CAPACITY_TYPE_BADGE, NODEPOOL_MODE_BADGE, BADGE_INACTIVE) and updating many K8s resource renderers/table cells to consume them instead of inlined Tailwind class strings.

Makes timeline marker coloring Tailwind-safe by replacing template-literal class construction with explicit bg-*/50 class strings in timeline components.

Aligns Helm Chart Browser/Install Wizard with the app accent theme by swapping blue-* focus/selection/link/icon styles (and logo backdrops) to accent tokens for consistent branding.

Reviewed by Cursor Bugbot for commit 2eca377. Bugbot is set up for automated code reviews on this repo. Configure here.

…with brand

Three buckets of design-system cleanup, all per DESIGN.md.

Mechanical centralization (no visual change):
- Move CAPACITY_TYPE_BADGE from resource-utils-karpenter.ts into badge-colors.ts
  alongside the other shared badge palettes; add NODEPOOL_MODE_BADGE for the
  AKS System/User pattern. Convert hand-rolled duplicate strings in
  AzureManagedMachinePoolRenderer, AWSManagedMachinePoolRenderer,
  azure-capi-cells, aws-capi-cells, karpenter-cells, and
  KarpenterNodeClaimRenderer to reference the shared constants.
- Replace template-literal Tailwind class construction
  (\`bg-amber-500\${opacity}\`) in TimelineSwimlanes and timeline/shared with
  explicit static strings so the scanner can see them.

Helm wizard brand alignment (visual fix):
- InstallWizard and ChartBrowser used raw \`bg-blue-*\`/\`text-blue-*\` (#3B82F6),
  noticeably different from the rest of the app's brand accent
  (#4A7CC9 light / #6A9FE0 dark). Convert active step pills, hyperlinks,
  focus rings, checkbox accents, decorative icons, and the standalone
  "Ready to install" info banners to bg-accent / text-accent / accent-muted /
  text-accent-text. Replace bg-white/10 chart-logo backdrops with
  bg-theme-elevated.
- Three blue uses are deliberately kept: the values diff hunk header (paired
  with bg-green-500/10 add and bg-red-500/10 remove rows) and the install
  progress panel + spinner (paired with bg-green-500/10 success and
  bg-red-500/10 error). In both cases blue is part of a categorical/status
  triple, not brand.
@nadaverell nadaverell requested a review from hisco as a code owner April 30, 2026 10:17
Two more passes of the design-system cleanup, same shape as the prior commit.

Centralize the "inactive / unknown / pending" badge:
- The string \`bg-gray-500/20 text-gray-400\` was duplicated 23 times across 16
  renderer files as the de-facto fallback for unknown status, unset modes,
  pending steps, missing severity, etc.
- Add \`BADGE_INACTIVE\` to badge-colors.ts and reference it from all 16 files
  (Gateway, GatewayClass, Order, Challenge, RoleBinding, IngressClass,
  Rollout, ArgoApplication, ClusterComplianceReport, ConfigAuditReport,
  ExposedSecretReport, IstioGateway, IstioPeerAuthentication,
  IstioAuthorizationPolicy, KarpenterNodeClaim, istio-cells).

Timeline brand alignment:
- TimelineSwimlanes had the same brand outliers as the Helm wizard:
  search-input focus ring, "Group by app" checkbox, "→ Now" jump-to-current
  button, hover-on-resource-name links (4 sites), workload-pill highlight,
  and the workload-children left border. Convert to bg-accent / text-accent /
  text-accent-text / focus:ring-accent / border-accent.
- Three blue uses are deliberately preserved: the legend item for "modified"
  and the rolling-health legend item (paired with green/red/amber as a
  4-color categorical legend) and the live event marker (paired with green
  add / red delete inside the change-event triple). Same justification as
  the kept blues in InstallWizard.
Convert the update notification's outer chrome (border, icon backdrop, idle
and downloading/applying icons, progress bar fill, GitHub release link) from
raw bg-blue-* / text-blue-* to bg-accent / text-accent / accent-muted /
accent-text / border-accent. Green stays for the 'Ready' state icon and the
'Restart Now' button (semantic success), red stays for error text.

Unlike the InstallWizard install panel, the blue here is the notification's
overall identity color, not part of a green/red status triple — so the brand
swap is unambiguous.
@nadaverell nadaverell merged commit e8d1ba3 into main Apr 30, 2026
8 checks passed
@nadaverell nadaverell deleted the cleanup/design-system-adherence branch April 30, 2026 11:12
Sign up for free to 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.

1 participant