From 5a2906a11b4422c4e4f0a5d9955dc2a08ae3266e Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 28 Jun 2026 21:30:14 -0500 Subject: [PATCH] chore(desktop): keep the diff surgical Revert the repo-wide prettier churn the earlier fmt pass pulled into files unrelated to this work; run prettier/eslint scoped to the touched files only. --- apps/desktop/electron/main.cjs | 4 +++- apps/desktop/electron/titlebar-overlay-width.cjs | 4 ++-- .../electron/windows-hermes-resolution.test.cjs | 12 ++++++++++-- apps/desktop/src/app/chat/sidebar/index.tsx | 10 ++++++++-- apps/desktop/src/app/chat/sidebar/project-dialog.tsx | 5 ++++- apps/desktop/src/app/command-center/index.tsx | 11 ++++++++++- .../src/app/session/hooks/use-session-actions.ts | 9 ++------- apps/desktop/src/app/settings/model-settings.tsx | 9 +++------ apps/desktop/src/app/settings/with-active.test.ts | 5 ++++- .../src/components/assistant-ui/clarify-tool.tsx | 6 +----- .../components/assistant-ui/tool-fallback-model.ts | 10 ++++++++-- 11 files changed, 55 insertions(+), 30 deletions(-) diff --git a/apps/desktop/electron/main.cjs b/apps/desktop/electron/main.cjs index 4aa69563dad..c873a4bc915 100644 --- a/apps/desktop/electron/main.cjs +++ b/apps/desktop/electron/main.cjs @@ -2266,7 +2266,9 @@ async function handOffWindowsBootstrapRecovery(reason) { // --repair (full venv recreate) and drove reinstall loops. The venv interpreter // and the bootstrap-complete marker are present earlier and are better signals. const haveRealInstall = - fileExists(venvPython) || fileExists(venvHermes) || fileExists(path.join(updateRoot, '.hermes-bootstrap-complete')) + fileExists(venvPython) || + fileExists(venvHermes) || + fileExists(path.join(updateRoot, '.hermes-bootstrap-complete')) const updaterArgs = haveRealInstall ? ['--update', '--branch', branch] : ['--repair', '--branch', branch] await releaseBackendLockForUpdate(updateRoot) diff --git a/apps/desktop/electron/titlebar-overlay-width.cjs b/apps/desktop/electron/titlebar-overlay-width.cjs index aff350c9c5b..7c1e4ca09f0 100644 --- a/apps/desktop/electron/titlebar-overlay-width.cjs +++ b/apps/desktop/electron/titlebar-overlay-width.cjs @@ -14,9 +14,9 @@ const OVERLAY_FALLBACK_WIDTH = 144 * the Electron overlay (Windows, WSLg, and plain Linux KDE/GNOME), so they all * reserve the fallback width. * - * @param {{ isMac?: boolean }} opts + * @param {{ isWindows?: boolean, isWsl?: boolean, isMac?: boolean }} opts */ -function nativeOverlayWidth({ isMac = false } = {}) { +function nativeOverlayWidth({ isWindows = false, isWsl = false, isMac = false } = {}) { if (isMac) return 0 return OVERLAY_FALLBACK_WIDTH } diff --git a/apps/desktop/electron/windows-hermes-resolution.test.cjs b/apps/desktop/electron/windows-hermes-resolution.test.cjs index 3e0f9db1d1f..ada41ce2905 100644 --- a/apps/desktop/electron/windows-hermes-resolution.test.cjs +++ b/apps/desktop/electron/windows-hermes-resolution.test.cjs @@ -43,13 +43,21 @@ test('findOnPath tries PATHEXT extensions before the bare (empty) name on Window test('Windows bootstrap recovery chooses --update when any real-install signal is present', () => { const source = readMain() assert.match(source, /const haveRealInstall =/, 'recovery must compute haveRealInstall') - assert.match(source, /fileExists\(venvPython\)/, 'recovery must accept the venv interpreter as a real-install signal') + assert.match( + source, + /fileExists\(venvPython\)/, + 'recovery must accept the venv interpreter as a real-install signal' + ) assert.match( source, /\.hermes-bootstrap-complete/, 'recovery must accept the bootstrap-complete marker as a real-install signal' ) - assert.match(source, /updaterArgs = haveRealInstall \? \['--update'/, 'updaterArgs must gate on haveRealInstall') + assert.match( + source, + /updaterArgs = haveRealInstall \? \['--update'/, + 'updaterArgs must gate on haveRealInstall' + ) // The old too-narrow check (only venv\Scripts\hermes.exe) must not return. assert.doesNotMatch( source, diff --git a/apps/desktop/src/app/chat/sidebar/index.tsx b/apps/desktop/src/app/chat/sidebar/index.tsx index c82b5a29a0a..ca38d65908b 100644 --- a/apps/desktop/src/app/chat/sidebar/index.tsx +++ b/apps/desktop/src/app/chat/sidebar/index.tsx @@ -1149,7 +1149,8 @@ export function ChatSidebar({ const showSessionSkeletons = sessionsLoading && sortedSessions.length === 0 - const showSessionSections = showSessionSkeletons || sortedSessions.length > 0 || projectModel.length > 0 + const showSessionSections = + showSessionSkeletons || sortedSessions.length > 0 || projectModel.length > 0 // Each reorderable list reports its OWN new id order; persisting is a direct, // typed write — no id-prefix sniffing to figure out which level moved. @@ -1627,7 +1628,12 @@ function SidebarBlankState({ onNewProject }: { onNewProject: () => void }) {

{s.noSessions}

- diff --git a/apps/desktop/src/app/chat/sidebar/project-dialog.tsx b/apps/desktop/src/app/chat/sidebar/project-dialog.tsx index 5d0fc29dba1..dcd9f067f43 100644 --- a/apps/desktop/src/app/chat/sidebar/project-dialog.tsx +++ b/apps/desktop/src/app/chat/sidebar/project-dialog.tsx @@ -149,7 +149,10 @@ export function ProjectDialog() { return ( - event.preventDefault()}> + event.preventDefault()} + > {title} {mode === 'create' && {p.createDesc}} diff --git a/apps/desktop/src/app/command-center/index.tsx b/apps/desktop/src/app/command-center/index.tsx index 80b0e9690c3..f6f2ed0324a 100644 --- a/apps/desktop/src/app/command-center/index.tsx +++ b/apps/desktop/src/app/command-center/index.tsx @@ -9,7 +9,16 @@ import { getActionStatus, getLogs, getStatus, getUsageAnalytics, restartGateway, import type { ActionStatusResponse, AnalyticsResponse, StatusResponse } from '@/hermes' import { useI18n } from '@/i18n' import { sessionTitle } from '@/lib/chat-runtime' -import { Activity, AlertCircle, BarChart3, Bookmark, BookmarkFilled, Download, MessageCircle, Trash2 } from '@/lib/icons' +import { + Activity, + AlertCircle, + BarChart3, + Bookmark, + BookmarkFilled, + Download, + MessageCircle, + Trash2 +} from '@/lib/icons' import { exportSession } from '@/lib/session-export' import { cn } from '@/lib/utils' import { upsertDesktopActionTask } from '@/store/activity' diff --git a/apps/desktop/src/app/session/hooks/use-session-actions.ts b/apps/desktop/src/app/session/hooks/use-session-actions.ts index 83c98a642e1..0e3af87bdd0 100644 --- a/apps/desktop/src/app/session/hooks/use-session-actions.ts +++ b/apps/desktop/src/app/session/hooks/use-session-actions.ts @@ -685,9 +685,7 @@ export function useSessionActions({ if (warmHit) { const cachedRuntimeId = warmHit.runtimeId const cachedState = warmHit.state - - const stored = - $sessions.get().find(session => sessionMatchesStoredId(session, storedSessionId)) ?? storedForProfile + const stored = $sessions.get().find(session => sessionMatchesStoredId(session, storedSessionId)) ?? storedForProfile const cachedViewState = !cachedState.model && stored?.model != null @@ -754,10 +752,7 @@ export function useSessionActions({ setSelectedStoredSessionId(storedSessionId) selectedStoredSessionIdRef.current = storedSessionId setSessionStartedAt(Date.now()) - - const stored = - $sessions.get().find(session => sessionMatchesStoredId(session, storedSessionId)) ?? storedForProfile - + const stored = $sessions.get().find(session => sessionMatchesStoredId(session, storedSessionId)) ?? storedForProfile applyStoredSessionPreviewRuntimeInfo(stored) if (stored) { diff --git a/apps/desktop/src/app/settings/model-settings.tsx b/apps/desktop/src/app/settings/model-settings.tsx index beb74f5b659..8230519f414 100644 --- a/apps/desktop/src/app/settings/model-settings.tsx +++ b/apps/desktop/src/app/settings/model-settings.tsx @@ -191,7 +191,9 @@ export function ModelSettings({ onMainModelChanged }: ModelSettingsProps) { // MoA reference/aggregator slots must never be the moa virtual provider — // that would create a recursive MoA tree (the backend rejects it on save). // Hide it from the slot selectors so it isn't offered as a dead choice. - const moaSlotProviderOptions = providerOptions.filter(provider => (provider.slug || '').toLowerCase() !== 'moa') + const moaSlotProviderOptions = providerOptions.filter( + provider => (provider.slug || '').toLowerCase() !== 'moa' + ) const selectedProviderRow = useMemo( () => providers.find(provider => provider.slug === selectedProvider), @@ -781,7 +783,6 @@ export function ModelSettings({ onMainModelChanged }: ModelSettingsProps) { ...moa, default_preset: selectedMoaPreset || moa.default_preset } - void saveMoa(next) }} size="sm" @@ -799,14 +800,12 @@ export function ModelSettings({ onMainModelChanged }: ModelSettingsProps) { const presets = { ...moa.presets } delete presets[selectedMoaPreset] const fallback = Object.keys(presets)[0] - const next: MoaConfigResponse = { ...moa, presets, default_preset: moa.default_preset === selectedMoaPreset ? fallback : moa.default_preset, active_preset: moa.active_preset === selectedMoaPreset ? '' : moa.active_preset } - setSelectedMoaPreset(Object.keys(moa.presets).find(name => name !== selectedMoaPreset) || '') void saveMoa(next) }} @@ -825,7 +824,6 @@ export function ModelSettings({ onMainModelChanged }: ModelSettingsProps) { disabled={!newMoaPresetName.trim() || !!moa.presets[newMoaPresetName.trim()] || applying} onClick={() => { const name = newMoaPresetName.trim() - const next: MoaConfigResponse = { ...moa, presets: { @@ -833,7 +831,6 @@ export function ModelSettings({ onMainModelChanged }: ModelSettingsProps) { [name]: { ...currentMoaPreset, reference_models: [...currentMoaPreset.reference_models] } } } - setSelectedMoaPreset(name) setNewMoaPresetName('') void saveMoa(next) diff --git a/apps/desktop/src/app/settings/with-active.test.ts b/apps/desktop/src/app/settings/with-active.test.ts index 0785d1a98e0..6a2ce5703d8 100644 --- a/apps/desktop/src/app/settings/with-active.test.ts +++ b/apps/desktop/src/app/settings/with-active.test.ts @@ -9,7 +9,10 @@ describe('withActive', () => { const curated = ['hermes-4', 'hermes-4-mini'] it('prepends a custom model missing from the curated list', () => { - expect(withActive(curated, 'anthropic/claude-opus-4.7')).toEqual(['anthropic/claude-opus-4.7', ...curated]) + expect(withActive(curated, 'anthropic/claude-opus-4.7')).toEqual([ + 'anthropic/claude-opus-4.7', + ...curated + ]) }) it('leaves the list untouched when the active model is already curated', () => { diff --git a/apps/desktop/src/components/assistant-ui/clarify-tool.tsx b/apps/desktop/src/components/assistant-ui/clarify-tool.tsx index ca932b298a6..d5f5b0de511 100644 --- a/apps/desktop/src/components/assistant-ui/clarify-tool.tsx +++ b/apps/desktop/src/components/assistant-ui/clarify-tool.tsx @@ -280,11 +280,7 @@ function ClarifyToolPending({ args }: ToolCallMessagePartProps) { if (loading) { return ( - + ) diff --git a/apps/desktop/src/components/assistant-ui/tool-fallback-model.ts b/apps/desktop/src/components/assistant-ui/tool-fallback-model.ts index c391b515510..b99527f05c4 100644 --- a/apps/desktop/src/components/assistant-ui/tool-fallback-model.ts +++ b/apps/desktop/src/components/assistant-ui/tool-fallback-model.ts @@ -1540,7 +1540,10 @@ function dynamicTitle( } const failed = - part.isError || result.success === false || result.ok === false || Boolean(firstStringField(result, ['error'])) + part.isError || + result.success === false || + result.ok === false || + Boolean(firstStringField(result, ['error'])) if (failed) { const failAction = translateNow('assistant.tool.actions.failedToOpen') @@ -1553,7 +1556,10 @@ function dynamicTitle( const action = verb(translateNow('assistant.tool.actions.opening'), translateNow('assistant.tool.actions.opened')) - return titledAction(action, translateNow('assistant.tool.titleTemplates.actionTarget', action, hostnameOf(url))) + return titledAction( + action, + translateNow('assistant.tool.titleTemplates.actionTarget', action, hostnameOf(url)) + ) } if (part.toolName === 'web_search') {