Repository navigation
fix(utilities): adaptively format idle inhibitor active duration - #2289
Open
PulkitPradhan wants to merge 2 commits into
Open
PulkitPradhan wants to merge 2 commits into
PulkitPradhan wants to merge 2 commits into
Conversation
PulkitPradhan
force-pushed
the
fix/keep-awake-persistence
branch
from
November 9, 2026 22:27
9555d45 to
3cca0fe
Compare
dxnnv
requested changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RuntimeStatearchitecture (inhibitIdleandinhibitingIdleSince), ensuring the idle inhibitor remains session-scoped by design.• Preserves upstream module naming and IPC APIs (
idleInhibitortarget,isEnabled,enable,disable,toggle).• Retains the active duration indicator bound to
RuntimeState.inhibitingIdleSince.Duration Formatting
Implemented
formatActiveDuration(activeSince: real)inmodules/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, andTr.trCtx).• Bound component compliance with
pragma ComponentBehavior: Bound.Verification
• Build: Built cleanly with
cmake --build build(Ninja).• C++ Formatting:
clang-format --dry-run --Werrorpassed on all C++ files.• QML Formatting:
qmlformatmatched with 0 diff.• Conventions Lint:
python3 scripts/qml-lint-conventions.pychecked 282 files with 0 violations.• Translations Lint:
python3 scripts/trs-check.pychecked 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.