feat(desktop): tint session idle dots with their project color - #67205
feat(desktop): tint session idle dots with their project color#67205SHL0MS wants to merge 1 commit into
Conversation
Projects already carry a user-set color (project menu → color picker), but sessions render colorless — a sidebar full of rows gives no at-a- glance grouping. Tint each session's IDLE dot with its owning project's color, resolved from the session cwd by the same longest-prefix walk projectIdForCwd uses (including worktree lanes living outside the repo root). Status always wins: working/needs-input/unread/background dots keep their semantic colors untouched — the tint applies to the idle state only, so 'this session needs you' never loses to 'this session is blue'. Implementation: a $projectColorIndex computed (sorted longest-first path→color index derived from $projectTree) plus a pure projectColorForCwd lookup, so rows subscribe to one derived atom instead of re-walking the tree per render. Colorless and archived projects drop out of the index; sibling dirs sharing a name prefix (work vs work-adjacent) are rejected segment-aware. First slice of NousResearch#66565 (session colors): inherit-from-project. Manual per-session override and optional auto-classification remain follow- ups.
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs address project-color inheritance for sessions. #67205 implements idle-dot coloring in sidebar rows with path/worktree-lane lookup, while #67469 implements the same sidebar behavior through a shared session-color store and extends it to pane tabs and cwd-less sessions.
Related pull requests
- #67205
related— (+276/-4) — overlapping sidebar-focused implementation: adds a longest-prefix project-color index covering project roots, repository roots, and external worktree-lane paths, then applies the color only to idle session dots while preserving semantic status colors. Its core sidebar result is covered by #67469, but its explicit external-worktree-lane lookup and tests are distinct salvageable scope. - #67469 [merged]
related— (+295/-14) — merged reference implementation: centralizes project-derived colors in $sessionColorById, uses that source for both sidebar idle dots and pane-tab accents, and adds cwd-less git_repo_root handling. It remains relevant because it now provides the broader implementation against which #67205 must be rebased or narrowed.
Duplicates
#67205 and #67469 overlap on project-colored idle dots in sidebar session rows, but they are not complete duplicates: #67469 also covers tabs and cwd-less sessions, whereas #67205 explicitly indexes external worktree-lane paths. This matches the contributor's documented assessment that they are overlapping slices rather than duplicates.
Suggested consolidation
Author action for #67205: rebase onto the implementation from #67469 and split out only the external-worktree-lane resolution and corresponding tests if that behavior is still missing. Do not retain the duplicate sidebar-dot implementation or its parallel color store; #67469 already supplies the shared sidebar-and-tab color path, while #67205's concrete salvage path is its distinct worktree-lane coverage.
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 37 kB of PR diffs, 4 kB of issue/PR text, <1 kB of discussion (2 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
First slice of #66565 (session colors): sessions inherit their project's color.
What
Projects already have a user-set color (project menu → color picker) that tints the project row's dot. Sessions ignored it. Now each session row's idle dot tints with its owning project's color — set your work project blue and every session under it reads as work at a glance, iTerm2-tab-color style.
How
$projectColorIndex— a computed on$projectTree: a longest-first sorted path→color index covering project roots, repo roots, and worktree-lane paths (a linked worktree living outside the repo root still matches, same coverage asprojectIdForCwd). Colorless and archived projects drop out.projectColorForCwd(index, cwd)— pure lookup, first (longest) hit wins. Segment-aware prefix matching, so/Users/me/work-adjacentnever matches a/Users/me/workproject.SidebarSessionRowsubscribes to the one derived atom and passes the color down to the dot. Inline style, since project colors are arbitrary user values (Tailwind can't see them).Status always wins
The tint applies to the idle state only. Working (accent pulse), needs-input (amber), unread (green), and background (gray pulse) keep their semantic colors untouched — "this session needs you" never loses to "this session is blue". This also keeps the dot from fighting the attention-signal work proposed in #50718.
Tests
projects.test.ts: 6 new cases — owner resolution, nested-project longest-prefix, out-of-root worktree lanes, colorless/archived exclusion, sibling-prefix rejection, empty cwd.session-row.test.tsx(new): renders the row and asserts the idle dot tints, sessions outside colored projects stay untinted, and a working session keeps its accent class with no inline override.tsc --noEmitand eslint clean.Follow-ups (out of scope, tracked in #66565)
Manual per-session color override, and optional auto-classification of new sessions into user-defined color buckets during title generation.