Skip to content

Color environment indicators per environment#4505

Open
colonelpanic8 wants to merge 2 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/color-host-names
Open

Color environment indicators per environment#4505
colonelpanic8 wants to merge 2 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/color-host-names

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 25, 2026

Copy link
Copy Markdown

What Changed

  • Added a per-environment accent color, chosen by the user and stored in client settings (environmentAccentColors, keyed by EnvironmentId).
  • Added an Accent color control to Settings → Connections, both for "This environment" and for every saved remote environment row.
  • Tinted the environment glyphs that already exist with the chosen color — no new text anywhere:
    • the remote cloud glyph on sidebar thread rows,
    • the project header remote/sandbox badge (only when every remote member of the group agrees on one color),
    • the sidebar v2 row server glyph and its hover-tooltip environment row,
    • the sidebar v2 project-actions environment rows,
    • the Run on environment selector (trigger and each item).
  • Generalized the existing ProviderAccentColorPicker into a reusable AccentColorPicker and 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

Accent color row (unset) Picker open Color chosen
Accent color row with no color set Accent color picker popover with swatches Accent color row showing the chosen green

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 (environmentAccentColors in 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/environment and /api/auth/pair do not send access-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 of environmentAccentStyle.

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 typecheck
  • vp run --filter @t3tools/contracts typecheck
  • vp run --filter @t3tools/desktop typecheck
  • vp run --filter @t3tools/client-runtime typecheck
  • vp run --filter @t3tools/mobile typecheck
  • vp lint and vp fmt on every changed file
  • Exercised the real settings flow in the running web app and confirmed persistence

Note

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 shared accentColors helpers (provider picker refactored to generic AccentColorPicker). Updates use useUpdateClientSettingsWith so rapid picker commits do not clobber each other.

UI tinting: Sidebar (v1/v2), branch toolbar “Run on” selector, and grouped project remote badges apply environmentAccentStyle when a color is set; grouped badges only tint when all remote members share one color (remoteEnvironmentIds added 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

  • Adds environmentAccentColors to client settings (keyed by EnvironmentId) and exposes hooks and utilities in environmentAccentColors.ts for reading, resolving, and updating colors.
  • Environment icons in the branch toolbar selector, sidebar thread rows, project headers, and SidebarV2 rows/tooltips are now tinted with the environment's accent color when set.
  • Adds an EnvironmentAccentColorControl component (swatch button + popover picker) rendered in the Connections settings for both primary and saved remote environments.
  • Extracts shared accent color primitives (ACCENT_COLOR_SWATCHES, normalizeAccentColor) into accentColors.ts and reuses them in the existing provider accent color picker.
  • Adds useUpdateClientSettingsWith hook to apply settings patches derived from the latest snapshot, avoiding stale overwrites on concurrent writes.

Macroscope summarized e6e3dd5.

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>
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 53ea9f82-37e7-41b5-94e7-3c2b2f720385

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 25, 2026
Comment thread apps/web/src/environmentAccentColors.ts

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/environmentAccentColors.ts
@macroscopeapp

macroscopeapp Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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>
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
…ment)

# Conflicts:
#	apps/web/src/components/Sidebar.tsx
#	apps/web/src/components/SidebarV2.tsx
#	apps/web/src/components/settings/ConnectionsSettings.tsx
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
…ment)

# Conflicts:
#	apps/web/src/components/Sidebar.tsx
#	apps/web/src/components/SidebarV2.tsx
#	apps/web/src/components/settings/ConnectionsSettings.tsx
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
…ment)

# Conflicts:
#	apps/web/src/components/Sidebar.tsx
#	apps/web/src/components/SidebarV2.tsx
#	apps/web/src/components/settings/ConnectionsSettings.tsx
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
…ment)

# Conflicts:
#	apps/web/src/components/Sidebar.tsx
#	apps/web/src/components/SidebarV2.tsx
#	apps/web/src/components/settings/ConnectionsSettings.tsx
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
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.
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
…ment)

# Conflicts:
#	apps/web/src/components/Sidebar.tsx
#	apps/web/src/components/SidebarV2.tsx
#	apps/web/src/components/settings/ConnectionsSettings.tsx
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
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.
colonelpanic8 added a commit to colonelpanic8/t3code that referenced this pull request Jul 25, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant