Skip to content

PostCard: media-kind placeholder label in the reserved thumb box - #207

Merged
tannevaled merged 1 commit into
mainfrom
feat/postcard-thumb-placeholder
Aug 15, 2026
Merged

PostCard: media-kind placeholder label in the reserved thumb box#207
tannevaled merged 1 commit into
mainfrom
feat/postcard-thumb-placeholder

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

What

PostCard reserved its thumbnail column only once a decoded image was present. A card whose post declares media but whose image has not yet landed drew a blank SurfaceAlt box. The reader's historical feed card drew the media kind (image/video) centred in that box while loading — so the toolkit migration read as "thumbnails not loading".

Change

  • New field ThumbPlaceholder string (e.g. "image", "video").
  • A non-empty placeholder reserves the thumbnail column even while Thumbnail is nil, so the card does not reflow (grow a column) when the image finally lands.
  • postThumb draws the label centred in dim ink on the muted ground when no image is present, reproducing the old loading card.
  • Column geometry now keys off reservesThumb() (image or placeholder) instead of hasThumb() (image only).
  • The label is skipped when it has no font or would not fit the box.

Tests / gates

  • New tests cover: placeholder reserves the column + no reflow when the image lands; label drawn in dim ink; and the three no-op branches (no font, too wide, too tall).
  • 100% statement coverage on the package; gofmt clean; go vet clean.

🤖 Generated with Claude Code

…humb box

PostCard reserved its thumbnail column only for a decoded image; a card whose
post declared media but whose image had not yet landed drew a blank SurfaceAlt
box. The historical feed card drew the media kind ("image"/"video") centred in
that box while loading, so the migration to PostCard read as "thumbnails not
loading".

Add ThumbPlaceholder: a non-empty value reserves the thumbnail column even while
Thumbnail is nil (so the card does not reflow when the image arrives) and draws
the label centred in dim ink on the muted ground, reproducing the old loading
card. Column geometry now keys off reservesThumb (image OR placeholder) rather
than hasThumb (image only). The label is skipped when it has no font or would
not fit the box.

100% statement coverage; gofmt clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 3cc1ee9 into main Aug 15, 2026
1 check passed
@tannevaled
tannevaled deleted the feat/postcard-thumb-placeholder branch August 15, 2026 20:20
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