From c6e32323670faa164165f3b9093871ab056c6d66 Mon Sep 17 00:00:00 2001 From: PabloWiedemann Date: Mon, 16 Nov 2026 14:20:37 -0800 Subject: [PATCH 1/5] feat(sidebar): show the Desktop update in blue at the bottom of the sidebar Move the Desktop app update indicator out of the title bar and into the bottom of the left sidebar, above Desktop Settings. It keeps the same three states (available, downloading, ready) and the same actions: download, then restart to update. While the update downloads, a click opens the Updates tab of Desktop Settings. When the sidebar is collapsed it shows only the icon, with the label as its tooltip and accessible name. The panel already receives the app update state through window.api (getAppUpdateState and onAppUpdateStateChanged), and the download and restart prompts come from the existing useAppUpdatePrompts, so no preload or main process change is needed. The title bar no longer renders the pill, so its icons-only collapse step, which only hid the pill label, is removed too. Build windows have no sidebar, so they no longer show the Desktop update. --- .../src/comfyTitleBar/TitleBarApp.test.ts | 80 +--------- .../src/comfyTitleBar/TitleBarApp.vue | 63 +------- src/renderer/src/panel/AppSidebar.test.ts | 2 + src/renderer/src/panel/AppSidebar.vue | 2 + src/renderer/src/panel/PanelApp.test.ts | 2 + .../src/panel/SidebarDesktopUpdate.test.ts | 151 ++++++++++++++++++ .../src/panel/SidebarDesktopUpdate.vue | 85 ++++++++++ src/renderer/src/panel/uninstallBuild.test.ts | 1 + 8 files changed, 253 insertions(+), 133 deletions(-) create mode 100644 src/renderer/src/panel/SidebarDesktopUpdate.test.ts create mode 100644 src/renderer/src/panel/SidebarDesktopUpdate.vue diff --git a/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts b/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts index 1d1df394d..d64456ff8 100644 --- a/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts +++ b/src/renderer/src/comfyTitleBar/TitleBarApp.test.ts @@ -628,86 +628,12 @@ describe('TitleBarApp', () => { expect(bridgeState.refreshInstanceClicks).toBe(1) }) - it('hides both status pills by default (no update available, no install update)', async () => { + it('leaves the Desktop update to the sidebar and shows no update pill in the title bar', async () => { const { default: TitleBarApp } = await import('./TitleBarApp.vue') const wrapper = mount(TitleBarApp) await flushPromises() - expect(wrapper.find('.title-update-pill.is-app-update').exists()).toBe(false) - expect(wrapper.find('.title-update-pill.is-install-update').exists()).toBe(false) - }) - - it('renders the app-update pill with "Desktop Update" copy when state.kind=available (auto-updates OFF)', async () => { - const { default: TitleBarApp } = await import('./TitleBarApp.vue') - const wrapper = mount(TitleBarApp) - await flushPromises() - bridgeState.appUpdateStateCallbacks.forEach((cb) => - cb({ kind: 'available', version: '2.3.4', autoUpdate: false }) - ) - await flushPromises() - const pill = wrapper.find('.title-update-pill.is-app-update') - expect(pill.exists()).toBe(true) - expect(pill.classes()).not.toContain('is-ready') - expect(pill.text()).toContain('Desktop Update') - expect(pill.attributes('title')).toBe('Desktop Update (v2.3.4)') - expect(pill.attributes('aria-label')).toBe('Desktop Update (v2.3.4)') - }) - - it('renders the app-update pill with "Desktop Update Ready" copy when state.kind=ready (auto-updates OFF)', async () => { - const { default: TitleBarApp } = await import('./TitleBarApp.vue') - const wrapper = mount(TitleBarApp) - await flushPromises() - bridgeState.appUpdateStateCallbacks.forEach((cb) => - cb({ kind: 'ready', version: '2.3.4', autoUpdate: false }) - ) - await flushPromises() - const pill = wrapper.find('.title-update-pill.is-app-update') - expect(pill.exists()).toBe(true) - expect(pill.classes()).toContain('is-ready') - expect(pill.text()).toContain('Desktop Update Ready') - expect(pill.attributes('title')).toBe('Desktop Update Ready (v2.3.4)') - }) - - it('renders the app-update pill with "Desktop Update Ready" copy when state.kind=ready (auto-updates ON)', async () => { - const { default: TitleBarApp } = await import('./TitleBarApp.vue') - const wrapper = mount(TitleBarApp) - await flushPromises() - bridgeState.appUpdateStateCallbacks.forEach((cb) => - cb({ kind: 'ready', version: '2.3.4', autoUpdate: true }) - ) - await flushPromises() - const pill = wrapper.find('.title-update-pill.is-app-update') - expect(pill.exists()).toBe(true) - expect(pill.classes()).toContain('is-ready') - expect(pill.text()).toContain('Desktop Update Ready') - }) - - it('forwards app-update pill clicks through the bridge', async () => { - const { default: TitleBarApp } = await import('./TitleBarApp.vue') - const wrapper = mount(TitleBarApp, { attachTo: document.body }) - await flushPromises() - bridgeState.appUpdateStateCallbacks.forEach((cb) => - cb({ kind: 'available', version: '1.0.0', autoUpdate: false }) - ) - await flushPromises() - await wrapper.find('.title-update-pill.is-app-update').trigger('click') - expect(bridgeState.appUpdatePillClicks).toBe(1) - wrapper.unmount() - }) - - it('hides the app-update pill when state transitions back to kind=null', async () => { - const { default: TitleBarApp } = await import('./TitleBarApp.vue') - const wrapper = mount(TitleBarApp) - await flushPromises() - bridgeState.appUpdateStateCallbacks.forEach((cb) => - cb({ kind: 'ready', version: '2.0.0', autoUpdate: false }) - ) - await flushPromises() - expect(wrapper.find('.title-update-pill.is-app-update').exists()).toBe(true) - bridgeState.appUpdateStateCallbacks.forEach((cb) => - cb({ kind: null, version: null, autoUpdate: true }) - ) - await flushPromises() - expect(wrapper.find('.title-update-pill.is-app-update').exists()).toBe(false) + expect(bridgeState.appUpdateStateCallbacks).toHaveLength(0) + expect(wrapper.find('.title-update-pill').exists()).toBe(false) }) it('renders the downloads tray with no badge in the empty steady state', async () => { diff --git a/src/renderer/src/comfyTitleBar/TitleBarApp.vue b/src/renderer/src/comfyTitleBar/TitleBarApp.vue index 64e0f5448..d8c3846de 100644 --- a/src/renderer/src/comfyTitleBar/TitleBarApp.vue +++ b/src/renderer/src/comfyTitleBar/TitleBarApp.vue @@ -4,19 +4,15 @@ import { useI18n } from 'vue-i18n' import { ArrowDownToLine, Bell, - CloudDownload, House, - Loader2, Menu as MenuIcon, MessageSquarePlus, - RefreshCw, RotateCw, ZoomIn } from '@lucide/vue' import { useTitleBarTooltip } from './useTitleBarTooltip' import { useTitleBarMenus } from './useTitleBarMenus' import { useTitleBarIdentity } from './useTitleBarIdentity' -import { useUpdatePills } from './useUpdatePills' import { useTitleBarHoverGate } from './useTitleBarHoverGate' import { useBetaActivationNotice } from './useBetaActivationNotice' import { useAppLocale, windowApiLocaleSource } from '../lib/useAppLocale' @@ -172,14 +168,6 @@ const showZoomReset = computed( () => zoomLevel.value !== 0 && !isInstallLess.value && !isFirstUseLockdown.value ) -const { - appUpdateState, - appUpdatePillLabel, - appUpdatePillTooltip, - showAppUpdatePill, - handleAppUpdatePill -} = useUpdatePills({ bridge, isInstallLess }) - function handleFeedback(): void { bridge?.clickFeedback() } @@ -231,17 +219,13 @@ const announcementBtnRef = useTemplateRef('announcementBtn') const titleClusterRef = useTemplateRef('titleCluster') const titleTrailingRef = useTemplateRef('titleTrailing') -type CollapseMode = 'full' | 'no-feedback' | 'icons-only' +type CollapseMode = 'full' | 'no-feedback' const collapseMode = ref('full') -const collapsedFeedback = computed( - () => collapseMode.value === 'no-feedback' || collapseMode.value === 'icons-only' -) -const collapsedUpdate = computed(() => collapseMode.value === 'icons-only') +const collapsedFeedback = computed(() => collapseMode.value === 'no-feedback') const MIN_GAP_PX = 16 const RESTORE_BUFFER_PX = 24 let feedbackRestoreCostPx = 0 -let updateRestoreCostPx = 0 let fitObserver: ResizeObserver | undefined let fitRaf: number | null = null let transitionRaf: number | null = null @@ -279,14 +263,10 @@ function scheduleFit(): void { function evaluateFit(): void { const { gap } = measureFit() if (!Number.isFinite(gap)) return - const mode = collapseMode.value - if (mode === 'full') { + if (collapseMode.value === 'full') { if (gap < MIN_GAP_PX) transitionTo('no-feedback') - } else if (mode === 'no-feedback') { - if (gap < MIN_GAP_PX) transitionTo('icons-only') - else if (gap > feedbackRestoreCostPx + RESTORE_BUFFER_PX) transitionTo('full') - } else { - if (gap > updateRestoreCostPx + RESTORE_BUFFER_PX) transitionTo('no-feedback') + } else if (gap > feedbackRestoreCostPx + RESTORE_BUFFER_PX) { + transitionTo('full') } } @@ -305,8 +285,6 @@ function transitionTo(next: CollapseMode): void { const delta = before.trailingWidth - after.trailingWidth if (prev === 'full' && next === 'no-feedback') { feedbackRestoreCostPx = Math.max(feedbackRestoreCostPx, delta) - } else if (prev === 'no-feedback' && next === 'icons-only') { - updateRestoreCostPx = Math.max(updateRestoreCostPx, delta) } } scheduleFit() @@ -316,7 +294,6 @@ function transitionTo(next: CollapseMode): void { function invalidateRestoreCosts(): void { feedbackRestoreCostPx = 0 - updateRestoreCostPx = 0 scheduleFit() } @@ -461,9 +438,7 @@ watch( { immediate: true } ) -watch([locale, installLabel, appUpdatePillLabel, showAppUpdatePill, isFirstUseLockdown], () => - invalidateRestoreCosts() -) +watch([locale, installLabel, isFirstUseLockdown], () => invalidateRestoreCosts()) onUnmounted(() => { unmounted = true @@ -505,8 +480,7 @@ onUnmounted(() => { 'is-fullscreen': isFullscreen, 'is-hover-active': isHoverActive, 'is-consent-lockdown': isConsentLockdown, - 'is-collapsed-feedback': collapsedFeedback, - 'is-collapsed-update': collapsedUpdate + 'is-collapsed-feedback': collapsedFeedback }" :data-collapse-mode="collapseMode" :style="{ @@ -557,29 +531,6 @@ onUnmounted(() => {
-