Skip to content

feat(desktop): keep-computer-awake toggle - #68140

Merged
OutThisLife merged 6 commits into
mainfrom
bb/desktop-keep-awake
Jul 20, 2026
Merged

feat(desktop): keep-computer-awake toggle#68140
OutThisLife merged 6 commits into
mainfrom
bb/desktop-keep-awake

Conversation

@OutThisLife

@OutThisLife OutThisLife commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a Keep computer awake toggle for long / overnight agent runs, in Settings → Advanced (device-local, rendered as a ConfigSettings section-specific extra like the Model block — it is not written to config.yaml).
  • Authority split mirrors translucency/zoom: the main process owns the one powerSaveBlocker('prevent-app-suspension') and its persisted state (userData/keep-awake.json), re-applied on app.whenReady so a cold launch restores it. The renderer toggles it over IPC (hermes:keep-awake) and keeps a localStorage copy for the checkbox. System stays awake; the display may still dim; Electron auto-releases the blocker on quit.
  • Small DRY: hoisted the duplicated ToggleRow into settings/primitives.tsx (shared by Notifications + the Advanced keep-awake row).
  • Fix: the settings-panel loader now vertically centers in the whole card (it was offset low by the OverlayMain titlebar top-padding); the one inline memory-provider loader uses a plain min-height PageLoader so it's unaffected.
  • i18n across all four locales (en/zh/zh-hant/ja).

Test plan

  • Toggle keep-awake in Settings → Advanced; with it on, the machine doesn't sleep (display may dim); off restores normal sleep.
  • Quit and relaunch with it on — the blocker is restored on boot without opening Settings.
  • Open any Settings tab while it loads — the spinner is vertically centered.
  • npx vitest run --project electron electron/power-save.test.ts && npx vitest run --project ui src/store/keep-awake.test.ts

🤖 Note: pre-existing toolset-config-panel.test.tsx flake is unrelated (passes in isolation).

Add a "keep computer awake" toggle (Claude-style) for long/overnight runs:
the renderer owns the device-local pref and mirrors it to the Electron main
process, which holds a single `powerSaveBlocker('prevent-app-suspension')` —
the same authority split as translucency. Surfaced as a statusbar quick-toggle
and a Settings row.

Introduce a dedicated System settings section (device-local machine prefs) and
de-crowd Appearance by moving Window Translucency + UI Scale into it (both are
main-process/window-owned, not visual theme). Give Haptic Feedback its first
Settings home there too (the titlebar quick-toggle stays). Relocated i18n copy
into `settings.system` across en/zh/zh-hant/ja; wired the `system` route into
the SettingsView union + allowlist + nav.
System + Notifications each had an identical local ToggleRow; lift one
haptic-baked version into primitives and reuse it. Net -12 lines.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) labels Jul 20, 2026
Revert the dedicated System section: Window Translucency + UI Scale move
back to Appearance, and Haptics returns to its titlebar-only home. Keep
computer awake now lives as a device-local toggle at the top of Advanced
(a ConfigSettings section-specific extra, like the Model block), keeping
the statusbar quick-toggle. Relocated i18n back to settings.appearance /
settings.config across all four locales.
The settings OverlayMain has a titlebar-height top pad (no bottom pad), so
the full-panel LoadingState centered in the band beneath it and read low.
Cancel the top pad on the loader so it centers in the whole card; the one
inline (mid-panel) memory loader switches to a plain min-height PageLoader
so it's unaffected.
@OutThisLife OutThisLife changed the title feat(desktop): keep-computer-awake toggle + System settings section feat(desktop): keep-computer-awake toggle Jul 20, 2026
Keep-awake lives only in Settings → Advanced now. Remove the statusbar
quick-toggle (+ its Sun icon, store toggle helper, and keepAwakeOn/Off
strings across locales). Since the statusbar was what eagerly loaded the
store at boot, move persistence to the main process (keep-awake.json,
re-applied on app ready — same pattern as translucency), so a cold launch
restores the blocker without the renderer opening Settings.
# Conflicts:
#	apps/desktop/src/app/settings/config-settings.tsx
@OutThisLife
OutThisLife merged commit 67e73ae into main Jul 20, 2026
47 of 49 checks passed
@OutThisLife
OutThisLife deleted the bb/desktop-keep-awake branch July 20, 2026 19:29
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…ep-awake

feat(desktop): keep-computer-awake toggle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants