From 0c2a63b8e59e4b38a5ed9d1de88ebb7cf86db499 Mon Sep 17 00:00:00 2001 From: repparw Date: Tue, 27 Oct 2026 20:39:40 -0300 Subject: [PATCH 1/3] Add device-local per-environment badge glyphs Let users assign a character or emoji to each environment, with the server-backed machine icon as the fallback. Apply badges across run selectors, project/thread indicators, settings and command palette. Support Unicode graphemes, IME composition and storage failure recovery. Cover independent environment preferences with unit tests. --- apps/web/src/components/BranchToolbar.tsx | 17 +++-- .../BranchToolbarEnvironmentSelector.tsx | 14 ++-- apps/web/src/components/CommandPalette.tsx | 10 ++- .../src/components/EnvironmentBadgeIcon.tsx | 32 +++++++++ .../components/ProjectEnvironmentBadge.tsx | 6 +- .../src/components/ThreadStatusIndicators.tsx | 5 +- .../settings/ConnectionsSettings.tsx | 18 ++++- .../settings/EnvironmentGlyphInput.tsx | 61 ++++++++++++++++ .../components/settings/EnvironmentRow.tsx | 27 +++++-- .../settings/SavedEnvironmentRows.tsx | 7 ++ .../components/sidebar/SidebarThreadRow.tsx | 15 ++-- apps/web/src/environmentGlyphStore.test.ts | 41 +++++++++++ apps/web/src/environmentGlyphStore.ts | 72 +++++++++++++++++++ 13 files changed, 296 insertions(+), 29 deletions(-) create mode 100644 apps/web/src/components/EnvironmentBadgeIcon.tsx create mode 100644 apps/web/src/components/settings/EnvironmentGlyphInput.tsx create mode 100644 apps/web/src/environmentGlyphStore.test.ts create mode 100644 apps/web/src/environmentGlyphStore.ts diff --git a/apps/web/src/components/BranchToolbar.tsx b/apps/web/src/components/BranchToolbar.tsx index 93249bcf0c9f2..b5e4872178b4e 100644 --- a/apps/web/src/components/BranchToolbar.tsx +++ b/apps/web/src/components/BranchToolbar.tsx @@ -18,7 +18,7 @@ import { import { flushSync } from "react-dom"; import { useComposerDraftStore, type DraftId } from "../composerDraftStore"; -import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon"; +import { EnvironmentBadgeIcon } from "./EnvironmentBadgeIcon"; import { useProject, useThreadShellsForProjectRefs } from "../state/entities"; import { ADD_TO_MACHINE_LABEL_CLASS, @@ -234,7 +234,8 @@ const RunContextSelector = memo(function RunContextSelector({ aria-hidden="true" /> ) : ( - - + {env.label} @@ -379,7 +384,11 @@ const RunContextSelector = memo(function RunContextSelector({ onClick={() => onAddToMachine(target.environmentId)} > - + {target.label} diff --git a/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx b/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx index 4dfe1ae50f024..8588103aec692 100644 --- a/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx +++ b/apps/web/src/components/BranchToolbarEnvironmentSelector.tsx @@ -9,7 +9,7 @@ import { PlusIcon, ScaleIcon } from "lucide-react"; import { memo } from "react"; import { ADD_TO_MACHINE_LABEL_CLASS, type EnvironmentOption } from "./BranchToolbar.logic"; -import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon"; +import { EnvironmentBadgeIcon } from "./EnvironmentBadgeIcon"; import { useComposerMenuProps } from "./chat/composerEventScope"; import { Select, @@ -71,7 +71,8 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir className="inline-flex h-7 min-w-0 max-w-full items-center gap-1 border border-transparent px-1.75 font-normal text-muted-foreground/70 text-sm sm:h-6 sm:text-xs" data-composer-context-control > - @@ -116,7 +117,8 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir {autoEnvironmentLabel ? (