feat(desktop): add project color customization to v2 sidebar
AV
5mo ago+125+125+012345678901234567890123456789-24-24-01234567890123456789
Summary
Ports the project-color feature from the v1 sidebar to the v2 dashboard sidebar (inspired by the project-color-sidebar branch). Users can right-click a project in the v2 sidebar and pick a color from a Set Color submenu; the chosen color tints the project thumbnail's border (and background/text for the letter fallback).
Color is stored client-side only in the existing v2-project-local-meta zustand store (persisted locally) — no server/DB changes, matching the v1 behavior.
Changes
v2-project-local-metastore: addcolortoProjectMeta+setProjectColoraction.- v2 sidebar: new "Set Color" submenu (
ColorSelector, menu variant) in the project context menu; threadprojectColorthrough the section → row / collapsed content →ProjectThumbnail. ProjectThumbnail(v2): render custom hex color on border + letter fallback.- Cleanup: extracted the duplicated
hexToRgba/isCustomProjectColorhelpers intoshared/constants/project-colors.tsand refactored both the v1 and v2 thumbnails to consume them (removes a pre-existing copy).
Test Plan
- Right-click a project in the v2 sidebar → Set Color → pick a color; thumbnail border/letter tints accordingly.
- Color persists across app reloads.
- Selecting the default option clears the custom color.
- Collapsed sidebar thumbnail reflects the color.
-
bun run lintclean,typecheckpasses, existing colors + v1 thumbnail tests pass.
Summary by cubic
Adds project color customization to the v2 dashboard sidebar. Right‑click a project to Set Color (includes Default to reset); thumbnails tint accordingly and choices persist locally with no server changes.
-
New Features
- Add “Set Color” submenu in the project context menu using
ColorSelector(menu variant) withincludeDefault. - Thread
projectColorthrough collapsed and expanded views toProjectThumbnail; apply color to border and letter fallback. - Persist per‑project color in
v2-project-local-metaviasetProjectColor(clearing setsPROJECT_COLOR_DEFAULT).
- Add “Set Color” submenu in the project context menu using
-
Refactors
- Make project color non‑nullable in
v2-project-local-meta, defaulting toPROJECT_COLOR_DEFAULT. - Move
hexToRgbaandisCustomProjectColortoshared/constants/project-colors.ts; v1 and v2 thumbnails use them.
- Make project color non‑nullable in
Summary by CodeRabbit
- New Features
- Project color customization: "Set Color" added to project context menus with a color selector (includes a Default option).
- Colors persist locally and are applied to project thumbnails in both collapsed and expanded sidebar views.
- Thumbnails now render custom colors (border, background, text) for consistent visuals and improved contrast.
- Color choices are reflected immediately across sidebar and thumbnail displays.