Skip to content

feat(desktop): add prevent sleep preference - #1750

Merged
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/prevent-sleep
Jul 25, 2026
Merged

feat(desktop): add prevent sleep preference#1750
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/prevent-sleep

Conversation

@bobleer

@bobleer bobleer commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a persisted app.prevent_sleep preference that defaults to off
  • keep the local computer awake for the full BitFun desktop process lifetime when enabled, independent of agent task activity
  • apply config imports/reloads, keep peer-device control local, and expose the setting under Basics > Power
  • add English, Simplified Chinese, and Traditional Chinese copy plus focused backend/frontend tests

The inhibitor prevents idle system sleep only. Display timeout, explicit sleep, and laptop lid behavior remain governed by the operating system.

Verification

  • cargo check -p bitfun-desktop
  • cargo test -p bitfun-desktop remote_workspace_policy --lib
  • cargo test -p bitfun-desktop sleep_prevention --lib
  • cargo test -p bitfun-core prevent_sleep_defaults_to_disabled --lib
  • pnpm --dir src/web-ui run test:run src/infrastructure/api/service-api/SystemAPI.test.ts src/infrastructure/api/adapters/peer-device-adapter.test.ts
  • pnpm run type-check:web
  • pnpm run i18n:audit

@bobleer
bobleer merged commit e338c2d into GCWing:main Jul 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant