Skip to content

feat(desktop): add project color customization to v2 sidebar - #4980

Open
AviPeltz wants to merge 5 commits into
mainfrom
innate-principal
Open

AviPeltz wants to merge 5 commits into
mainfrom
innate-principal

Conversation

@AviPeltz

@AviPeltz AviPeltz commented May 28, 2026 •

Copy link
Copy Markdown
Collaborator

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-meta store: add color to ProjectMeta + setProjectColor action.
  • v2 sidebar: new "Set Color" submenu (ColorSelector, menu variant) in the project context menu; thread projectColor through the section → row / collapsed content → ProjectThumbnail.
  • ProjectThumbnail (v2): render custom hex color on border + letter fallback.
  • Cleanup: extracted the duplicated hexToRgba / isCustomProjectColor helpers into shared/constants/project-colors.ts and 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 lint clean, typecheck passes, existing colors + v1 thumbnail tests pass.

Open in Stage

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) with includeDefault.
    • Thread projectColor through collapsed and expanded views to ProjectThumbnail; apply color to border and letter fallback.
    • Persist per‑project color in v2-project-local-meta via setProjectColor (clearing sets PROJECT_COLOR_DEFAULT).
  • Refactors

    • Make project color non‑nullable in v2-project-local-meta, defaulting to PROJECT_COLOR_DEFAULT.
    • Move hexToRgba and isCustomProjectColor to shared/constants/project-colors.ts; v1 and v2 thumbnails use them.

Written for commit 56cc7bc. Summary will update on new commits.

Review in cubic

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.

@capy-ai

capy-ai Bot commented May 28, 2026

Copy link
Copy Markdown

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 891a4cb1-8c07-4d21-b8c1-6bc845de6a4f

📥 Commits

Reviewing files that changed from the base of the PR and between 5b28ecf and 56cc7bc.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/components/ColorSelector/ColorSelector.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx

📝 Walkthrough

Walkthrough

Adds project color support to desktop sidebars: shared color utilities, persisted per-project color in local meta store, hook integration exposing color and setter, UI wiring through sidebar components and context menu, and color-aware thumbnail rendering in dashboard and workspace sidebars.

Changes

Project Color Support

Layer / File(s) Summary
Shared color utility functions
apps/desktop/src/shared/constants/project-colors.ts
Added isCustomProjectColor type-guard to detect custom hex colors and hexToRgba converter to format colors as RGBA strings.
Project color persistence
apps/desktop/src/renderer/stores/v2-project-local-meta.ts
Extended ProjectMeta interface with color: string, added default value, and implemented setProjectColor action.
Sidebar hook color integration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/.../hooks/useDashboardSidebarProjectSectionActions/useDashboardSidebarProjectSectionActions.ts
Hook now reads projectColor from local meta store and exports handleSetColor callback.
Dashboard sidebar component wiring
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/.../DashboardSidebarProjectSection/DashboardSidebarProjectSection.tsx
Main component threads projectColor and onSetColor to context menu and to both collapsed and expanded project display components.
Color selector in context menu
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/.../DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx
Added "Set Color" submenu with ColorSelector component wired to the onSetColor handler.
Project thumbnail props in sidebar
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/.../DashboardSidebarCollapsedProjectContent/DashboardSidebarCollapsedProjectContent.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/.../DashboardSidebarProjectRow/DashboardSidebarProjectRow.tsx
Both components accept projectColor prop and pass it to ProjectThumbnail.
Dashboard thumbnail color rendering
apps/desktop/src/renderer/routes/_authenticated/components/ProjectThumbnail/ProjectThumbnail.tsx
Component now accepts color prop and applies custom RGBA styles to icon wrapper and fallback thumbnail when color is present.
Workspace thumbnail utility migration
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectThumbnail/ProjectThumbnail.tsx
Updated to use shared color utilities (isCustomProjectColor, hexToRgba) from constants.
ColorSelector include-default option
apps/desktop/src/renderer/components/ColorSelector/ColorSelector.tsx
includeDefault prop added; colorOptions computed and used for both menu and inline variants.
sequenceDiagram
  participant User
  participant DashboardSidebar
  participant DashboardSidebarProjectContextMenu
  participant useV2ProjectLocalMetaStore
  participant ProjectThumbnail
  User->>DashboardSidebar: open sidebar / right-click project
  DashboardSidebar->>DashboardSidebarProjectContextMenu: open menu (projectColor)
  DashboardSidebarProjectContextMenu->>useV2ProjectLocalMetaStore: call setProjectColor via handleSetColor
  DashboardSidebar->>ProjectThumbnail: pass updated color prop
  ProjectThumbnail->>useV2ProjectLocalMetaStore: (reads color via hook for rendering)
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 A rainbow of projects hops into place,
Custom colors brighten up the sidebar space.
From store to selector, each hue finds its way,
Painted thumbnails dance—hop, hop, hooray! 🎨✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding project color customization to the v2 sidebar, which aligns with the entire changeset.
Description check ✅ Passed The description covers all required template sections with sufficient detail: clear summary of changes, related components updated, feature type identified, comprehensive test plan, and additional context via cubic summary.
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 innate-principal

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.

