Skip to content

fix(utilities): adaptively format idle inhibitor active duration - #2289

Open
PulkitPradhan wants to merge 2 commits into
caelestia-dots:mainfrom
PulkitPradhan:fix/keep-awake-persistence
Open

PulkitPradhan wants to merge 2 commits into
caelestia-dots:mainfrom
PulkitPradhan:fix/keep-awake-persistence

Conversation

@PulkitPradhan

@PulkitPradhan PulkitPradhan commented Nov 9, 2026 •

Copy link
Copy Markdown

Summary

Enhances the Keep Awake (idleInhibit) utility card to adaptively format and display the active inhibition duration across minutes, hours, days, and weeks, replacing the static time-of-day clock timestamp.

Design & Architecture

Following maintainer review:
• Retains the transient RuntimeState architecture (inhibitIdle and inhibitingIdleSince), ensuring the idle inhibitor remains session-scoped by design.
• Preserves upstream module naming and IPC APIs (idleInhibitor target, isEnabled, enable, disable, toggle).
• Retains the active duration indicator bound to RuntimeState.inhibitingIdleSince.

Duration Formatting

Implemented formatActiveDuration(activeSince: real) in modules/utilities/cards/IdleInhibit.qml:
• < 1 hour: Active for %n minute(s) (e.g. Active for 35 minutes)
• < 1 day: Active for %n hour(s) (e.g. Active for 5 hours)
• Multiple days: Active for %n day(s), %n hour(s) (e.g. Active for 3 days, 4 hours)
• Weeks: Active for %n week(s), %n day(s) (e.g. Active for 2 weeks, 3 days)
• Safely handles missing/invalid (<= 0) timestamps (Active) and future timestamps (Active for 0 minutes).
• Respects pluralization and translation conventions (Tr.tr, Tr.trN, and Tr.trCtx).
• Bound component compliance with pragma ComponentBehavior: Bound.

Verification

• Build: Built cleanly with cmake --build build (Ninja).
• C++ Formatting: clang-format --dry-run --Werror passed on all C++ files.
• QML Formatting: qmlformat matched with 0 diff.
• Conventions Lint: python3 scripts/qml-lint-conventions.py checked 282 files with 0 violations.
• Translations Lint: python3 scripts/trs-check.py checked 436 files with 0 issues.
• Live Quickshell / Wayland Session: Tested under active Hyprland session verifying formatting across all duration scales, invalid/future timestamps, and transient toggle behavior.

@github-actions github-actions Bot added the fix A bug fix label Nov 9, 2026
@PulkitPradhan
PulkitPradhan force-pushed the fix/keep-awake-persistence branch from 9555d45 to 3cca0fe Compare November 9, 2026 22:27
Comment thread daemons/IdleInhibit.qml Resolved
@PulkitPradhan PulkitPradhan changed the title fix(utilities): persist keep awake preference and activation duration fix(utilities): adaptively format idle inhibitor active duration Nov 9, 2026
@PulkitPradhan
PulkitPradhan requested a review from dxnnv November 9, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants