nationalday: center short lists that don't scroll - #584
Conversation
The article area is a vertical render.Marquee. When the content fits, the marquee doesn't scroll and pins the child at offset 0, so a 1-4 item list sat flush against the title bar with dead space below. Pass align = "center", which the marquee only consults on the non-scrolling path (`cw <= size`). Scrolling output is unchanged: every frame of the 17-item month feed renders pixel-identical at 1x and 2x. Also emit the item spacer only between items rather than after every item. The trailing spacer is measured as part of the column, so centering the child left the text high by SPACER_HEIGHT/2 (a 4px gap asymmetry at 1x). With it gone the gaps above/below are exactly equal. Its only other effect was 4 all-black tail frames on the scroll, which libwebp coalesced anyway; the month loop is now 400ms shorter with identical frames. Verified against the live feed at 1x and 2x: day (2 items) static gaps 4/4 (was 0/8) week (1 item) static gaps 9/10 (was 0/19) month (17) scrolls, 268 frames, pixel-identical before/after Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the version number, adds center alignment to the marquee component, and refactors the spacer logic in displayItem to prevent trailing spacers. There is no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
How did claude do this "Confirmed on real hardware at 1x and 2x." |
|
he did not. I did it this morning on my Dev s3 wide & my s3 I gotta 'coach him up' a little better on comments. he does create webp files for me to review in 1x & 2x - but can't do the rest. caught him putting in a background color in another app that didn't really show up until it got on physical devices. |
Problem
The article area of National Day is a vertical
render.Marquee. When the day's list is short enough to fit (1–4 items, depending on wrapping and 1x vs 2x), the marquee doesn't scroll — and on that path it pins the child atoffset = 0. The result is text flush against the title bar with a block of dead space underneath.Fix
Pass
align = "center"to the marquee. It only consultsAligninside thecw <= sizebranch ofMarquee.Paint, so this is inert whenever the content actually scrolls.Second,
displayItem()appended a spacer after every item, including the last. That trailing spacer is measured as part of the column the marquee centers, soalignalone still left the text high bySPACER_HEIGHT / 2. Emitting the spacer only between items makes the gaps exactly symmetric. Its only other effect was a few all-black tail frames on the scroll, which libwebp coalesced anyway.Verification
Rendered against the live feed on pixlet v0.52.0, at 1x and 2x:
"gaps" = pixel rows of empty space above/below the text block inside the article area.
For the scrolling case I decoded all 268 frames of the month feed at both resolutions and diffed them: every frame is pixel-identical to the pre-change render. The loop is 400 ms shorter (27300 → 26900 ms), which is the four black tail frames the trailing spacer used to contribute.
Confirmed on real hardware at 1x and 2x.
pixlet format/lint/checkall clean. Previews aren't regenerated: they were rendered on a day when the feed was long enough to scroll, and the scrolling path is unchanged, so they remain accurate — regenerating today would just swap in a static 2-item still.🤖 Generated with Claude Code