Skip to content

fix(desktop): spread dev dock-icon colors across full hue range#3622

Merged
Kitenite merged 1 commit into
mainfrom
dev-color-generation-and-collision-issues
Apr 21, 2026
Merged

fix(desktop): spread dev dock-icon colors across full hue range#3622
Kitenite merged 1 commit into
mainfrom
dev-color-generation-and-collision-issues

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Apr 21, 2026

Summary

  • Replace the Tailwind -500 palette used to tint the dev dock-icon corner fold with a golden-angle hue generator in OKLCH (fixed L=0.68, C=0.18).
  • The old palette had ~22 entries, of which ~5 were grey families (slate/gray/zinc/neutral/stone) and several more were near-duplicate hue neighbors (teal/cyan/sky, indigo/violet/purple, pink/rose/fuchsia), leaving only ~8–10 visually distinguishable slots — collisions between concurrent dev workspaces showed up around 3–4 workspaces in practice.
  • Hashing to hue = (hash * 137.508) % 360 spreads successive names evenly around the color wheel with effectively unlimited distinct hues, at roughly Tailwind-500 vibrancy.

Test plan

  • Run bun dev for the desktop app with a couple of workspace names (e.g. via worktrees) and confirm each dock icon gets a distinct, vibrant corner fold.
  • Sanity-check a handful of workspace names produce colors that aren't muddy/grey and aren't near-duplicates of each other.
  • bun run typecheck in apps/desktop.

Summary by cubic

Make dev dock icon colors unique and vibrant for each workspace by replacing the limited Tailwind -500 palette with a golden-angle OKLCH hue generator. This eliminates frequent color collisions across multiple dev workspaces.

  • Refactors
    • Removed tailwindcss/colors palette usage and parsing.
    • Generate hue with (hash(name) * 137.508) % 360 and convert fixed L=0.68, C=0.18 OKLCH to sRGB.

Written for commit 63ceae4. Summary will update on new commits.

Summary by CodeRabbit

  • Refactor
    • Improved workspace color assignment algorithm for more consistent color rendering.

Replace the fixed Tailwind `-500` palette (22 entries, ~5 grey families,
several near-duplicate hue families) with a golden-angle hue generator
over fixed-L/C OKLCH. Successive workspace names land far apart on the
color wheel, eliminating the frequent collisions between concurrent dev
workspaces.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 107fba8d-3946-4eb2-8cd5-f35d136943e7

📥 Commits

Reviewing files that changed from the base of the PR and between f85d6d8 and 63ceae4.

📒 Files selected for processing (1)
  • apps/desktop/src/main/lib/dock-icon.ts

📝 Walkthrough

Walkthrough

The workspace name color selection logic in dock-icon.ts was refactored from a Tailwind color palette lookup to a deterministic algorithmic approach using hash-based hue calculation via the golden angle and OKLCH-to-sRGB color space conversion.

Changes

Cohort / File(s) Summary
Workspace Name Color Selection
apps/desktop/src/main/lib/dock-icon.ts
Replaced Tailwind palette-based color lookup with algorithmic hash→hue mapping (golden angle) and OKLCH-to-sRGB conversion; removed palette construction and fallback logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A workspace palette, once stitched from threads so fine,
Now glimmers with the golden angle's design!
Hash and hue, in perfect harmony blend,
Colors spring forth—no tailored palettes to depend. 🎨✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing the limited Tailwind palette with a golden-angle hue generator that spreads workspace colors across the full hue range.
Description check ✅ Passed The PR description is comprehensive, covering the problem (limited palette causing collisions), the solution (golden-angle OKLCH hue generator), and includes a test plan with specific verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-color-generation-and-collision-issues

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.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 21, 2026

Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance.

@Kitenite Kitenite merged commit 0358690 into main Apr 21, 2026
5 of 7 checks passed
@Kitenite Kitenite deleted the dev-color-generation-and-collision-issues branch April 21, 2026 21:43
@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

Thank you for your contribution! 🎉

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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