From 9f02eea1d28440b54dc1956afc16cf3acc05ae42 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 28 Jun 2026 21:04:43 -0500 Subject: [PATCH] style(desktop): prettier + eslint pass Repo-wide `npm run fmt` + `eslint --fix`; also drop two unused destructured params in titlebar-overlay-width.cjs so the lint run is clean. --- apps/desktop/electron/main.cjs | 4 +- .../electron/titlebar-overlay-width.cjs | 4 +- .../windows-hermes-resolution.test.cjs | 12 +----- apps/desktop/src/app/chat/sidebar/index.tsx | 10 +---- .../src/app/chat/sidebar/project-dialog.tsx | 5 +-- apps/desktop/src/app/cron/index.tsx | 1 - apps/desktop/src/app/overlays/panel.tsx | 40 +++++++++++++------ apps/desktop/src/app/profiles/index.tsx | 16 ++++++-- .../app/session/hooks/use-session-actions.ts | 9 ++++- .../src/app/settings/model-settings.tsx | 9 +++-- .../src/app/settings/with-active.test.ts | 5 +-- .../app/shell/hooks/use-statusbar-items.tsx | 1 + .../components/assistant-ui/clarify-tool.tsx | 6 ++- .../assistant-ui/tool-fallback-model.ts | 10 +---- apps/desktop/src/i18n/zh-hant.ts | 3 +- apps/desktop/src/i18n/zh.ts | 3 +- 16 files changed, 74 insertions(+), 64 deletions(-) diff --git a/apps/desktop/electron/main.cjs b/apps/desktop/electron/main.cjs index c873a4bc915..4aa69563dad 100644 --- a/apps/desktop/electron/main.cjs +++ b/apps/desktop/electron/main.cjs @@ -2266,9 +2266,7 @@ 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 7c1e4ca09f0..aff350c9c5b 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 {{ isWindows?: boolean, isWsl?: boolean, isMac?: boolean }} opts + * @param {{ isMac?: boolean }} opts */ -function nativeOverlayWidth({ isWindows = false, isWsl = false, isMac = false } = {}) { +function nativeOverlayWidth({ 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 ada41ce2905..3e0f9db1d1f 100644 --- a/apps/desktop/electron/windows-hermes-resolution.test.cjs +++ b/apps/desktop/electron/windows-hermes-resolution.test.cjs @@ -43,21 +43,13 @@ 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 ca38d65908b..c82b5a29a0a 100644 --- a/apps/desktop/src/app/chat/sidebar/index.tsx +++ b/apps/desktop/src/app/chat/sidebar/index.tsx @@ -1149,8 +1149,7 @@ 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. @@ -1628,12 +1627,7 @@ 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 dcd9f067f43..5d0fc29dba1 100644 --- a/apps/desktop/src/app/chat/sidebar/project-dialog.tsx +++ b/apps/desktop/src/app/chat/sidebar/project-dialog.tsx @@ -149,10 +149,7 @@ export function ProjectDialog() { return ( - event.preventDefault()} - > + event.preventDefault()}> {title} {mode === 'create' && {p.createDesc}} diff --git a/apps/desktop/src/app/cron/index.tsx b/apps/desktop/src/app/cron/index.tsx index 6a0033bc3e3..eb298bde175 100644 --- a/apps/desktop/src/app/cron/index.tsx +++ b/apps/desktop/src/app/cron/index.tsx @@ -596,7 +596,6 @@ function CronJobDetail({ ) } - function formatRunTime(seconds?: null | number): string { if (!seconds) { return '—' diff --git a/apps/desktop/src/app/overlays/panel.tsx b/apps/desktop/src/app/overlays/panel.tsx index 09419512b39..d03ed675d60 100644 --- a/apps/desktop/src/app/overlays/panel.tsx +++ b/apps/desktop/src/app/overlays/panel.tsx @@ -2,12 +2,7 @@ import type { ReactNode } from 'react' import { Button } from '@/components/ui/button' import { Codicon } from '@/components/ui/codicon' -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger -} from '@/components/ui/dropdown-menu' +import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu' import { SearchField } from '@/components/ui/search-field' import { translateNow } from '@/i18n' import { cn } from '@/lib/utils' @@ -146,7 +141,17 @@ interface PanelListRowProps { // A row is a container (not a {meta ? {meta} : null} @@ -321,7 +327,15 @@ export function PanelPill({ children, tone = 'muted' }: { children: ReactNode; t // Self-describing centered "+" that sits as the LAST item in a PanelList. The // label rides aria/title only — no visible text. -export function PanelAddButton({ icon = 'add', label, onClick }: { icon?: string; label: string; onClick: () => void }) { +export function PanelAddButton({ + icon = 'add', + label, + onClick +}: { + icon?: string + label: string + onClick: () => void +}) { return (