Skip to content

fix: correct font ink offsets and replace 5px native countdown with extra_large text - #6

Merged
sumitake merged 2 commits into
mainfrom
dev/claude/display-v1.3.1
Aug 4, 2026
Merged

fix: correct font ink offsets and replace 5px native countdown with extra_large text#6
sumitake merged 2 commits into
mainfrom
dev/claude/display-v1.3.1

Conversation

@sumitake

@sumitake sumitake commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Corrects the mashed v1.3 production render. Two root causes:

  1. Firmware fonts draw ink ~2px below the element's y — the layout ignored this, so the title collided with the progress track and ENDS clipped at the panel bottom. All positions now target measured ink rows (title UPPERCASE at y=-2 → rows 0-4; numerals at y=4 → rows 6-15; ENDS at y=6 → rows 8-14), cross-checked against firmware font_registry.c.
  2. The native countdown element renders 5px digits in every mode — the earlier 10px figure came from a contaminated measurement (element-id reuse across a type change silently 400'd and measured stale text). Countdown is now an extra_large 10px TEXT element, minute-granular (54m / 1h05m / 12h at ≥10h with width guard), keeping the operator's numerals-first requirement.

New verification gate: programmatic ink-overlap check from captured frames, all four states, descender-heavy title — all PASS.

Tests: 71 passed (was 63).

🤖 Generated with Claude Code

Live production render came out mashed. Root cause 1: every font
renders its ink ~2px below the element's y (uniform across small/
extra_large/bold), so the title collided with the drain track and
"ends" clipped at the panel's bottom edge. Root cause 2: the native
countdown element's digits render only 5px tall in both MM:SS and
H:MM:SS modes -- the "10px" figure in the v1.3 spec was a stale
controller measurement corrupted by the firmware's id-reuse-type-
change quirk. Large numerals are the operator's core requirement,
so the native countdown is unusable regardless of the offset fix.

Corrections: title/time/ends y values offset-corrected so ink lands
where the geometry implies (cross-checked against the firmware's own
font_registry.c pixel heights: small=5px, extra_large=10px bold,
bold=7px -- matches the measured ink-row heights exactly); title
rendered uppercase (kills descenders, the proximate cause of the
title/track collision); native countdown element replaced with a
plain text element ("cd_text", extra_large font) re-rendered each
poll via a new _format_countdown() helper (minutes-granular, floors
to whole minutes, switches to an hour-only form at 10+ hours to avoid
overflowing the card); align="top_right" removed entirely (screen-
relative, not card-relative, implicated in the mash) in favor of a
fixed x within the card. Renamed the element id from "countdown" to
"cd_text" since its type changes (countdown -> text) -- the same
id-reuse-type-change quirk that corrupted the original measurement.

Also documents a corroborating firmware finding: track_fill (rectangle,
same id across every state) showed a stale-gradient-stop artifact when
its fill shape changed (2-color gradient_h -> 1-color solid) without a
clear in between. The existing transition-state clear (from the prior
review round) already fires at exactly that boundary, so no additional
code change was needed -- confirmed by reproducing the artifact with a
raw sequential draw and confirming it disappears once a clear is
inserted, matching production behavior.
Amends the v1.3 "Color Horizon" spec entry in place (status note
pointing to this correction) rather than adding a parallel v1.3.1
section, since it describes the same feature landing correctly this
time: corrected element table/geometry, ink-offset table, the
_format_countdown width-fit rule, and a new subsection walking
through the two root causes and the fixes, plus the corroborating
track_fill partial-upsert finding. Calendar README's display
description updated to describe the uppercase title and the
re-rendered (not native-ticking) countdown text format.
@sumitake
sumitake merged commit b542160 into main Aug 4, 2026
2 checks passed
@sumitake
sumitake deleted the dev/claude/display-v1.3.1 branch August 4, 2026 01:48
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.

1 participant