From 0808ebc3c52286f5a3a602f82f069ae597f86469 Mon Sep 17 00:00:00 2001 From: David Hill <1879069+iamdavidhill@users.noreply.github.com> Date: Thu, 3 Sep 2026 17:57:32 -0600 Subject: [PATCH] fix(app): refine build indicators in tab navigation (#47112) --- packages/app/src/runtime/i18n/en.ts | 4 + packages/app/src/shell/titlebar/titlebar.tsx | 110 +++++++++---------- 2 files changed, 54 insertions(+), 60 deletions(-) diff --git a/packages/app/src/runtime/i18n/en.ts b/packages/app/src/runtime/i18n/en.ts index ad53263635f..42c823fc382 100644 --- a/packages/app/src/runtime/i18n/en.ts +++ b/packages/app/src/runtime/i18n/en.ts @@ -812,6 +812,10 @@ export const dict = { "titlebar.update": "Update", "titlebar.tabs": "Tabs", + "titlebar.channel.local": "Local", + "titlebar.channel.dev": "Dev", + "titlebar.channel.beta": "Beta", + "titlebar.toggleDebugTools": "Toggle debug tools", "titlebar.updateVersion": "Update {{version}}", "common.closeTab": "Close tab", diff --git a/packages/app/src/shell/titlebar/titlebar.tsx b/packages/app/src/shell/titlebar/titlebar.tsx index 68567bd80ee..e5d7a9b58a5 100644 --- a/packages/app/src/shell/titlebar/titlebar.tsx +++ b/packages/app/src/shell/titlebar/titlebar.tsx @@ -1,6 +1,6 @@ import { createEffect, createMemo, createResource, Match, Show, Switch, untrack } from "solid-js" import { createStore, unwrap } from "solid-js/store" -import { Portal } from "solid-js/web" +import { Dynamic, Portal } from "solid-js/web" import { useLocation, useNavigate } from "@solidjs/router" import { IconButton } from "@opencode-ai/ui/icon-button" import { Icon } from "@opencode-ai/ui/icon" @@ -31,12 +31,15 @@ import { SessionTabAvatar } from "@/shell/layout/session-tab-avatar" import { SessionProgressIndicatorV2 } from "@opencode-ai/session-ui/v2/session-progress-indicator-v2" import { projectForSession } from "@/shell/layout/helpers" import { useSettingsDialog } from "@/settings/command" +import devIcon from "../../../../desktop/icons/dev/64x64.png" +import betaIcon from "../../../../desktop/icons/beta/64x64.png" const titlebarHeight = 36 const windowsTitlebarHeight = 44 // Includes the content inset; matches the native Windows overlay. const minTitlebarZoom = 0.25 const windowsControlsBaseWidth = 138 // 3 native Windows caption buttons at 46px each. -const macTrafficLightsBaseWidth = 84 +// Native controls: 14px left inset, two 20px button pitches, and a 14px button. +const macTrafficLightsBaseWidth = 68 const macTrafficLightsTopClearance = 28 export type TitlebarUpdate = { @@ -431,16 +434,15 @@ export function Titlebar(props: { return (
- - + + @@ -631,23 +633,12 @@ export function Titlebar(props: { >
-
- -
-
+ />
+ {homeButton(true)}
)} @@ -765,45 +753,47 @@ function TitlebarUpdateIconButton(props: { state: TitlebarUpdatePillState }) { ) } -function ChannelIndicator(props: { debugTools?: { visible: boolean; toggle: () => void } }) { +function ChannelIndicator(props: { + horizontal?: boolean + sidebar?: boolean + debugTools?: { visible: boolean; toggle: () => void } +}) { + const language = useLanguage() const platform = usePlatform() - const windows = () => platform.platform === "desktop" && platform.os === "windows" - const classes = () => ({ - "px-2 rounded-sm": windows(), - "inline-flex h-4 shrink-0 items-center leading-4 px-1.5 rounded-full": !windows(), - }) - const style = () => ({ - "font-size": windows() ? undefined : platform.platform === "desktop" && platform.os === "macos" ? "9px" : "10px", - }) const channel = import.meta.env.VITE_OPENCODE_CHANNEL - if (channel === "dev" && props.debugTools) { - return ( - - ) - } + if (!channel || channel === "prod") return null - const label = channel && ["local", "beta", "dev"].includes(channel) ? channel.toUpperCase() : undefined + const label = () => language.t(`titlebar.channel.${channel}`) + const debug = () => (channel === "dev" ? props.debugTools : undefined) return ( - - {(value) => ( -
- {value()} -
- )} -
+ + debug()?.toggle()} + aria-label={debug() ? language.t("titlebar.toggleDebugTools") : undefined} + aria-pressed={debug()?.visible} + > + {debug() + + ) }