Skip to content

fix(desktop): use Tailwind 500 colors for dev dock icon border#1520

Merged
saddlepaddle merged 1 commit into
mainfrom
consistent-color
Feb 16, 2026
Merged

fix(desktop): use Tailwind 500 colors for dev dock icon border#1520
saddlepaddle merged 1 commit into
mainfrom
consistent-color

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 16, 2026

Summary

  • Replace custom HSL color generation with Tailwind CSS 500-level palette for the dev workspace dock icon border
  • Deterministically pick from all 22 Tailwind 500 colors (hash(workspaceName) % colors.length) instead of generating arbitrary HSL hues
  • Add OKLCH→sRGB conversion since Tailwind v4 exports OKLCH color strings and we need RGB for bitmap drawing

Test plan

  • bun run lint:fix — clean
  • bun run typecheck — passes (18/18)
  • bun test — 1218 pass, 0 fail
  • Visually verify dock icon border colors across different workspace names in dev mode

Summary by CodeRabbit

  • Styling
    • Updated dock icon coloring system to use a standardized color palette, improving consistency across workspace identification. Icons now derive colors from workspace names with a refined visual appearance.

Instead of generating arbitrary HSL colors, pick from the full set of
Tailwind CSS 500-level colors deterministically based on workspace name.
This gives more recognizable, consistent colors across worktrees.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The dock icon color generation logic is refactored to select from a predefined Tailwind 500 color palette using a deterministic integer hash instead of computing HSL values. OKLCH color space parsing and conversion to sRGB replaces the previous HSL-to-RGB pipeline, with new utility functions supporting hash generation and color space transformations.

Changes

Cohort / File(s) Summary
Dock Icon Color Generation
apps/desktop/src/main/lib/dock-icon.ts
Replaces HSL-based color generation with Tailwind 500 color palette selection via integer hashing. Adds OKLCH-to-sRGB color space conversion utilities and a preprocessed constant array of Tailwind 500 colors. Implements new helper functions: hashString, parseOklch, and oklchToRgb. Updates logging to report RGB values instead of hue.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through color space so grand,
From hue to Tailwind, hand in paw hand,
OKLCH whispers secrets to RGB's ears,
Hash and palette, no more sundry fears,
Dock icons bloom in Tailwind's vibrant cheer! 🎨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: replacing custom color generation with Tailwind 500 colors for the dock icon border.
Description check ✅ Passed The PR description is well-structured with a clear summary, test plan, and technical details, though it lacks some template sections like Related Issues and explicit Type of Change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch consistent-color

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@saddlepaddle saddlepaddle merged commit 4c23a46 into main Feb 16, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ⚠️ Electric Fly.io app
  • ⚠️ Streams Fly.io app

Thank you for your contribution! 🎉

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