Skip to content

v4.0.5.r1 - #96

Merged
deepagent-ai merged 2 commits into
mainfrom
dev
Jul 27, 2026
Merged

v4.0.5.r1#96
deepagent-ai merged 2 commits into
mainfrom
dev

Conversation

@deepagent-ai

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

thomas-yanga and others added 2 commits July 26, 2026 20:57
### Issue for this PR

   Closes #

   ### Type of change

   - [ ] Bug fix
   - [x] New feature
   - [ ] Refactor / code improvement
   - [ ] Documentation

   ### What does this PR do?

The desktop app calls `powerSaveBlocker.start("prevent-app-suspension")`
unconditionally at launch, so the system never idle-sleeps while the app
is running,
 and there is no user-facing way to opt out.

This PR adds a "Prevent system sleep" switch under a new Power section
in General settings (desktop only):

- **Main**: the `preventSleep` value is persisted in the settings store.
The default stays enabled (only an explicit `false` opts out), so
existing installs
keep the historical always-on behavior. A `set-prevent-sleep` IPC
handler starts/stops the blocker live and broadcasts the change to all
windows; startup reads
 the stored value instead of always starting the blocker.
- **Preload / renderer / app**: bridges `get/setPreventSleepEnabled`
through the platform context, mirroring the existing `pinchZoom` wiring,
and adds the
 switch to the settings UI.
   - **i18n**: translates the new section and row across all 18 locales.
- The persisted-setting resolution lives in `prevent-sleep.ts`, an
Electron-free module (same split as `close-to-tray.ts`), so the
default-on semantics are
 unit-testable.

   The toggle takes effect immediately; no restart is required.

   ### How did you verify your code works?

- Unit tests for the setting resolution (unset → on, any non-`false`
value → on, explicit `false` → off); all 87 desktop package tests pass.
- Added `test:prevent-sleep-smoke`, a Playwright-driven dynamic test
that launches the real built app, clicks the actual Settings switch, and
asserts against
 macOS `pmset -g assertions`:
     1. default launch registers `NoIdleSleepAssertion`
2. disabling the toggle releases the assertion while the app keeps
running
     3. the disabled state persists across a relaunch (no assertion)
     4. re-enabling registers the assertion again
- Wired the smoke into CI as a new `desktop-smoke (macos)` job in
`test.yml` (kept out of the unit matrix since it needs a window server
and a prior desktop
 build).
   - Typecheck (desktop + app), lint, and i18n parity all pass.

   ### Screenshots / recordings

_Recorded locally during development; can attach a recording of the
toggle flipping `pmset` assertions on/off if helpful._

   ### Checklist

   - [x] I have tested my changes locally
   - [x] I have not included unrelated changes in this PR

---------

Signed-off-by: thomas-yanga <odie_majere@outlook.com>
### Issue for this PR

Closes #

### Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Refactor / code improvement
- [ ] Documentation

### What does this PR do?

Please provide a description of the issue, the changes you made to fix
it, and why they work. It is expected that you understand why your
changes work and if you do not understand why at least say as much so a
maintainer knows how much to value the PR.

**If you paste a large clearly AI generated description here your PR may
be IGNORED or CLOSED!**

### How did you verify your code works?

### Screenshots / recordings

_If this is a UI change, please include a screenshot or recording._

### Checklist

- [ ] I have tested my changes locally
- [ ] I have not included unrelated changes in this PR

_If you do not follow this template your PR will be automatically
rejected._
@deepagent-ai
deepagent-ai merged commit de1ab58 into main Jul 27, 2026
8 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants