@devries-cameron20 / t3code Mirror · read-only / commits / bbd9593973
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 22, 14:30 UTC

feat(web): channel artwork choice on Latest, plus nightly or dev art on any channel (#26138)

maria committed Oct 27, 2026 at 21:47 UTC bbd9593973341b6fff4d3c82231cbc6621558db0
8 files changed +108 -62
apps/web/src/components/AppSidebarLayout.tsx
+1 -3
@@ -290,9 +290,7 @@ function SidebarControl() {
290 const { toggleSidebar, isMobile, mobileSheetMounted } = useSidebar();
291 const isSidebarVisible = useSidebarVisibility();
292 const environmentIdentificationMode = useEnvironmentIdentificationMode();
293 - const stageBackdropVariant = useSidebarStageBackdropVariant(
294 - environmentIdentificationMode === "artwork",
295 - );
293 + const stageBackdropVariant = useSidebarStageBackdropVariant(environmentIdentificationMode);
294 const shortcutLabel = shortcutLabelForCommand(keybindings, "sidebar.toggle", {
295 context: { usagePageOpen },
296 });
apps/web/src/components/SidebarStageBackdrop.tsx
+9 -4
@@ -1,4 +1,5 @@
1 import { useAtomValue } from "@effect/atom-react";
2 +import type { EnvironmentIdentificationMode } from "@t3tools/contracts";
3 import { useId } from "react";
4
5 import { APP_STAGE_LABEL } from "../branding";
@@ -12,9 +13,11 @@ const STAGE_BACKDROP_VIEW_BOX = "0 0 8192 96";
13
14 export function resolveSidebarStageBackdropVariant(
15 stageLabel: string,
15 - enabled = true,
16 + mode: EnvironmentIdentificationMode = "artwork",
17 ): SidebarStageBackdropVariant | null {
17 - if (!enabled) return null;
18 + if (mode === "nightly-artwork") return "nightly";
19 + if (mode === "dev-artwork") return "dev";
20 + if (mode !== "artwork") return null;
21 const normalized = stageLabel.trim().toLowerCase();
22 if (normalized === "nightly") return "nightly";
23 if (normalized === "dev") return "dev";
@@ -40,8 +43,10 @@ export function useEnvironmentStageLabel(): string {
43 });
44 }
45
43 -export function useSidebarStageBackdropVariant(enabled = true): SidebarStageBackdropVariant | null {
44 - return resolveSidebarStageBackdropVariant(useEnvironmentStageLabel(), enabled);
46 +export function useSidebarStageBackdropVariant(
47 + mode: EnvironmentIdentificationMode,
48 +): SidebarStageBackdropVariant | null {
49 + return resolveSidebarStageBackdropVariant(useEnvironmentStageLabel(), mode);
50 }
51
52 export function SidebarStageBackdrop({ variant }: { variant: SidebarStageBackdropVariant }) {
apps/web/src/components/chat/ComposerPrimaryActions.tsx
+1 -3
@@ -124,9 +124,7 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
124 }) === "queue";
125 const alternateAction = alternateComposerDispatchAction(followUpBehavior);
126 const isSendDisabled = !canOperateThread || sendDisabledReason !== null;
127 - const stageBackdropVariant = useSidebarStageBackdropVariant(
128 - environmentIdentificationMode === "artwork",
129 - );
127 + const stageBackdropVariant = useSidebarStageBackdropVariant(environmentIdentificationMode);
128
129 const renderStopGenerationButton = (insidePendingAction: boolean) => (
130 <Tooltip key="interrupt">
apps/web/src/components/settings/AppearanceSettingsPanel.tsx
+84 -48
@@ -13,7 +13,8 @@ import {
13 MIN_PANEL_ANIMATION_DURATION_MS,
14 } from "@t3tools/contracts/settings";
15 import {
16 - resolveEnvironmentIdentificationPillLabel,
16 + resolveSidebarStageBackdropVariant,
17 + type SidebarStageBackdropVariant,
18 useEnvironmentStageLabel,
19 } from "../SidebarStageBackdrop";
20 import { useCustomThemes } from "../../hooks/useCustomThemes";
@@ -35,10 +36,40 @@ import { TypographySection } from "./TypographySettings";
36
37 const ENVIRONMENT_IDENTIFICATION_LABELS: Record<EnvironmentIdentificationMode, string> = {
38 artwork: "Artwork",
39 + "nightly-artwork": "Nightly artwork",
40 + "dev-artwork": "Dev artwork",
41 pill: "Version pill",
42 none: "None",
43 };
44
45 +// The default "artwork" follows the running channel, so it is labeled as that channel's art,
46 +// or as "None" on Latest. The other channel's art is offered as a fixed choice.
47 +function environmentIdentificationOptions(
48 + stageVariant: SidebarStageBackdropVariant | null,
49 +): ReadonlyArray<readonly [EnvironmentIdentificationMode, string]> {
50 + if (stageVariant === "dev") {
51 + return [
52 + ["artwork", "Dev artwork"],
53 + ["nightly-artwork", "Nightly artwork"],
54 + ["pill", "Version pill"],
55 + ["none", "None"],
56 + ];
57 + }
58 + if (stageVariant === "nightly") {
59 + return [
60 + ["artwork", "Nightly artwork"],
61 + ["dev-artwork", "Dev artwork"],
62 + ["pill", "Version pill"],
63 + ["none", "None"],
64 + ];
65 + }
66 + return [
67 + ["artwork", "None"],
68 + ["nightly-artwork", "Nightly artwork"],
69 + ["dev-artwork", "Dev artwork"],
70 + ];
71 +}
72 +
73 const CHAT_WIDTH_LABELS: Record<ChatWidth, string> = {
74 comfortable: "Comfortable",
75 wide: "Wide",
@@ -61,8 +92,13 @@ export function AppearanceSettingsPanel() {
92 const settings = useScopedSettings();
93 const updateSettings = useUpdateScopedSettings();
94 const environmentStageLabel = useEnvironmentStageLabel();
64 - const showEnvironmentIdentification =
65 - resolveEnvironmentIdentificationPillLabel(environmentStageLabel) !== null;
95 + const environmentStageVariant = resolveSidebarStageBackdropVariant(environmentStageLabel);
96 + const environmentIdentificationOptionList =
97 + environmentIdentificationOptions(environmentStageVariant);
98 + const environmentIdentificationLabel =
99 + environmentIdentificationOptionList.find(
100 + ([value]) => value === settings.environmentIdentificationMode,
101 + )?.[1] ?? ENVIRONMENT_IDENTIFICATION_LABELS[settings.environmentIdentificationMode];
102 const glassOpacityRatio =
103 (settings.glassOpacity - MIN_GLASS_OPACITY) / (MAX_GLASS_OPACITY - MIN_GLASS_OPACITY);
104 const glassOpacitySliderStyle = {
@@ -316,52 +352,52 @@ export function AppearanceSettingsPanel() {
352 ) : null
353 }
354 />
319 - {showEnvironmentIdentification ? (
320 - <SettingsRow
321 - {...searchableSetting("environment-identification")}
322 - description="Choose how Dev and Nightly environments are identified."
323 - resetAction={
324 - settings.environmentIdentificationMode !==
325 - DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE ? (
326 - <SettingResetButton
327 - label="environment identification"
328 - onClick={() =>
329 - updateSettings({
330 - environmentIdentificationMode: DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE,
331 - })
332 - }
333 - />
334 - ) : null
335 - }
336 - control={
337 - <Select
338 - value={settings.environmentIdentificationMode}
339 - onValueChange={(value) => {
340 - if (value === "artwork" || value === "pill" || value === "none") {
341 - updateSettings({ environmentIdentificationMode: value });
342 - }
343 - }}
355 + <SettingsRow
356 + {...searchableSetting("environment-identification")}
357 + description={
358 + environmentStageVariant
359 + ? "Choose how Dev and Nightly environments are identified."
360 + : "Show Dev or Nightly artwork in the sidebar header."
361 + }
362 + resetAction={
363 + settings.environmentIdentificationMode !== DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE ? (
364 + <SettingResetButton
365 + label="environment identification"
366 + onClick={() =>
367 + updateSettings({
368 + environmentIdentificationMode: DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE,
369 + })
370 + }
371 + />
372 + ) : null
373 + }
374 + control={
375 + <Select
376 + value={settings.environmentIdentificationMode}
377 + onValueChange={(value) => {
378 + const option = environmentIdentificationOptionList.find(
379 + ([optionValue]) => optionValue === value,
380 + );
381 + if (option) updateSettings({ environmentIdentificationMode: option[0] });
382 + }}
383 + >
384 + <SelectTrigger
385 + size="sm"
386 + className="w-full sm:w-40"
387 + aria-label="Environment identification"
388 >
345 - <SelectTrigger
346 - size="sm"
347 - className="w-full sm:w-40"
348 - aria-label="Environment identification"
349 - >
350 - <SelectValue>
351 - {ENVIRONMENT_IDENTIFICATION_LABELS[settings.environmentIdentificationMode]}
352 - </SelectValue>
353 - </SelectTrigger>
354 - <SelectPopup align="end" alignItemWithTrigger={false}>
355 - {Object.entries(ENVIRONMENT_IDENTIFICATION_LABELS).map(([value, label]) => (
356 - <SelectItem hideIndicator key={value} value={value}>
357 - {label}
358 - </SelectItem>
359 - ))}
360 - </SelectPopup>
361 - </Select>
362 - }
363 - />
364 - ) : null}
389 + <SelectValue>{environmentIdentificationLabel}</SelectValue>
390 + </SelectTrigger>
391 + <SelectPopup align="end" alignItemWithTrigger={false}>
392 + {environmentIdentificationOptionList.map(([value, label]) => (
393 + <SelectItem hideIndicator key={value} value={value}>
394 + {label}
395 + </SelectItem>
396 + ))}
397 + </SelectPopup>
398 + </Select>
399 + }
400 + />
401 <SettingsRow
402 {...searchableSetting("composer-context")}
403 description="Keep branch and worktree controls below the composer after a thread starts."
apps/web/src/components/settings/settingsSearch.ts
+1 -1
@@ -330,7 +330,7 @@ export const SETTINGS_SEARCH_ITEMS = [
330 id: "environment-identification",
331 title: "Environment identification",
332 to: "/settings/appearance",
333 - searchTerms: ["dev nightly artwork pill label hide none"],
333 + searchTerms: ["dev nightly latest channel artwork pill label hide none"],
334 targetId: "appearance-interface",
335 },
336 {
apps/web/src/components/sidebar/SidebarChrome.tsx
+1 -1
@@ -40,7 +40,7 @@ export const SidebarChromeHeader = memo(function SidebarChromeHeader({
40 const environmentIdentificationMode = useEnvironmentIdentificationMode();
41 const backdropVariant = resolveSidebarStageBackdropVariant(
42 stageLabel,
43 - environmentIdentificationMode === "artwork",
43 + environmentIdentificationMode,
44 );
45 const pillLabel =
46 environmentIdentificationMode === "pill"
apps/web/src/hooks/useSettings.ts
+2 -1
@@ -390,7 +390,8 @@ export function resolveEnvironmentIdentificationMode(input: {
390 paletteThemeAllowsArtwork?: boolean;
391 }): EnvironmentIdentificationMode {
392 if (!input.settingsHydrated) return "none";
393 - return input.paletteThemeActive && !input.paletteThemeAllowsArtwork && input.mode === "artwork"
393 + const isArtwork = input.mode !== "pill" && input.mode !== "none";
394 + return input.paletteThemeActive && !input.paletteThemeAllowsArtwork && isArtwork
395 ? "pill"
396 : input.mode;
397 }
packages/contracts/src/settings.ts
+9 -1
@@ -153,7 +153,15 @@ export const TerminalFontSize = Schema.Int.check(
153 export type TerminalFontSize = typeof TerminalFontSize.Type;
154 const DEFAULT_TERMINAL_FONT_SIZE: TerminalFontSize = 12;
155
156 -export const EnvironmentIdentificationMode = Schema.Literals(["artwork", "pill", "none"]);
156 +// "artwork" follows the running channel and shows nothing on Latest. The fixed artwork
157 +// modes let any channel opt into a specific channel's art.
158 +export const EnvironmentIdentificationMode = Schema.Literals([
159 + "artwork",
160 + "nightly-artwork",
161 + "dev-artwork",
162 + "pill",
163 + "none",
164 +]);
165 export type EnvironmentIdentificationMode = typeof EnvironmentIdentificationMode.Type;
166 export const DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE: EnvironmentIdentificationMode = "artwork";
167