@ghost

ghost commented May 28, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 5 individual chapters for you:

Title
1 Centralize project color utility functions
2 Add color persistence to v2 project store
3 Enhance ColorSelector with default option support
4 Update ProjectThumbnail to render custom colors
5 Wire color actions and state into sidebar
Open in Stage

Chapters generated by Stage for commit 56cc7bc on Jun 2, 2026 9:25am UTC.

@greptile-apps

greptile-apps Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR ports the project color customization feature from the v1 sidebar to the v2 dashboard sidebar. Users can right-click a project in the v2 sidebar, pick a color from a "Set Color" submenu, and the thumbnail border/background/text tint accordingly; the color is stored in the existing v2-project-local-meta zustand store (client-side only). As part of the change, duplicated hexToRgba and isCustomProjectColor helpers are extracted into shared/constants/project-colors.ts and consumed by both sidebar thumbnails.

  • v2-project-local-meta store: color: string | null added to ProjectMeta and a setProjectColor action wired up; additive schema change with no migration needed.
  • v2 sidebar wiring: projectColor flows from the hook → section → row / collapsed content → ProjectThumbnail; context menu gains a ContextMenuSub with the shared ColorSelector in menu variant.
  • Functional gap: The ColorSelector menu variant only renders the 12 palette hex colors — it never shows a "Default" option — so a color set via the v2 context menu cannot be cleared. The test plan item "Selecting the default option clears the custom color" cannot pass in the current implementation."

Confidence Score: 3/5

The color-setting flow works correctly, but once a color is chosen it cannot be cleared — the Default reset option is absent from the context menu.

The store, hook, and thumbnail rendering are all wired correctly, and the shared-helper extraction is clean. The blocking gap is in ColorSelector's menu variant: it iterates only the 12 palette colors and never emits PROJECT_COLOR_DEFAULT, so users who set a color have no way to revert to the default gray border. The PR's own test plan flags this scenario as unverified, and the current implementation will not satisfy it.

