Files
CodeNomad/tasks/discussions/DISCUSSION-001-wake-lock-behavior-change-for-macos-sleep-vs-screen-lock.md
Shantur Rathore e708c565ef docs(wake-lock): record wake-lock change workflow
Add the wake-lock SCR, discussion summary, and task artifacts that captured investigation, specification, and implementation handoff for the system-sleep-only behavior change.
2026-04-21 20:59:35 +01:00

4.2 KiB

id, title, status, summarized_by, source
id title status summarized_by source
DISCUSSION-001 Wake lock behavior change for macOS sleep vs screen lock closed business_analyst runtime-transcript

Discussion Summary

Topic

Change wake lock behavior so screen lock/display sleep is allowed while system sleep is still prevented during active work.

Purpose

Capture a workflow-ready summary of a requested product behavior change affecting desktop apps and web, including current behavior, desired behavior, scope, and unresolved platform feasibility.

Repository Truth Relevant To This Discussion

  • Current desktop wake lock behavior is effectively configured as a display wake lock.
  • Electron currently uses prevent-display-sleep.
  • Tauri currently includes display: true in its wake-lock-related configuration.
  • This current setup keeps the screen awake and blocks normal screen lock/display sleep on macOS.

Facts Established

  • The reported problem is specific to current wake lock behavior preventing screen lock on macOS.
  • The user wants wake lock to allow screen lock while still preventing the device from going to sleep.
  • The requested scope was expanded beyond macOS-only behavior.
  • The user explicitly requested coverage for all desktop apps and web.
  • Browser/web platform limitations may affect how fully the requested behavior can be implemented.

Requirements Captured

  • Wake lock must allow the display to sleep or lock normally.
  • Wake lock must prevent only system sleep while work is active.
  • On macOS, the screen should be able to turn off and lock while the machine remains awake enough to continue the task.
  • The change should be researched and then applied, not just discussed.
  • Scope should include all desktop apps and web, subject to technical feasibility.

Constraints

  • The change affects multiple platforms and should not be treated as a macOS-only behavior change.
  • Web support may be constrained by browser capabilities and wake lock API limitations.
  • Platform-specific implementation details may differ between Electron, Tauri, and web.

Non-Goals

  • Keeping the display continuously awake.
  • Preserving the current display-wake behavior on macOS.
  • Defining a macOS-only special case unless later justified.

Decisions Made

  • Preferred product direction: allow display sleep/screen lock while preventing only system sleep during active work.
  • Scope direction confirmed by the user: all desktop apps and web.
  • The discussion should move into tracked workflow work with product and technical input before implementation.

Assumptions

  • “Work is active” refers to periods when the application is performing a task that currently relies on wake lock protection.
  • The intended outcome is continued task execution while the screen is locked or asleep, not continuous visual display.
  • Some platforms may require best-effort behavior rather than identical implementation mechanics.

Open Questions

  • What exact user-facing definition of “work is active” should trigger wake lock behavior across products?
  • What behavior is achievable on web given browser/API support and permission constraints?
  • If a platform cannot prevent only system sleep without also affecting display sleep, what fallback behavior is acceptable?
  • Should platform-specific differences be exposed to users or documented in product behavior notes?

Risks Or Concerns

  • Web may not support the requested behavior fully or consistently across browsers.
  • A platform may not offer a clean “prevent system sleep only” mode, creating inconsistent behavior across products.
  • Changing wake lock semantics could affect long-running task reliability if background execution assumptions are wrong.

Referenced Files Or Areas

  • Electron wake lock implementation using prevent-display-sleep
  • Tauri wake lock / keepawake configuration currently using display: true
  • Cross-platform wake lock behavior for desktop apps
  • Web wake lock behavior and browser capability research areas
  • assigned_to: product_manager
  • why: Create a tracked task and SCR-ready handoff for cross-platform research and specification, then route to business analyst and technical architect for requirements and feasibility clarification before implementation.