Skip to content

Add Keep Awake duration presets and countdown - #274

Open
ekxs-dev wants to merge 1 commit into
didriksg:mainfrom
ekxs-dev:feat/keep-awake-timer
Open

ekxs-dev wants to merge 1 commit into
didriksg:mainfrom
ekxs-dev:feat/keep-awake-timer

Conversation

@ekxs-dev

@ekxs-dev ekxs-dev commented Nov 13, 2026 •

Copy link
Copy Markdown

What & why

Add session-only Keep Awake timers: Always, 15m, 30m, 1h and 2h. Duration pills appear beneath the switch; the countdown is visible inline and in the collapsed Tools header. Expiration releases the display-sleep assertion and collapses the pills.

Includes English, Simplified Chinese and Traditional Chinese labels, accessible duration/state descriptions, model unit tests and a README update. Updates are published only when the displayed minute changes, rather than every timer tick.

How tested

  • make check passed: strict SwiftLint, XCTest with warnings as errors, x86_64 typecheck and localization key extraction (296 keys, zero allowlisted).
  • Translation completeness passed for zh-Hans and zh-Hant.
  • Built, installed and launched locally with ./dev.sh during implementation.
  • Standalone native rendering probe using production SwiftUI declarations and compiled catalog resources: 72 captures across en/zh-Hans/zh-Hant at the actual 308pt panel width. All duration selections, off states, the 1h59m countdown, and expanded/collapsed headers showed no wrapping, truncation or overlap. Active row height remained 57pt. Captures are included below.
  • Native accessibility checks verified localized Off/Always/countdown descriptions, boolean switch values and hidden pill accessibility elements while off. The final localized Off correction was compiled/rendered in this probe and separately linted after the full gate.
  • Real service probe ran for 62 seconds: 15 → 14 minutes with exactly one publication. Verified policy blocking, duration replacement, cancellation via Always, off/on reset and real IOPM assertion creation/release scoped to the probe process. Expiration was exercised through an injected future date, not a full 15-minute wait.

Limitations: rendering captures cover settled light-mode standalone windows, not live panel animation, mouse interaction or spoken VoiceOver output. Full release packaging was not run.

Checklist

  • Builds locally (./dev.sh, or ./scripts/release.sh v0.0.0-ci for the full release build)
  • Added/updated Crisp/Resources/Localizable.xcstrings for any new user-facing strings
  • Screenshot or short clip for any UI change

Screenshots

Production SwiftUI components rendered in a standalone native probe at 308pt width and 2× backing, using the actual compiled localization catalog. Columns: English, Simplified Chinese, Traditional Chinese. These are settled light-mode captures, not the installed app’s full panel; inactive probe windows render switches gray.

Duration selections and collapsed Tools status

Keep Awake duration states and collapsed Tools headers across three locales

Expanded Tools headers

Status subtitles are hidden while Tools is expanded.

Expanded Tools headers across three locales

This branch has not been deployed

No deployments
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