Skip to content

christmas-countdown: "MERRY CHRISTMAS" overflows 64-wide panels on Dec 25 — the day-of branch skips the existing XMAS fit-check #450

Description

@ChuckBuilds

Summary

On Christmas Day itself, christmas-countdown renders MERRY / CHRISTMAS and the word CHRISTMAS runs 3px past the right edge on 64-wide panels. The countdown path already has a fit-check that shortens CHRISTMAS to XMAS on narrow displays; the Christmas-day path skips it and hardcodes the long word.

The bug is invisible for 364 days a year.

Reproduction

Plugin v1.0.3, LEDMatrix v3.3.0-4-g0730d952:

cd ~/LEDMatrix
python3 scripts/check_plugin.py -p christmas-countdown -d ~/LEDMatrix/plugin-repos \
  --golden-dir /tmp/nogolden -c '{"enabled": true}' --freeze-time "2026-12-25 08:00:00"
[FAIL]   64x32  christmas-countdown overflow bbox=(64, 16, 67, 22)
[FAIL]   64x64  christmas-countdown overflow bbox=(64, 32, 67, 38)
[PASS]  128x32 / 96x48 / 128x64 / 256x32 / 128x96 / 256x128

Frozen-time sweep — the window is exactly Dec 25

frozen date result
2026-11-01 pass (all 8 sizes)
2026-12-20 pass
2026-12-24 pass
2026-12-25 00:01 FAIL 64x32, 64x64
2026-12-25 08:00 FAIL 64x32, 64x64
2026-12-25 23:59 FAIL 64x32, 64x64
2026-12-26 pass
2026-01-01 pass

Cause

manager.py:439-455 computes a fit-check for the countdown message:

christmas_width = self.display_manager.get_text_width("CHRISTMAS", self.display_manager.extra_small_font)
use_xmas = christmas_width > available_text_width

where available_text_width = (width - width // 2) - 4 — i.e. the right half minus a margin, 28px on a 64-wide panel.

But manager.py:489-491 ignores use_xmas entirely on the day:

if self.is_christmas or self.days_until_christmas == 0:
    # "MERRY CHRISTMAS" - split into two lines
    lines = ["MERRY", "CHRISTMAS"]

The countdown branch a few lines below correctly picks "XMAS" when use_xmas is set. So the plugin already knows CHRISTMAS doesn't fit at this width — it just doesn't consult that on the one day it renders the word unconditionally.

Suggested fix

Reuse the existing flag:

if self.is_christmas or self.days_until_christmas == 0:
    lines = ["MERRY", "XMAS" if use_xmas else "CHRISTMAS"]

A golden for the Dec 25 state (--freeze-time) would keep it from regressing — the plugin has test/golden/ but nothing pinned to the day-of branch, which is why this survived.


Found while installing and validating every catalogued plugin on a 256x64 rig.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions