Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(ui): restore compact settings and correct sidebar floating layers (#2056)
Call Whiteed03ca74f923
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex c38500698..2abc593ef 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -60,6 +60,7 @@ jobs:npm run test:project-ordernpm run test:inbox-returnnpm run test:badge-triggers+ npm run test:workbench-general -- sidebar-floating.spec.tsshow-router-integration:runs-on: ubuntu-latestdiff --git a/docs/plans/2026-09-19-sidebar-dock-layering.md b/docs/plans/2026-09-19-sidebar-dock-layering.mdnew file mode 100644index 000000000..48722f578--- /dev/null+++ b/docs/plans/2026-09-19-sidebar-dock-layering.md@@ -0,0 +1,30 @@+# Sidebar footer and floating surfaces++## Contract++- Restore the desktop Settings entry to the previous 44px icon-only control,+ with a translated accessible name and tooltip in both open and closed states.+ Apps consumes the remaining row width, including after sidebar resizing.+- The desktop Apps launcher and Dock paint above application windows and the+ route-sized Settings panel, regardless of which surface opened first.+- Activating a Dock tile dismisses Settings through its existing outside-+ interaction behavior; newly opened, focused, or restored windows must receive+ pointer input rather than merely exist in the DOM.+- Version details escape the sidebar stacking context, paint as one opaque+ surface above the launcher, and remain anchored to the version badge.+ Desktop placement follows resizing and stays inside the viewport.+- Preserve the existing mobile version panel placement and touch target.+- Preserve queue behavior, navigation, Dock pinning, version reads, and update+ actions. No backend, dependency, or persistence changes.++## Validation++Use the existing hermetic Workbench browser harness to exercise real Settings,+Dock, and version components together. Assert hit targets at overlapping points,+icon-only Settings width, Apps width, version opacity, and placement after resize.+Run the existing badge browser suite for desktop/mobile interaction, focused shell+unit tests, UI lint, and the production build. The focused sidebar floating-surface+suite also runs in the existing CI browser-interaction job.++The owner's page feedback supersedes the equal-width Apps/Settings footer in+the September 18 Workbench design; all other visual tokens remain unchanged.diff --git a/ui/e2e/workbench-general/sidebar-floating.spec.ts b/ui/e2e/workbench-general/sidebar-floating.spec.tsnew file mode 100644index 000000000..a56275dcf--- /dev/null+++ b/ui/e2e/workbench-general/sidebar-floating.spec.ts@@ -0,0 +1,162 @@+import { expect, test, type Locator } from '@playwright/test';++import { open, serveProduct } from './support';++const VIEWPORT = { width: 1665, height: 1329 };+const SETTINGS = 'aside [data-settings-toggle="true"]';+const LAUNCHER = '[data-show-page-dock-drop-target] > button';+const DOCK = '[data-show-page-dock-drop-target] [role="menu"]';+const OVERLAY = '[data-settings-overlay="true"]';++// Visibility alone passes for covered controls. Ask which surface receives an+// actual hit at the element's center, across independent portal roots.+const receivesPointer = (locator: Locator) => locator.evaluate((element) => {+ const rect = element.getBoundingClientRect();+ return element.contains(document.elementFromPoint(+ rect.x + rect.width / 2, rect.y + rect.height / 2,+ ));+});++for (const lang of ['en', 'zh'] as const) {+ test(`Settings stays icon-only while Apps takes the available width (${lang})`, async ({ page }) => {+ const denied = await serveProduct(page, lang);+ await page.setViewportSize(VIEWPORT);+ await open(page, '/', { lang });+ const settings = page.locator(SETTINGS);+ const apps = page.locator(LAUNCHER);+ const label = lang === 'en' ? 'Settings' : '设置';+ await expect(settings).toHaveAccessibleName(label);+ await expect(settings).toHaveText('');+ await expect(settings).toHaveAttribute('title', label);++ const widths = async () => ({+ settings: (await settings.boundingBox())!.width,+ apps: (await apps.boundingBox())!.width,+ });+ await expect.poll(widths).toEqual({ settings: 44, apps: 163 });+ await settings.click();+ await expect(page.locator(OVERLAY)).toBeVisible();+ await expect(settings).toHaveAccessibleName(label);+ await expect(settings).toHaveText('');+ await expect.poll(widths).toEqual({ settings: 44, apps: 163 });++ await page.locator('aside [role="separator"]').focus();+ await page.keyboard.press('End');+ await expect.poll(widths).toEqual({ settings: 44, apps: 411 });+ await settings.click();+ await expect(page.locator(OVERLAY)).toHaveCount(0);+ expect(denied).toEqual([]);+ });+}++for (const order of ['dock-first', 'settings-first'] as const) {+ test(`Dock remains usable above Settings (${order})`, async ({ page }) => {+ const denied = await serveProduct(page);+ await page.setViewportSize(VIEWPORT);+ await open(page, '/');+ if (order === 'dock-first') await page.locator(LAUNCHER).click();+ await page.locator(SETTINGS).click();+ await expect(page.locator(OVERLAY)).toBeVisible();+ if (order === 'settings-first') await page.locator(LAUNCHER).hover();++ const library = page.locator(DOCK).getByRole('button', { name: 'App Library', exact: true });+ await expect(library).toBeVisible();+ const libraryBox = (await library.boundingBox())!;+ const overlayBox = (await page.locator(OVERLAY).boundingBox())!;+ expect(libraryBox.x + libraryBox.width / 2).toBeGreaterThan(overlayBox.x);+ await expect.poll(() => receivesPointer(library)).toBe(true);+ await page.screenshot({+ path: `e2e/.artifacts/workbench-general/shots/${order}.png`, scale: 'css', animations: 'disabled',+ });+ await library.click();+ await expect(page.locator(OVERLAY)).toHaveCount(0);+ const appWindow = page.locator('[data-window-id][aria-label="App Library"]');+ await expect(appWindow).toBeVisible();+ await expect.poll(() => receivesPointer(appWindow)).toBe(true);+ await appWindow.click({ trial: true });+ expect(denied).toEqual([]);+ });+}++for (const state of ['running', 'minimized'] as const) {+ test(`Dock activation dismisses Settings and reaches an existing ${state} window`, async ({ page }) => {+ const denied = await serveProduct(page);+ await page.setViewportSize(VIEWPORT);+ await open(page, '/');+ await page.locator(LAUNCHER).click();+ const library = page.locator(DOCK).getByRole('button', { name: 'App Library', exact: true });+ await library.click();+ const appWindow = page.locator('[data-window-id][aria-label="App Library"]');+ await expect(appWindow).toBeVisible();+ const windowId = await appWindow.getAttribute('data-window-id');+ if (state === 'minimized') {+ await appWindow.getByRole('button', { name: 'Minimize', exact: true }).click();+ await expect(appWindow).toHaveAttribute('inert');+ }+ await page.locator(SETTINGS).click();+ await expect(page.locator(OVERLAY)).toBeVisible();+ // The existing Settings outside-interaction dismissal must handle focus+ // and restore just as it handles opening a fresh window.+ await library.click();+ await expect(page.locator(OVERLAY)).toHaveCount(0);+ await expect(appWindow).toHaveCount(1);+ await expect(appWindow).toHaveAttribute('data-window-id', windowId!);+ await expect(appWindow).not.toHaveAttribute('inert');+ await expect.poll(() => receivesPointer(appWindow)).toBe(true);+ await appWindow.getByRole('button', { name: 'Close', exact: true }).click();+ await expect(appWindow).toHaveCount(0);+ expect(denied).toEqual([]);+ });+}++for (const theme of ['dark', 'light'] as const) {+ test(`version details paint above the pinned Dock and follow their anchor (${theme})`, async ({ page }) => {+ const denied = await serveProduct(page);+ const revision = 'e9648725eac2abcdef1234567890abcdef12345678';+ await page.route('**/api/version**', (route) => route.fulfill({+ json: { current: '0.0.0.dev0', has_update: false, build: { kind: 'source', revision } },+ }));+ await page.setViewportSize(VIEWPORT);+ await open(page, '/', { theme });+ await page.locator(LAUNCHER).click();+ const badge = page.getByTitle(`Source Revision: ${revision}`, { exact: true });+ await badge.click();+ const popup = page.getByRole('dialog').filter({ hasText: 'Build & Version' });+ await expect(popup).toBeVisible();+ await expect(badge).toHaveAttribute('aria-controls', (await popup.getAttribute('id'))!);+ // Both the line that appeared transparent and the header are above every+ // overlapping element, including the Apps button outside the sidebar.+ for (const text of ['Build & Version', revision, 'Package Version', '0.0.0.dev0']) {+ await expect.poll(() => receivesPointer(popup.getByText(text, { exact: true }))).toBe(true);+ }+ const background = await popup.evaluate((element) => getComputedStyle(element).backgroundColor);+ expect(background).toBe(theme === 'dark' ? 'rgb(17, 17, 28)' : 'rgb(255, 255, 255)');+ await page.screenshot({+ path: `e2e/.artifacts/workbench-general/shots/version-dock-${theme}.png`, scale: 'css', animations: 'disabled',+ });++ // The trigger moves vertically when the viewport shrinks; floating details+ // must follow it without a new click and stay fully inside the viewport.+ await page.setViewportSize({ width: 1024, height: 500 });+ await expect.poll(async () => {+ const detail = (await popup.boundingBox())!;+ const trigger = (await badge.boundingBox())!;+ return Math.round(trigger.y - detail.y - detail.height);+ }).toBe(8);+ const detail = (await popup.boundingBox())!;+ expect(detail.y).toBeGreaterThanOrEqual(12);+ expect(detail.x).toBeGreaterThanOrEqual(12);+ expect(detail.x + detail.width).toBeLessThanOrEqual(1012);++ await page.keyboard.press('Escape');+ await expect(popup).toHaveCount(0);+ await expect(badge).toBeFocused();+ await badge.click();+ await expect(popup).toBeVisible();+ await popup.getByRole('button', { name: 'Refresh Build Information' }).click();+ await expect(popup).toBeVisible();+ await popup.getByRole('button', { name: 'Close', exact: true }).click();+ await expect(popup).toHaveCount(0);+ expect(denied).toEqual([]);+ });+}diff --git a/ui/src/components/AppShell.tsx b/ui/src/components/AppShell.tsxindex ad8174f64..3f44efa18 100644--- a/ui/src/components/AppShell.tsx+++ b/ui/src/components/AppShell.tsx@@ -370,7 +370,7 @@ export const AppShell: React.FC = () => {{isDesktop && <WorkbenchSidebar onOpenSearch={() => setSearchOpen(true)} />}</div>- {/* Bottom cluster (design VDs23): Apps + Settings as two equal buttons,+ {/* Bottom cluster: Apps fills the row beside the compact Settings icon,then version on the left and the live service status on the right.AppsLauncher keeps its layout slot here while its interactive surfacefloats above app windows. */}@@ -386,20 +386,20 @@ export const AppShell: React.FC = () => {else navigate('/');}}title={t('appShell.openControlPanel')}- className="group flex flex-1 items-center justify-center gap-2 rounded-[10px] border border-mint/40 bg-mint/[0.08] text-[13px] font-semibold text-foreground transition-colors"+ aria-label={t('appShell.openControlPanel')}+ className="group flex w-11 shrink-0 items-center justify-center rounded-lg border border-mint/40 bg-mint/[0.08] text-foreground transition-colors">- <Settings className="size-4 shrink-0 text-mint-ink" />- <span className="truncate">{t('appShell.openControlPanel')}</span>+ <Settings className="size-[18px] text-mint-ink" /></button>) : (<Linkdata-settings-toggle="true"to={SETTINGS_LANDING_PATH}title={t('appShell.openControlPanel')}- className="group flex flex-1 items-center justify-center gap-2 rounded-[10px] border border-border-strong bg-foreground/[0.03] text-[13px] text-muted transition-colors hover:bg-foreground/[0.06] hover:text-foreground"+ aria-label={t('appShell.openControlPanel')}+ className="group flex w-11 shrink-0 items-center justify-center rounded-lg border border-border-strong text-foreground transition-colors hover:bg-foreground/[0.04]">- <Settings className="size-4 shrink-0" />- <span className="truncate">{t('appShell.openControlPanel')}</span>+ <Settings className="size-[18px] text-muted group-hover:text-foreground" /></Link>)}</div>diff --git a/ui/src/components/AppsLauncher.tsx b/ui/src/components/AppsLauncher.tsxindex d867ec4d4..06944b9ea 100644--- a/ui/src/components/AppsLauncher.tsx+++ b/ui/src/components/AppsLauncher.tsx@@ -116,7 +116,7 @@ export const AppsLauncher: React.FC = () => {const launcher = (<divref={launcherRef}- className="fixed z-30 hidden md:block"+ className="fixed z-40 hidden md:block"style={{ left: placement.left, bottom: placement.bottom, width: placement.width }}data-show-page-dock-drop-targetonMouseEnter={openHover}@@ -206,7 +206,8 @@ export const AppsLauncher: React.FC = () => {return (<>{/* Keep the sidebar's layout slot, but let this single launcher and its Dock escape the- sidebar stacking context. z-30 is above all app windows (z-20), below dialogs (z-50). */}+ sidebar stacking context. z-40 clears app windows (z-20) and route panels (z-30);+ floating details and modal dialogs keep their own foreground layer (z-50). */}<div ref={slotRef} className="flex-1" style={{ height: placement.height }} />{createPortal(launcher, document.body)}</>diff --git a/ui/src/components/VersionBadge.tsx b/ui/src/components/VersionBadge.tsxindex 936580d32..3b0a13d18 100644--- a/ui/src/components/VersionBadge.tsx+++ b/ui/src/components/VersionBadge.tsx@@ -13,6 +13,8 @@ import {import { cn } from '@/lib/utils';import { setConfigField } from '@/lib/configMutations';import { scheduleUpgradeReload } from '../lib/upgradeReload';+import { useIsDesktop } from '../lib/useIsDesktop';+import { Popover, PopoverContent, PopoverTrigger } from './ui/popover';// Dev / regression builds carry long versions like// `3.0.1.dev33+g1df6865a1.d20260608`. Collapse to the release core@@ -28,6 +30,7 @@ function shortenVersion(value: string, tail = 4): string {export const VersionBadge: React.FC<{ openUpward?: boolean }> = ({ openUpward = false }) => {const { t } = useTranslation();const api = useApi();+ const isDesktop = useIsDesktop();const [versionInfo, setVersionInfo] = React.useState<VersionInfo | null>(null);const [isPopupOpen, setIsPopupOpen] = React.useState(false);const [checking, setChecking] = React.useState(false);@@ -37,6 +40,7 @@ export const VersionBadge: React.FC<{ openUpward?: boolean }> = ({ openUpward =const [autoUpdate, setAutoUpdate] = React.useState<boolean | null>(null);const [savingAutoUpdate, setSavingAutoUpdate] = React.useState(false);const popupRef = React.useRef<HTMLDivElement>(null);+ const popupId = React.useId();React.useEffect(() => {checkVersion();@@ -49,11 +53,11 @@ export const VersionBadge: React.FC<{ openUpward?: boolean }> = ({ openUpward =setIsPopupOpen(false);}};- if (isPopupOpen) {+ if (isPopupOpen && !isDesktop) {document.addEventListener('mousedown', handleClickOutside);}return () => document.removeEventListener('mousedown', handleClickOutside);- }, [isPopupOpen]);+ }, [isPopupOpen, isDesktop]);const loadAutoUpdateSetting = async () => {try {@@ -123,174 +127,186 @@ export const VersionBadge: React.FC<{ openUpward?: boolean }> = ({ openUpward =const badgeTitle = isSourceBuild? `${t('dashboard.sourceRevision')}: ${sourceRevision || t('dashboard.unknownRevision')}${versionInfo?.build?.dirty ? ` (${t('dashboard.dirtySource')})` : ''}`: `v${currentVersion}`;+ // Desktop details belong in the shared floating layer, outside the sidebar.+ // Phones retain their fixed panel below the header.+ const Popup = isDesktop ? PopoverContent : 'div';return (- <div className="relative" ref={popupRef}>- {/* Version Badge trigger */}- <button- type="button"- onClick={() => setIsPopupOpen(!isPopupOpen)}- className={cn(- badgeVariants({ variant: hasUpdate ? 'warning' : 'secondary' }),- interactiveBadgeTriggerClassName,- 'relative rounded-md font-medium tracking-normal hover:brightness-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',- )}- title={badgeTitle}- >- {isSourceBuild ? <GitCommitHorizontal size={12} /> : 'v'}- {displayVersion}- {hasUpdate && (- <span className="absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-background bg-gold animate-pulse" />- )}- </button>-- {/* Popup */}- {isPopupOpen && (- <div- className={clsx(- 'z-50 rounded-lg border border-border bg-popover text-popover-foreground shadow-xl',- // Mobile: full-width fixed below sticky header, with scroll- mobileHeaderPopoverClassName,- // Desktop: anchor to trigger, fixed width- 'md:absolute md:inset-x-auto md:max-h-none md:w-72 md:overflow-visible',- openUpward- ? 'md:bottom-full md:left-0 md:top-auto md:mb-2'- : 'md:left-0 md:top-full md:mt-2'- )}- >- {/* Header */}- <div className="flex items-center justify-between border-b border-border px-4 py-3">- <span className="text-sm font-medium text-foreground">- {t(isSourceBuild ? 'dashboard.buildAndVersion' : 'dashboard.versionAndUpdate')}- </span>- <div className="flex items-center gap-1">- <Button- variant="ghost"- size="icon"- className="h-7 w-7 text-muted hover:text-foreground"- onClick={checkVersion}- disabled={checking || restarting}- aria-label={refreshLabel}- title={refreshLabel}- >- <RefreshCw size={14} className={checking ? 'animate-spin' : ''} />- </Button>- <Button- variant="ghost"- size="icon"- className="h-7 w-7 text-muted hover:text-foreground"- onClick={() => setIsPopupOpen(false)}- aria-label={t('common.close')}- >- <X size={14} />- </Button>- </div>- </div>-- {/* Content */}- <div className="space-y-3 p-4">- {isSourceBuild && (- <div className="flex items-start justify-between gap-3 text-sm">- <span className="shrink-0 text-muted">{t('dashboard.sourceRevision')}</span>- <span className="max-w-[10rem] break-all text-right font-mono font-medium text-foreground">- {sourceRevision || t('dashboard.unknownRevision')}- {versionInfo?.build?.dirty ? ` (${t('dashboard.dirtySource')})` : ''}- </span>- </div>+ <Popover open={isPopupOpen} onOpenChange={setIsPopupOpen}>+ <div className="relative" ref={popupRef}>+ {/* Version Badge trigger */}+ <PopoverTrigger asChild>+ <button+ type="button"+ className={cn(+ badgeVariants({ variant: hasUpdate ? 'warning' : 'secondary' }),+ interactiveBadgeTriggerClassName,+ 'relative rounded-md font-medium tracking-normal hover:brightness-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',)}+ title={badgeTitle}+ aria-controls={popupId}+ >+ {isSourceBuild ? <GitCommitHorizontal size={12} /> : 'v'}+ {displayVersion}+ {hasUpdate && (+ <span className="absolute -top-1 -right-1 size-2.5 rounded-full border-2 border-background bg-gold animate-pulse" />+ )}+ </button>+ </PopoverTrigger>- {/* Current package version */}- <div className="flex items-center justify-between text-sm">- <span className="text-muted">- {t(isSourceBuild ? 'dashboard.packageVersion' : 'dashboard.currentVersion')}+ {/* Popup */}+ {isPopupOpen && (+ <Popup+ id={popupId}+ role="dialog"+ aria-label={t(isSourceBuild ? 'dashboard.buildAndVersion' : 'dashboard.versionAndUpdate')}+ {...(isDesktop ? {+ align: 'start' as const,+ side: openUpward ? 'top' as const : 'bottom' as const,+ sideOffset: 8,+ collisionPadding: 12,+ } : {})}+ className={clsx(+ 'z-50 rounded-lg border border-border bg-popover p-0 text-popover-foreground shadow-xl',+ isDesktop+ ? 'max-h-[var(--radix-popover-content-available-height)] w-72 overflow-y-auto'+ : mobileHeaderPopoverClassName,+ )}+ >+ {/* Header */}+ <div className="flex items-center justify-between border-b border-border px-4 py-3">+ <span className="text-sm font-medium text-foreground">+ {t(isSourceBuild ? 'dashboard.buildAndVersion' : 'dashboard.versionAndUpdate')}</span>- <span className="max-w-[10rem] break-all text-right font-mono font-medium text-foreground">{currentVersion}</span>+ <div className="flex items-center gap-1">+ <Button+ variant="ghost"+ size="icon"+ className="h-7 w-7 text-muted hover:text-foreground"+ onClick={checkVersion}+ disabled={checking || restarting}+ aria-label={refreshLabel}+ title={refreshLabel}+ >+ <RefreshCw size={14} className={checking ? 'animate-spin' : ''} />+ </Button>+ <Button+ variant="ghost"+ size="icon"+ className="h-7 w-7 text-muted hover:text-foreground"+ onClick={() => setIsPopupOpen(false)}+ aria-label={t('common.close')}+ >+ <X size={14} />+ </Button>+ </div></div>- {/* Latest Version */}- {!isSourceBuild && versionInfo?.latest && (- <div className="flex items-center justify-between text-sm">- <span className="text-muted">{t('dashboard.latestVersion')}</span>- <span className="font-mono font-medium text-foreground">{versionInfo.latest}</span>- </div>- )}+ {/* Content */}+ <div className="space-y-3 p-4">+ {isSourceBuild && (+ <div className="flex items-start justify-between gap-3 text-sm">+ <span className="shrink-0 text-muted">{t('dashboard.sourceRevision')}</span>+ <span className="max-w-[10rem] break-all text-right font-mono font-medium text-foreground">+ {sourceRevision || t('dashboard.unknownRevision')}+ {versionInfo?.build?.dirty ? ` (${t('dashboard.dirtySource')})` : ''}+ </span>+ </div>+ )}- {/* Update Status */}- {!isSourceBuild && (hasUpdate ? (- <div className="flex items-center gap-2 rounded-md border border-gold/30 bg-gold/10 px-3 py-2 text-sm text-gold-ink">- <AlertCircle size={16} className="shrink-0" />- <span>- {t('dashboard.updateHint', {- from: currentVersion,- to: versionInfo?.latest,- })}+ {/* Current package version */}+ <div className="flex items-center justify-between text-sm">+ <span className="text-muted">+ {t(isSourceBuild ? 'dashboard.packageVersion' : 'dashboard.currentVersion')}</span>+ <span className="max-w-[10rem] break-all text-right font-mono font-medium text-foreground">{currentVersion}</span></div>- ) : versionInfo && !versionInfo.error ? (- <div className="flex items-center gap-2 rounded-md border border-mint/25 bg-mint/10 px-3 py-2 text-sm text-mint-ink">- <Check size={16} className="shrink-0" />- <span>{t('dashboard.upToDate')}</span>- </div>- ) : versionInfo?.error ? (- <div className="flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-ink">- <AlertCircle size={16} className="shrink-0" />- <span>{t('dashboard.checkFailed')}</span>- </div>- ) : null)}- {/* Upgrade Result */}- {upgradeResult && (- <div- className={clsx(- 'flex items-center gap-2 rounded-md border px-3 py-2 text-sm',- upgradeResult.ok- ? 'border-mint/25 bg-mint/10 text-mint-ink'- : 'border-destructive/30 bg-destructive/10 text-destructive-ink'- )}- >- {upgradeResult.ok ? <Check size={16} className="shrink-0" /> : <AlertCircle size={16} className="shrink-0" />}- <span>- {upgradeResult.ok ? t('dashboard.upgradeSuccess') : t('dashboard.upgradeFailed')}- </span>- </div>- )}+ {/* Latest Version */}+ {!isSourceBuild && versionInfo?.latest && (+ <div className="flex items-center justify-between text-sm">+ <span className="text-muted">{t('dashboard.latestVersion')}</span>+ <span className="font-mono font-medium text-foreground">{versionInfo.latest}</span>+ </div>+ )}- {/* Restarting Status */}- {restarting && (- <div className="flex items-center gap-2 rounded-md border border-cyan/30 bg-cyan/10 px-3 py-2 text-sm text-cyan-ink">- <RefreshCw size={16} className="shrink-0 animate-spin" />- <span>{t('dashboard.restarting')}</span>- </div>- )}+ {/* Update Status */}+ {!isSourceBuild && (hasUpdate ? (+ <div className="flex items-center gap-2 rounded-md border border-gold/30 bg-gold/10 px-3 py-2 text-sm text-gold-ink">+ <AlertCircle size={16} className="shrink-0" />+ <span>+ {t('dashboard.updateHint', {+ from: currentVersion,+ to: versionInfo?.latest,+ })}+ </span>+ </div>+ ) : versionInfo && !versionInfo.error ? (+ <div className="flex items-center gap-2 rounded-md border border-mint/25 bg-mint/10 px-3 py-2 text-sm text-mint-ink">+ <Check size={16} className="shrink-0" />+ <span>{t('dashboard.upToDate')}</span>+ </div>+ ) : versionInfo?.error ? (+ <div className="flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-ink">+ <AlertCircle size={16} className="shrink-0" />+ <span>{t('dashboard.checkFailed')}</span>+ </div>+ ) : null)}- {/* Auto Update Toggle */}- {!isSourceBuild && autoUpdate !== null && (- <div className="flex items-center justify-between gap-3 border-t border-border pt-3">- <div className="min-w-0">- <div className="text-sm text-foreground">{t('dashboard.autoUpdate')}</div>- <div className="text-xs text-muted">{t('dashboard.autoUpdateHint')}</div>+ {/* Upgrade Result */}+ {upgradeResult && (+ <div+ className={clsx(+ 'flex items-center gap-2 rounded-md border px-3 py-2 text-sm',+ upgradeResult.ok+ ? 'border-mint/25 bg-mint/10 text-mint-ink'+ : 'border-destructive/30 bg-destructive/10 text-destructive-ink'+ )}+ >+ {upgradeResult.ok ? <Check size={16} className="shrink-0" /> : <AlertCircle size={16} className="shrink-0" />}+ <span>+ {upgradeResult.ok ? t('dashboard.upgradeSuccess') : t('dashboard.upgradeFailed')}+ </span></div>- <ToggleSwitch- enabled={autoUpdate}- onClick={() => handleAutoUpdateToggle(!autoUpdate)}- disabled={savingAutoUpdate}- />+ )}- </div>- )}- </div>+ {/* Restarting Status */}+ {restarting && (+ <div className="flex items-center gap-2 rounded-md border border-cyan/30 bg-cyan/10 px-3 py-2 text-sm text-cyan-ink">+ <RefreshCw size={16} className="shrink-0 animate-spin" />+ <span>{t('dashboard.restarting')}</span>+ </div>+ )}- {/* Actions */}- {hasUpdate && !restarting && (- <div className="flex justify-end border-t border-border px-4 py-3">- <Button variant="brand" size="xs" onClick={handleUpgrade} disabled={upgrading}>- <Download size={14} className={upgrading ? 'animate-bounce' : ''} />- {upgrading ? t('dashboard.upgrading') : t('dashboard.upgradeNow')}- </Button>+ {/* Auto Update Toggle */}+ {!isSourceBuild && autoUpdate !== null && (+ <div className="flex items-center justify-between gap-3 border-t border-border pt-3">+ <div className="min-w-0">+ <div className="text-sm text-foreground">{t('dashboard.autoUpdate')}</div>+ <div className="text-xs text-muted">{t('dashboard.autoUpdateHint')}</div>+ </div>+ <ToggleSwitch+ enabled={autoUpdate}+ onClick={() => handleAutoUpdateToggle(!autoUpdate)}+ disabled={savingAutoUpdate}+ />++ </div>+ )}</div>- )}- </div>- )}- </div>++ {/* Actions */}+ {hasUpdate && !restarting && (+ <div className="flex justify-end border-t border-border px-4 py-3">+ <Button variant="brand" size="xs" onClick={handleUpgrade} disabled={upgrading}>+ <Download size={14} className={upgrading ? 'animate-bounce' : ''} />+ {upgrading ? t('dashboard.upgrading') : t('dashboard.upgradeNow')}+ </Button>+ </div>+ )}+ </Popup>+ )}+ </div>+ </Popover>);};