Add sidebar project colors setting#2381
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4793eac. Configure here.
ApprovabilityVerdict: Approved Adds an opt-in cosmetic feature to colorize sidebar project groups. The setting is off by default, changes are purely visual (Tailwind tint classes), and comprehensive tests are included. No functional behavior changes when the feature is disabled. You can customize Macroscope's approvability policy. Learn more. |
Adds an opt-in "Sidebar project colors" client setting that tints each visible project group with a muted hue and renders a clickable color dot in the project header for picking a custom color. - New `SidebarProjectColor` literal in `@t3tools/contracts/settings`, plus `sidebarProjectColorizing` toggle and `sidebarProjectColorOverrides` record on `ClientSettings` (and the patch shape). - `sidebarProjectColors.ts` owns the palette → Tailwind class mapping, the FNV-1a auto-color hash, and `buildSidebarProjectColorMap`, which spreads auto-colors across the palette so adjacent projects don't share a hue until the palette is exhausted (with explicit overrides claiming their slot first). - Sidebar renders the row tint on the group `<li>`, hides the vertical guide line under the thread list while colorizing is on, and adds uniform padding to the colored block. - The color dot uses a transparent interior with a saturated hue-matched ring so it visually shows the row's color while only the border carries the identity. Click to open a swatch popover; "Auto" clears the override. - Restore Defaults clears both the toggle and any saved per-project picks. Co-Authored-By: Claude Opus 4.7 <[email protected]>
`autoSidebarProjectColor` and `resolveSidebarProjectColor` weren't used by any production caller — `buildSidebarProjectColorMap` re-implemented the same hash + override-fallback logic inline. Cursor Bugbot flagged the duplication risk. - Remove both exports. - Drop the 5 helper-specific tests (their behaviors are still covered by the builder tests: determinism via "preserves color when later-sorted added", override priority via "records the explicit override", auto fallback via "leaves auto entries with undefined override"). - Replace the spread test with a builder-driven version that asserts the full palette gets used across 24 distinct seeds. - Replace the colliding-seed lookup in the walk-past-overrides test with an `autoColorForSeed` helper that drives the builder with a single project, so the test doesn't depend on the now-removed export. Co-Authored-By: Claude Opus 4.7 <[email protected]>
31952ac to
a421492
Compare
|
screenshots pls |

Summary
sidebarProjectColorOverrides(record keyed by physical project key, same identity used for grouping overrides). Clicking the color dot opens a swatch popover; "Auto" clears the override.Why
With the default thin-line guide, adjacent project groups visually blend together. Tinting each group with its own muted hue gives a clearer grouping cue, and lets users tag projects they switch between often with distinguishing colors.
UX details
bg-{color}-500/8light /bg-{color}-400/10dark) — same hue as the dot, just heavily muted.p-1padding so it doesn't sit flush against neighbours.Files
packages/contracts/src/settings.ts—SidebarProjectColorliteral + two newClientSettingsfields (and patch entries).apps/web/src/sidebarProjectColors.ts(new) — palette, hash,buildSidebarProjectColorMapwith collision avoidance.apps/web/src/sidebarProjectColors.test.ts(new) — 13 unit tests.apps/web/src/components/Sidebar.tsx—ProjectColorDotcomponent, color identity plumbing, parent-level stable color-select handler.apps/web/src/components/settings/SettingsPanels.tsx— new SettingsRow + restore-defaults wiring.apps/desktop/src/clientPersistence.test.ts,apps/web/src/localApi.test.ts— fixture updates for the two new fields.Test plan
bun fmt/bun lint/bun typecheckpassbun run testforsidebarProjectColors,Sidebar.logic,localApi,clientPersistence🤖 Generated with Claude Code
Note
Medium Risk
Introduces new persisted client settings fields and sidebar rendering paths; risk is mainly around settings decoding/patching compatibility and UI regressions in the sidebar list/drag interactions.
Overview
Adds an opt-in “Sidebar project colors” feature that tints each sidebar project group and shows a clickable color-dot menu to set/clear per-project color overrides.
Extends
ClientSettingswithsidebarProjectColorizingandsidebarProjectColorOverrides(plus patch support and typedSidebarProjectColorliterals), implements deterministic auto-color assignment with override priority in newsidebarProjectColors.ts(with unit tests), and wires the toggle into Settings plus updates persistence/local API fixtures to include the new fields.Reviewed by Cursor Bugbot for commit a421492. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add per-project color tinting to the sidebar with a settings toggle
sidebarProjectColorizingtoggle in General Settings and asidebarProjectColorOverridesrecord to client settings (viapackages/contracts/src/settings.ts).buildSidebarProjectColorMapusing FNV-1a hashing to assign stable, collision-avoiding auto colors from a 10-color Tailwind palette; explicit per-project overrides take priority.ProjectColorDotpicker next to each project's new-thread button in the sidebar, allowing users to set or clear a color override; selected color is persisted to client settings.Macroscope summarized a421492.