apps/desktop/src/renderer/components/ColorSelector/ColorSelector.tsx — the menu variant needs a Default item prepended to allow color resets.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/components/ColorSelector/ColorSelector.tsx Menu variant omits the PROJECT_COLOR_DEFAULT option, making it impossible to clear a color once set — breaks the PR's own test-plan item.
apps/desktop/src/renderer/stores/v2-project-local-meta.ts Additive schema change (color: string
apps/desktop/src/shared/constants/project-colors.ts Correctly extracts hexToRgba and isCustomProjectColor from v1 thumbnail into a shared helper; isCustomProjectColor signature improved to be a type guard (color is string).
apps/desktop/src/renderer/routes/_authenticated/components/ProjectThumbnail/ProjectThumbnail.tsx New v2 thumbnail correctly applies border/background/text tint using shared helpers; fallback letter rendering with custom color looks correct.
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectThumbnail/ProjectThumbnail.tsx Cleaned up local hexToRgba/isCustomColor duplicates and replaced with shared helpers; logic unchanged.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/hooks/useDashboardSidebarProjectSectionActions/useDashboardSidebarProjectSectionActions.ts Correctly reads projectColor from the zustand store and exposes handleSetColor; signature narrowing (string instead of string
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx Correctly wires the Set Color submenu using ContextMenuSub with ColorSelector in menu variant; passes projectColor for checked-state display.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Store["v2-project-local-meta\n(zustand persist)"]
    Hook["useDashboardSidebarProjectSectionActions\nprojectColor / handleSetColor"]
    Section["DashboardSidebarProjectSection"]
    CtxMenu["DashboardSidebarProjectContextMenu\nonSetColor / projectColor"]
    ColorSel["ColorSelector\nvariant='menu'"]
    Row["DashboardSidebarProjectRow\nprojectColor"]
    Collapsed["DashboardSidebarCollapsedProjectContent\nprojectColor"]
    ThumbV2["ProjectThumbnail (v2)\nborder + bg + text tint"]
    ThumbV1["ProjectThumbnail (v1)\nborder + bg + text tint"]
    SharedHelpers["shared/constants/project-colors.ts\nhexToRgba · isCustomProjectColor"]

    Store -->|"color ?? null"| Hook
    Hook -->|"projectColor, handleSetColor"| Section
    Section --> CtxMenu
    Section --> Row
    Section --> Collapsed
    CtxMenu --> ColorSel
    ColorSel -->|"onSelectColor(hex)"| Hook
    Hook -->|"setProjectColor(id, color)"| Store
    Row --> ThumbV2
    Collapsed --> ThumbV2
    ThumbV2 --> SharedHelpers
    ThumbV1 --> SharedHelpers
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/hooks/useDashboardSidebarProjectSectionActions/useDashboardSidebarProjectSectionActions.ts:58-60
**`handleSetColor` signature prevents clearing to `null`**

`setProjectColor` accepts `string | null`, but `handleSetColor` (and therefore `onSetColor` on the context menu) only accepts `string`. When a "Default"/"clear" option is eventually added to the `ColorSelector` menu variant, the handler will need to forward `null` (or the `PROJECT_COLOR_DEFAULT` sentinel) to the store. The current narrow signature will silently store `"default"` as a string instead of `null`, which still works for `isCustomProjectColor`, but is an inconsistency that could cause confusion.

### Issue 2 of 2
apps/desktop/src/shared/constants/project-colors.ts:33-38
**`hexToRgba` silently produces `rgba(NaN, NaN, NaN, alpha)` for invalid hex**

The function slices the input without any length/format validation. A 3-character shorthand (`#RGB`), a hex-with-alpha string (`#RRGGBBAA`), or any non-`#RRGGBB` string produces `NaN` components. Since callers guard with `isCustomProjectColor` (which checks `startsWith("#")`), arbitrary strings are already blocked, but a mismatched-length hex like `#abc` would still pass through and produce a broken rgba value. Given that colors are currently constrained to the predefined palette this is low risk, but the shared helper doesn't document or enforce the expected format.

Reviews (1): Last reviewed commit: "feat(desktop): add project color customi..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

3 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx">

<violation number="1" location="apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx:65">
P2: This submenu has no way to clear a project color back to default, so custom colors can be added but not removed.</violation>
</file>

<file name="apps/desktop/src/shared/constants/project-colors.ts">

<violation number="1" location="apps/desktop/src/shared/constants/project-colors.ts:29">
P3: Validate the full hex format here instead of only checking `startsWith("#")`; values like `#abc` pass this guard and can produce invalid `rgba(...)` output downstream.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant User
    participant V2Sidebar as V2 Dashboard Sidebar
    participant ContextMenu as Project Context Menu
    participant ColorSelector as ColorSelector (menu variant)
    participant V2Store as v2-project-local-meta (zustand + persist)
    participant Thumbnail as ProjectThumbnail (v2)
    participant SharedHelpers as shared/constants/project-colors.ts

    Note over User,SharedHelpers: Project Color Customization — Client-Side Only

    User->>V2Sidebar: Right-click project in sidebar
    V2Sidebar->>ContextMenu: Open context menu (projectColor, onSetColor)
    ContextMenu->>ContextMenu: Render "Set Color" submenu with LuPalette icon
    ContextMenu->>ColorSelector: Pass selectedColor={projectColor}, onSelectColor={handleSetColor}

    User->>ColorSelector: Click a color swatch (or default)
    ColorSelector->>ContextMenu: onSelectColor(color)
    ContextMenu->>V2Store: setProjectColor(project.id, color)

    alt Color is hex value (not default)
        V2Store->>V2Store: Update projects[id].color = "#RRGGBB"
    else Color is null (cleared/default)
        V2Store->>V2Store: Update projects[id].color = null
    end

    Note over V2Store: Zustand persist middleware saves to localStorage automatically

    V2Store->>V2Sidebar: Re-render with updated projectColor
    V2Sidebar->>Thumbnail: Pass color={projectColor}

    Note over Thumbnail,SharedHelpers: Thumbnail rendering

    alt Sidebar is collapsed
        V2Sidebar->>DashboardSidebarCollapsedProjectContent: pass projectColor
        DashboardSidebarCollapsedProjectContent->>Thumbnail: render with color
    else Sidebar is expanded
        V2Sidebar->>DashboardSidebarProjectRow: pass projectColor
        DashboardSidebarProjectRow->>Thumbnail: render with color
    end

    Thumbnail->>SharedHelpers: isCustomProjectColor(color)
    SharedHelpers-->>Thumbnail: boolean (true if hex and not default)

    alt hasCustomColor == true
        Thumbnail->>SharedHelpers: hexToRgba(color, 0.6) for border
        Thumbnail->>Thumbnail: Apply border color (rgba with 0.6 alpha)
        opt Icon fails to load
            Thumbnail->>SharedHelpers: hexToRgba(color, 0.15) for background
            Thumbnail->>Thumbnail: Set background and text color to custom color
        end
    else hasCustomColor == false
        Thumbnail->>Thumbnail: Use default border-foreground/10 and bg-muted
    end

    Thumbnail-->>V2Sidebar: Render thumbnail with applied color style
    V2Sidebar-->>User: Display updated project thumbnail
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

export function isCustomProjectColor(
color: string | null | undefined,
): color is string {
return !!color && color !== PROJECT_COLOR_DEFAULT && color.startsWith("#");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: Validate the full hex format here instead of only checking startsWith("#"); values like #abc pass this guard and can produce invalid rgba(...) output downstream.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/shared/constants/project-colors.ts, line 29:

<comment>Validate the full hex format here instead of only checking `startsWith("#")`; values like `#abc` pass this guard and can produce invalid `rgba(...)` output downstream.</comment>

<file context>
@@ -21,3 +21,18 @@ export const PROJECT_CUSTOM_COLORS = PROJECT_COLORS;
+export function isCustomProjectColor(
+	color: string | null | undefined,
+): color is string {
+	return !!color && color !== PROJECT_COLOR_DEFAULT && color.startsWith("#");
+}
+
</file context>
Suggested change
return !!color && color !== PROJECT_COLOR_DEFAULT && color.startsWith("#");
return !!color && color !== PROJECT_COLOR_DEFAULT && /^#[0-9A-Fa-f]{6}$/.test(color);

interface ProjectMeta {
isCollapsed: boolean;
tabOrder: number;
color: string | null;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

shouldnt we have a default value instead of null for the color string value?

getProjectMeta: (id: string) => ProjectMeta;
toggleProjectCollapsed: (id: string) => void;
setProjectTabOrder: (id: string, order: number) => void;
setProjectColor: (id: string, color: string | null) => void;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

why | null

const DEFAULT_PROJECT_META: ProjectMeta = {
isCollapsed: false,
tabOrder: 0,
color: null,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

default string instead of null maybe, we already have the default gray we use

interface ProjectThumbnailProps {
projectName: string;
iconUrl?: string | null;
color?: string | null;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

null

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/desktop/src/renderer/stores/v2-project-local-meta.ts (1)

5-9: ⚡ Quick win

Backfill missing ProjectMeta.color on getProjectMeta (zustand persist has no migration)

apps/desktop/src/renderer/stores/v2-project-local-meta.ts uses persist with name: "v2-project-local-meta", version: 1 and no migration/merge logic, so older persisted projects[id] entries can lack color. A repo search for getProjectMeta( in *.ts didn’t find any consumers reading .color directly, but returning an object with color: undefined still breaks the ProjectMeta invariant.

🛠️ Proposed fix to backfill missing fields
 				getProjectMeta: (id) => {
-					return get().projects[id] ?? DEFAULT_PROJECT_META;
+					return { ...DEFAULT_PROJECT_META, ...get().projects[id] };
 				},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop/src/renderer/stores/v2-project-local-meta.ts` around lines 5 -
9, Persisted project entries may lack the ProjectMeta.color field because the
zustand persist store ("v2-project-local-meta", version: 1) has no migration;
update the persist usage and getProjectMeta to backfill defaults: add a
migration/merge handler in the persist config for "v2-project-local-meta" that
assigns a sane default color when loading older state, and in the getProjectMeta
function ensure any returned ProjectMeta always contains a non-undefined color
(e.g., set color = color ?? '<default-color>' or compute fallback) so the
ProjectMeta invariant is preserved; reference the ProjectMeta interface,
getProjectMeta, and the persist config name when making changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/desktop/src/renderer/stores/v2-project-local-meta.ts`:
- Around line 5-9: Persisted project entries may lack the ProjectMeta.color
field because the zustand persist store ("v2-project-local-meta", version: 1)
has no migration; update the persist usage and getProjectMeta to backfill
defaults: add a migration/merge handler in the persist config for
"v2-project-local-meta" that assigns a sane default color when loading older
state, and in the getProjectMeta function ensure any returned ProjectMeta always
contains a non-undefined color (e.g., set color = color ?? '<default-color>' or
compute fallback) so the ProjectMeta invariant is preserved; reference the
ProjectMeta interface, getProjectMeta, and the persist config name when making
changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f4fb9654-004e-4138-a124-e8a7288b301d

📥 Commits

Reviewing files that changed from the base of the PR and between 496e262 and 5b28ecf.

📒 Files selected for processing (5)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarCollapsedProjectContent/DashboardSidebarCollapsedProjectContent.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectRow/DashboardSidebarProjectRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/hooks/useDashboardSidebarProjectSectionActions/useDashboardSidebarProjectSectionActions.ts
  • apps/desktop/src/renderer/stores/v2-project-local-meta.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarCollapsedProjectContent/DashboardSidebarCollapsedProjectContent.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectRow/DashboardSidebarProjectRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectContextMenu/DashboardSidebarProjectContextMenu.tsx

This branch has not been deployed

No deployments
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