Skip to content

fix(universalical): skip app when no events today - #984

Merged
tavdog merged 2 commits into
tronbyt:mainfrom
theli-ua:fix/universalical-skip-when-done
Dec 4, 2026
Merged

tavdog merged 2 commits into
tronbyt:mainfrom
theli-ua:fix/universalical-skip-when-done

Conversation

@theli-ua

@theli-ua theli-ua commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

"Skip When Events Are Done" never skips. With no events left today the app still renders DONE FOR THE DAY :-).

The ICS parsing endpoint always returns the next event, even one days away:

{"data":{"name":"New moon 12:52am","detail":{"isToday":false,"isTomorrow":false,"isThisWeek":true,"inProgress":false,"isAllDay":true}}}

So if not event: in main() is effectively dead code — event is only falsy when the calendar has no future events at all. Every other case falls through to build_calendar_frame, where hasEvent is False and get_calendar_bottom renders DONE_TEXT.

Fix

Derive "done for the day" from the event detail instead of the event itself:

detail = event["detail"] if event else None

if skip_when_done and (not detail or not (detail["isToday"] or detail["inProgress"])):
    return []

inProgress is part of the condition so multi-day all-day events stay on screen after they have started (they report isToday: false).

detail is also hoisted into a local, which removes the unguarded event["detail"]["inProgress"] access.

Verification

Rendered against a local mock of the endpoint (pixlet v0.55.1):

payload skip_when_done result
next event days out false renders DONE FOR THE DAY :-) (previous behavior, kept)
next event days out true app skipped (no frame)
event today true renders
in-progress all-day event true renders

pixlet lint and pixlet check pass.

Behavior change worth noting: skip now also applies when Show Expanded Time Window would otherwise preview a future event, per the toggle's wording ("Skip app when events are done for the day").

The ICS API always returns the next event, even one days away, so
`if not event` almost never matched and "Skip When Events Are Done"
never fired. Instead the calendar frame rendered "DONE FOR THE DAY :-)".

Derive the skipped state from the event detail: skip when the next
event is neither today nor in progress. In-progress events stay visible
so multi-day all-day events are not hidden once they have started.
@theli-ua
theli-ua requested a review from tavdog as a code owner December 2, 2026 19:48
@tavdog
tavdog merged commit 1dec0a5 into tronbyt:main Dec 4, 2026
1 check passed
@theli-ua
theli-ua deleted the fix/universalical-skip-when-done branch December 4, 2026 05:49
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.

2 participants