Skip to content

feat(session): sleep once existing holds finish - #103

Draft
scttbnsn wants to merge 2 commits into
dev/m2from
feat/leaving-mode
Draft

scttbnsn wants to merge 2 commits into
dev/m2from
feat/leaving-mode

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Add a one-shot Sleep when holds finish menu action and dilated leaving [--cancel] [--json]. Existing holds and renewals continue. Once the last hold ends, a five-second grace period precedes one system sleep request. New holds, Stop, cancel, quit and system sleep clear the request; relaunch never restores it.

Use the existing public sleep API after assertions and closed-lid cleanup. The existing system-sleep notification clears Leaving even when Stop on system sleep is disabled, so closed-lid cleanup cannot leave a second request waiting after wake. Failed requests report an error and stop retrying.

Validation passed: 686 direct Swift tests, 637 MAS Swift tests, 105 release tests, 16 MAS bundle checks, 43 website tests, strict formatting and local Qlty. Fake power and sleep backends cover grace, cancellation, failure, shutdown and a closed-lid cleanup sleep. No actual shared-Mac sleep was performed or claimed. Keep this draft pending the existing real-sleep acceptance gate and normal reviews.

The manual-fixture isolation commit is reused from #101.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.00000% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
Sources/DilatedCLI/DilatedCommand.swift 0.00% 5 Missing ⚠️
Sources/DilatedUI/AppModel.swift 90.00% 5 Missing ⚠️
Sources/DilatedCore/ClosedLidPower.swift 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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