fix(sidebar): don't crash on a calendar without a color #8

Merged
jmz merged 2 commits from fix/sidebar-empty-color into main 2026-11-18 15:44:53 +00:00
Owner

kal crashed at startup on the mba (2026-11-18) right after vdirsyncer brought in the new "Work (Swissblock)" calendar (the PA's mirror of the Swissblock Google calendar):

MarkupError: auto closing tag ('[/]') has nothing to close    (Static#cal-7, the sidebar row)

engine.calendar_colors() maps a calendar without a vdir color file to "", and the sidebar used self._colors.get(cal, "#c0caf5"), which only falls back for a missing key. The row became "[]●[/]".

  • Fall back with or DEFAULT_COLOR, as views/agenda.py and views/week.py already do.
  • Escape calendar names (textual.markup.escape), so a [ in a name is shown as text instead of being parsed as markup.

Test: tests/test_sidebar_colors.py mounts the sidebar with a colorless "Work (Swissblock)" and an "odd [x] name", checks both render and toggle. Full suite: 368 passed; ruff clean.

Workaround until this is installed: echo '#7aa2f7' > ~/.calendars/work-swissblock/color.

🤖 Generated with Claude Code

kal crashed at startup on the mba (2026-11-18) right after vdirsyncer brought in the new "Work (Swissblock)" calendar (the PA's mirror of the Swissblock Google calendar): ``` MarkupError: auto closing tag ('[/]') has nothing to close (Static#cal-7, the sidebar row) ``` `engine.calendar_colors()` maps a calendar without a vdir `color` file to `""`, and the sidebar used `self._colors.get(cal, "#c0caf5")`, which only falls back for a *missing* key. The row became `"[]●[/]"`. - Fall back with `or DEFAULT_COLOR`, as `views/agenda.py` and `views/week.py` already do. - Escape calendar names (`textual.markup.escape`), so a `[` in a name is shown as text instead of being parsed as markup. Test: `tests/test_sidebar_colors.py` mounts the sidebar with a colorless "Work (Swissblock)" and an "odd [x] name", checks both render and toggle. Full suite: 368 passed; ruff clean. Workaround until this is installed: `echo '#7aa2f7' > ~/.calendars/work-swissblock/color`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(sidebar): don't crash on a calendar without a color
Some checks failed
check / check (push) Has been cancelled
ee5c1af14f
A calendar whose vdir has no `color` file maps to "" in calendar_colors(), and
`.get(cal, default)` only falls back for a missing key, so the row became
"[]●[/]" and kal died at startup with MarkupError ("auto closing tag ('[/]') has
nothing to close"). Hit on 2026-11-18 by the new "Work (Swissblock)" calendar.
Fall back with `or`, like the agenda and week views do, and escape calendar
names so a "[" in a name is text, not markup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ci: run on the homelab CI runner (docker) instead of the rpi5 self-hosted one
All checks were successful
check / check (push) Successful in 1m22s
af988fd97f
The `self-hosted` runner on the rpi5 belongs to the Mirus production stack and
no longer picks up kal jobs: the check for #8 sat "Waiting to run" for over an
hour (last kal run 2026-11-01). The instance-wide runner on spl-vm06 serves
every owner and offers `docker`; the job keeps its own container
(catthehacker/ubuntu:act-latest), and push-only triggering stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jmz merged commit af988fd97f into main 2026-11-18 15:44:53 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/kal!8
No description provided.