Skip to content

Fix hero image wiped on article re-fetch; launch on Explore (#110) - #113

Merged
shellen merged 1 commit into
mainfrom
fix/hero-dedup-and-launch-view
Aug 26, 2026
Merged

Fix hero image wiped on article re-fetch; launch on Explore (#110)#113
shellen merged 1 commit into
mainfrom
fix/hero-dedup-and-launch-view

Conversation

@shellen

@shellen shellen commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Hero image wiped by "Fetch full content"

renderArticle's image dedup pre-seeds the frontmatter thumbnail URL into its seen-set to kill body duplicates — but it walks every <img> in the rendered HTML including the hero itself, so the hero is removed as a duplicate of its own pre-seeded URL (empty .article-hero div left behind). Truncated feed articles usually have no frontmatter image (lead image lives in the body, renders fine); a re-fetch adds the site's og:image to frontmatter, arming the pre-seed — which then deletes both the new hero and the matching body lead image. More content, no image.

Fix: the dedup loop skips images inside .article-hero. The pre-seed then does what it was meant to — remove the body copy, keep the hero. This also fixes heroes never surviving render on any article that had a frontmatter image.

Launch highlights All Items instead of Explore (#110)

init() renders the Explore dashboard but the nav's active class was hardcoded on All Items in the markup and never synced. Moved the default to Explore and re-sync after renderHub().

Testing

  • New tests/e2e/hero-image.spec.ts: hero survives dedup, body duplicate still removed, distinct images untouched, launch nav = Explore. Verified red on old code, green on fix.
  • Diagnosed/reproduced against a sandboxed copy of the real library with Playwright probes (.article-hero div present, img removed — on every article with a frontmatter image).
  • Typecheck, jest (250), and browser e2e suites pass; the 14 e2e-real failures are pre-existing environment issues, identical on unmodified main.

Hold for 0.5.1 early next week — do not merge yet (merging refreshes the public rolling DMG; rollout intentionally deferred so issues can be staffed).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AdXEsWQTadb9qbTQjLkMqn

Two reader fixes for 0.5.1:

- The image dedup pass in renderArticle pre-seeds the hero thumbnail URL
  into its seen-set, then walked every img INCLUDING the hero — deleting
  the hero as a duplicate of itself (and the matching body lead image
  right after). Most visible after "Fetch full content" adds an og:image
  to the frontmatter: the refetched article lost its top image entirely.
  The pass now skips images inside .article-hero. Fixes the re-fetch
  image wipe; heroes render at all again.

- On launch the dashboard (Explore) renders but the sidebar nav kept its
  hardcoded "All Items" highlight. Default the active nav to Explore in
  the markup and re-sync it after init renders the hub. Fixes #110

Both covered by a new Playwright spec (hero-image.spec.ts) verified
red on the old code and green on the fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AdXEsWQTadb9qbTQjLkMqn
@shellen
shellen marked this pull request as ready for review August 26, 2026 19:17
@shellen
shellen merged commit 5279416 into main Aug 26, 2026
6 checks passed
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.

2 participants