Color environment indicators per environment#4505
Conversation
Every environment indicator in the app draws the same glyph, so users running threads on several machines cannot tell which environment a thread belongs to without hovering. Let each environment carry a user-chosen accent color and tint the glyphs that already exist, so environments become distinguishable at a glance without adding text to rows that have no horizontal room to spare. The mapping lives in client settings: it describes how this client distinguishes its environments, must stay readable while an environment is disconnected, and should not be dictated by whichever backend happens to be primary. The provider accent color picker is generalized to an AccentColorPicker and reused for environments rather than duplicated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
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 Plus 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 using high effort 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 4a3384f. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (per-environment accent colors) with new components, hooks, and client settings schema additions. New features with visual behavior changes across multiple UI surfaces warrant human review. You can customize Macroscope's approvability policy. Learn more. |
The setter captured the accent-color map at render time, so two commits landing before React re-rendered both started from the same snapshot and the second dropped the first environment's color. The picker commits on a delay, which makes that reachable by recoloring two environments quickly. Add useUpdateClientSettingsWith for patches computed from the current value and derive the map from the settings in effect at call time. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ment) # Conflicts: # apps/web/src/components/Sidebar.tsx # apps/web/src/components/SidebarV2.tsx # apps/web/src/components/settings/ConnectionsSettings.tsx
…ment) # Conflicts: # apps/web/src/components/Sidebar.tsx # apps/web/src/components/SidebarV2.tsx # apps/web/src/components/settings/ConnectionsSettings.tsx
…ment) # Conflicts: # apps/web/src/components/Sidebar.tsx # apps/web/src/components/SidebarV2.tsx # apps/web/src/components/settings/ConnectionsSettings.tsx
…ment) # Conflicts: # apps/web/src/components/Sidebar.tsx # apps/web/src/components/SidebarV2.tsx # apps/web/src/components/settings/ConnectionsSettings.tsx
The 3-way apply of pingdotgg#4505's diff inserted its version of the meta block while the conflict resolution added ours, duplicating the region and orphaning a ternary close.
…ment) # Conflicts: # apps/web/src/components/Sidebar.tsx # apps/web/src/components/SidebarV2.tsx # apps/web/src/components/settings/ConnectionsSettings.tsx
t3code/show-remote-host-name is now based on top of t3code/color-host-names, so it subsumes pingdotgg#4505. Carrying them as two entries meant hand-combining branches that were already combined correctly upstream -- the source of most of this cluster's conflicts.
Manifests and locks updated to the current stack (pingdotgg#4505 subsumed, pingdotgg#4401 resolved at source). BUILDING.md gains a pre-build syntax gate: esbuild parses TSX in seconds with an exact location, where a nix build takes minutes and Babel surfaces only the first parse error per file.

What Changed
environmentAccentColors, keyed byEnvironmentId).Run onenvironment selector (trigger and each item).ProviderAccentColorPickerinto a reusableAccentColorPickerand reused it for environments rather than duplicating the swatch/custom-color UI.Why
Every environment indicator draws the same glyph, so someone running threads on several machines cannot tell which environment a thread belongs to without hovering. Color differentiates the indicators that are already on screen.
Deliberately no labels: sidebar rows have no horizontal room to spare, so this rides entirely on existing glyphs.
The mapping is client-local rather than server-backed on purpose. It describes how this client distinguishes its environments, it has to stay readable while an environment is disconnected, and no single backend should dictate it to the others.
UI Changes
Verified live in the web app: the row renders for the current environment, the popover offers the six shared swatches plus the custom hex/HSV picker and a clear action, and the choice round-trips through client settings (
environmentAccentColorsin persisted client settings) and is reflected back in the control.The tinted remote glyphs themselves need a second, genuinely remote backend to appear. I could not pair two local dev servers in a browser to capture that: cross-origin pairing is blocked because
/.well-known/t3/environmentand/api/auth/pairdo not sendaccess-control-allow-origin(pre-existing, unrelated to this change). The tinting logic is covered by tests instead, and the render sites are one-line style applications ofenvironmentAccentStyle.Checklist
vp test run apps/web/src/environmentAccentColors.test.ts apps/web/src/environmentGrouping.test.ts(30 tests)vp test run apps/desktop/src/settings/DesktopClientSettings.test.ts(7 tests)vp run --filter @t3tools/web typecheckvp run --filter @t3tools/contracts typecheckvp run --filter @t3tools/desktop typecheckvp run --filter @t3tools/client-runtime typecheckvp run --filter @t3tools/mobile typecheckvp lintandvp fmton every changed fileNote
Low Risk
UI-only client settings and icon styling with validation and tests; no auth, server state, or data migration risk.
Overview
Users can assign a per-environment accent color stored in client settings (
environmentAccentColors) so existing environment glyphs are visually distinct without adding labels.Settings & persistence: Connections gains an accent-color control for the primary environment and each remote row (
EnvironmentAccentColorControl). Colors are client-local hex values, normalized via sharedaccentColorshelpers (provider picker refactored to genericAccentColorPicker). Updates useuseUpdateClientSettingsWithso rapid picker commits do not clobber each other.UI tinting: Sidebar (v1/v2), branch toolbar “Run on” selector, and grouped project remote badges apply
environmentAccentStylewhen a color is set; grouped badges only tint when all remote members share one color (remoteEnvironmentIdsadded to sidebar grouping).Contracts & tests:
ClientSettings/ patch schemas extended; desktop settings tests updated; unit tests cover resolve/apply/style behavior.Reviewed by Cursor Bugbot for commit e6e3dd5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add per-environment accent color indicators across the UI
environmentAccentColorsto client settings (keyed byEnvironmentId) and exposes hooks and utilities in environmentAccentColors.ts for reading, resolving, and updating colors.EnvironmentAccentColorControlcomponent (swatch button + popover picker) rendered in the Connections settings for both primary and saved remote environments.ACCENT_COLOR_SWATCHES,normalizeAccentColor) into accentColors.ts and reuses them in the existing provider accent color picker.useUpdateClientSettingsWithhook to apply settings patches derived from the latest snapshot, avoiding stale overwrites on concurrent writes.Macroscope summarized e6e3dd5.