fix: correct font ink offsets and replace 5px native countdown with extra_large text - #6
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrects the mashed v1.3 production render. Two root causes:
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