diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 977b32d30..faf1b7bb9 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -195,18 +195,13 @@ import { subscribeBackgroundTerminalWorktreeMountRequests } from './components/terminal/background-terminal-worktree-mount' -// Why: agents alive during a hard kill (crash, forced update install) need a -// reasonably fresh resume record on disk; one minute bounds the lost window -// without measurable per-tick cost (the capture skips unchanged records). +// Why: bound the resume-record loss window on a hard kill to ~1 min; capture skips unchanged records so per-tick cost is negligible. const SLEEPING_AGENT_RESUME_CAPTURE_INTERVAL_MS = 60_000 const isMac = navigator.userAgent.includes('Mac') const isWindows = !isMac && navigator.userAgent.includes('Windows') const shortcutPlatform: NodeJS.Platform = isMac ? 'darwin' : isWindows ? 'win32' : 'linux' -// Why: Windows and Linux both run with the native title bar removed (Windows -// via titleBarStyle: 'hidden', Linux via frame: false), so the renderer draws -// its own logo/menu anchor and min/max/close controls on both. Paired web -// clients run in a browser tab, so they must not render desktop window chrome. +// Why: Windows and Linux remove the native title bar so the renderer draws its own chrome; paired web clients run in a browser tab and must not. const hasCustomTitleBar = shouldRenderDesktopWindowChrome({ platform: shortcutPlatform, isWebClient: isPairedWebClientWindow() @@ -229,9 +224,7 @@ function getKeybindingContext(target: EventTarget | null): KeybindingContext { : 'app' } -// Abstraction over a real KeyboardEvent and a synthetic double-tap gesture so a -// single dispatch path serves both. KeybindingInput-compatible (key/code + -// modifier flags) so it flows straight into keybindingMatchesAction. +// Abstraction over a real KeyboardEvent and a synthetic double-tap gesture so one dispatch path serves both; KeybindingInput-compatible. type ShortcutDispatchInput = { key?: string code?: string @@ -245,16 +238,11 @@ type ShortcutDispatchInput = { preventDefault: () => void } -// Why: Windows ('hidden' titleBarStyle) and Linux (frame: false) both remove -// the native OS title bar, so we render our own minimize/maximize/close -// buttons. These SVG icons match the Fluent/Win11 style: thin 10×10 paths on a -// 40×30 hit area. +// Why: Windows and Linux both remove the native title bar, so we render our own min/max/close buttons (Fluent/Win11-style SVGs). function WindowControls(): React.JSX.Element { const [maximized, setMaximized] = useState(false) useEffect(() => { - // Why: window:maximize-changed only fires on transitions, so a window - // restored to a maximized state at startup would render the wrong icon - // until the user first clicks the button. Seed from main on mount. + // Why: maximize-changed only fires on transitions; seed from main on mount so a startup-maximized window shows the right icon. let cancelled = false void window.api.ui.isMaximized().then((value) => { if (!cancelled) { @@ -302,10 +290,7 @@ function WindowControls(): React.JSX.Element {