@devries-cameron20 / t3code Mirror · read-only / commits / e63403fe92
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 20:15 UTC

[fix/feat:ui] Preserve open-in editor brand colors (#3225)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

ss committed Jul 18, 2026 at 13:22 UTC e63403fe9259b67f8beccdbf8117671ffefaf48f
1 file changed +42 -5
apps/web/src/components/chat/OpenInPicker.tsx
+42 -5
@@ -31,111 +31,138 @@ import {
31 RustRoverIcon,
32 WebStormIcon,
33 } from "../JetBrainsIcons";
34 -import { isMacPlatform, isWindowsPlatform } from "~/lib/utils";
34 +import { cn, isMacPlatform, isWindowsPlatform } from "~/lib/utils";
35 import { shellEnvironment } from "~/state/shell";
36 import { useAtomCommand } from "~/state/use-atom-command";
37
38 +type OpenInOption = {
39 + label: string;
40 + Icon: Icon;
41 + value: EditorId;
42 + kind: "brand" | "generic";
43 +};
44 +
45 const resolveOptions = (platform: string, availableEditors: ReadonlyArray<EditorId>) => {
39 - const baseOptions: ReadonlyArray<{ label: string; Icon: Icon; value: EditorId }> = [
46 + const baseOptions: ReadonlyArray<OpenInOption> = [
47 {
48 label: "Cursor",
49 Icon: CursorIcon,
50 value: "cursor",
51 + kind: "brand",
52 },
53 {
54 label: "Trae",
55 Icon: TraeIcon,
56 value: "trae",
57 + kind: "brand",
58 },
59 {
60 label: "Kiro",
61 Icon: KiroIcon,
62 value: "kiro",
63 + kind: "brand",
64 },
65 {
66 label: "VS Code",
67 Icon: VisualStudioCode,
68 value: "vscode",
69 + kind: "brand",
70 },
71 {
72 label: "VS Code Insiders",
73 Icon: VisualStudioCodeInsiders,
74 value: "vscode-insiders",
75 + kind: "brand",
76 },
77 {
78 label: "VSCodium",
79 Icon: VSCodium,
80 value: "vscodium",
81 + kind: "brand",
82 },
83 {
84 label: "Zed",
85 Icon: Zed,
86 value: "zed",
87 + kind: "brand",
88 },
89 {
90 label: "Antigravity",
91 Icon: AntigravityIcon,
92 value: "antigravity",
93 + kind: "brand",
94 },
95 {
96 label: "IntelliJ IDEA",
97 Icon: IntelliJIdeaIcon,
98 value: "idea",
99 + kind: "brand",
100 },
101 {
102 label: "Aqua",
103 Icon: AquaIcon,
104 value: "aqua",
105 + kind: "brand",
106 },
107 {
108 label: "CLion",
109 Icon: CLionIcon,
110 value: "clion",
111 + kind: "brand",
112 },
113 {
114 label: "DataGrip",
115 Icon: DataGripIcon,
116 value: "datagrip",
117 + kind: "brand",
118 },
119 {
120 label: "DataSpell",
121 Icon: DataSpellIcon,
122 value: "dataspell",
123 + kind: "brand",
124 },
125 {
126 label: "GoLand",
127 Icon: GoLandIcon,
128 value: "goland",
129 + kind: "brand",
130 },
131 {
132 label: "PhpStorm",
133 Icon: PhpStormIcon,
134 value: "phpstorm",
135 + kind: "brand",
136 },
137 {
138 label: "PyCharm",
139 Icon: PyCharmIcon,
140 value: "pycharm",
141 + kind: "brand",
142 },
143 {
144 label: "Rider",
145 Icon: RiderIcon,
146 value: "rider",
147 + kind: "brand",
148 },
149 {
150 label: "RubyMine",
151 Icon: RubyMineIcon,
152 value: "rubymine",
153 + kind: "brand",
154 },
155 {
156 label: "RustRover",
157 Icon: RustRoverIcon,
158 value: "rustrover",
159 + kind: "brand",
160 },
161 {
162 label: "WebStorm",
163 Icon: WebStormIcon,
164 value: "webstorm",
165 + kind: "brand",
166 },
167 {
168 label: isMacPlatform(platform)
@@ -145,12 +172,17 @@ const resolveOptions = (platform: string, availableEditors: ReadonlyArray<Editor
172 : "Files",
173 Icon: FolderClosedIcon,
174 value: "file-manager",
175 + kind: "generic",
176 },
177 ];
178 const availableEditorSet = new Set(availableEditors);
179 return baseOptions.filter((option) => availableEditorSet.has(option.value));
180 };
181
182 +function getOpenInIconClass(kind: OpenInOption["kind"]) {
183 + return cn(kind === "brand" ? "text-foreground opacity-100" : "text-muted-foreground");
184 +}
185 +
186 export const OpenInPicker = memo(function OpenInPicker({
187 environmentId,
188 keybindings,
@@ -233,7 +265,12 @@ export const OpenInPicker = memo(function OpenInPicker({
265 disabled={!preferredEditor || !openInCwd}
266 onClick={() => openInEditor(preferredEditor)}
267 >
236 - {primaryOption?.Icon && <primaryOption.Icon aria-hidden="true" className="size-3.5" />}
268 + {primaryOption?.Icon && (
269 + <primaryOption.Icon
270 + aria-hidden="true"
271 + className={cn("size-3.5", getOpenInIconClass(primaryOption.kind))}
272 + />
273 + )}
274 <span
275 className={
276 compact
@@ -259,9 +296,9 @@ export const OpenInPicker = memo(function OpenInPicker({
296 </MenuTrigger>
297 <MenuPopup align="end">
298 {options.length === 0 && <MenuItem disabled>No installed editors found</MenuItem>}
262 - {options.map(({ label, Icon, value }) => (
299 + {options.map(({ label, Icon, value, kind }) => (
300 <MenuItem key={value} onClick={() => openInEditor(value)}>
264 - <Icon aria-hidden="true" className="text-muted-foreground" />
301 + <Icon aria-hidden="true" className={getOpenInIconClass(kind)} />
302 {label}
303 {value === preferredEditor && openFavoriteEditorShortcutLabel && (
304 <MenuShortcut>{openFavoriteEditorShortcutLabel}</MenuShortcut>