feat(desktop): keep-computer-awake toggle - #68140
Merged
Merged
Conversation
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.
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.
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
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…ep-awake feat(desktop): keep-computer-awake toggle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ConfigSettingssection-specific extra like the Model block — it is not written toconfig.yaml).powerSaveBlocker('prevent-app-suspension')and its persisted state (userData/keep-awake.json), re-applied onapp.whenReadyso 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.ToggleRowintosettings/primitives.tsx(shared by Notifications + the Advanced keep-awake row).OverlayMaintitlebar top-padding); the one inline memory-provider loader uses a plain min-heightPageLoaderso it's unaffected.Test plan
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.tsxflake is unrelated (passes in isolation).