Repository navigation
Fix the lock message end time, 24:00 ranges, and Wayland resolution detection - #4
Conversation
…etection. The configure lock error printed a blank end time for HH:MM values. A range ending at 24 read as 12:00 PM and was dropped from the next-unrestricted-time search. WAYLAND_DISPLAY alone did not select Wayland resolution detection. The runtime restriction, lock, cap, and popup-lifetime checks are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Sorry @kgrizz-git, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 3 days and 4 hours by commenting |
|
Reviewer's GuideThe PR fixes user-facing restriction end-time formatting, adds end-of-day range support through interval construction and next-unrestricted searches, corrects midnight display semantics, and repairs Wayland detection precedence, with focused regression tests and documentation updates. Sequence diagram for restriction end-time formattingsequenceDiagram
participant LockMessage as show_config_locked_error
participant EndTime as calculate_restriction_end_time
participant Shared as _restriction_end_info
participant Formatter as format_endpoint_12h
participant Parser as range_endpoint_to_day_minutes
LockMessage->>EndTime: calculate_restriction_end_time()
EndTime->>Shared: _restriction_end_info(range, current_day)
Shared->>Formatter: format_endpoint_12h(end_part)
Shared->>Parser: range_endpoint_to_day_minutes(end_part, end)
Parser-->>Shared: endpoint minutes
Formatter-->>Shared: 5:30 AM or 12:00 AM
Shared-->>EndTime: end time, day, next-day flag
EndTime-->>LockMessage: formatted lock end information
Flow diagram for 24:00 restricted-range handlingflowchart LR
Range["16-24 or 16:00-24:00"] --> Parse[range_endpoint_to_day_minutes with end role]
Parse --> Interval[build_weekly_restricted_intervals]
Interval --> Search[get_next_unrestricted_time]
Search --> Boundary["24:00 becomes week-boundary interval end"]
Boundary --> Sunday["Search continues at Sunday 00:00"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|



Stacked on #3. It needs that PR's tests, so the base is its branch. GitHub retargets it to
mainwhen #3 merges.Summary
The tests in #3 found three bugs. This PR fixes them and one more of the same kind. None of them is a safety invariant, and no restriction, lock, cap, or popup-lifetime check changes. The runtime restricted-time test already handled
16:00-24:00correctly.configure.shprintedLock ends: todayforHH:MMconfigs.calculate_restriction_end_timeandshow_config_locked_errorpassed05:00toformat_hour_12h, which takes a bare hour. They now share a newformat_endpoint_12h, so the message readsLock ends: 5:30 AM today. One_restriction_end_infohelper replaces three copy-pasted blocks.build_weekly_restricted_intervalsdropped a range likeTUESDAY=16-24, so the popup's next-unrestricted time treated that evening as free.range_endpoint_to_day_minutesnow takes an optionalendrole that accepts 24 and 24:00, as the 16-hour cap code already does. A start of 24 stays invalid. A range that ends at the Saturday week boundary now continues into Sunday in the search.status.sh. All three now print 12:00 AM, and the lock message says it ends on the next day.get_display_resolutionhadA || B && C, which Bash reads as(A || B) && C.WAYLAND_DISPLAYalone never selected Wayland detection. It does now.Tests
test-time-calculations.sh, 2 in the resolution test, and 10 of 14 in the newtest-config-locked-message.sh. They pass with the fixes.test-config-locked-message.shdrives the realshow_config_locked_errorwith a stubbed clock and checks the text a user sees.Checks
./scripts/run-tests.sh --tier a: 55 run, 3 skipped on macOS, and the same on Ubuntu 24.04 (arm64 container, non-root)./scripts/check-quality.sh,./scripts/run-security-scan.sh --ci,check-doc-drift.sh --strictopencode-go/muse-spark-1.3-contributor. It found nothing to change and agreed that no restriction or lock check is weakened.lib/time-calculations-append.txtis a tracked leftover that holds an old copy of the buggy function. Nothing references it, and I left it alone.🤖 Generated with Claude Code
Summary by Sourcery
Correct restriction end-time handling, midnight formatting, and Wayland resolution detection while expanding regression coverage.
Bug Fixes:
Enhancements:
Tests:
Chores: