Skip to content

feat(selfupdate): render changelog inline in update modal#139

Merged
frahlg merged 1 commit into
masterfrom
137-update-modal-changelog
Apr 20, 2026
Merged

feat(selfupdate): render changelog inline in update modal#139
frahlg merged 1 commit into
masterfrom
137-update-modal-changelog

Conversation

@frahlg

@frahlg frahlg commented Apr 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Fetch the GitHub release body alongside tag + notes URL. Cap at 16 KiB so a runaway changelog can't bloat `/api/version/check`.
  • Render markdown inline in the update modal as a collapsible `
    Details` (default-open) so operators see what's changing before pressing Update.
  • Tiny allowlist markdown renderer (headings, bullets, bold, inline code, links via `safeHref`). Everything else stays escaped plain text.
  • `Open on GitHub ↗` stays as a fallback for the full formatted view.

Why

Operators asked: "I want to read the changelog before I click Update, not after." The old modal only had a tiny link to GitHub — clicking it opens a new tab, which breaks the flow when all you want is a 5-second glance at what's in the release.

Safety

  • Release body is escaped first, then markdown tokens are rewritten. Untrusted content can't inject HTML.
  • Link URLs route through the existing `safeHref` gate, which rejects anything that isn't `http:` / `https:`.
  • Body is capped at 16 KiB with a `…(truncated — see release notes for full changelog)` marker if it overflows.

Test plan

  • `TestCheck_CapturesReleaseBody` — GH response body flows into `Info.ReleaseBody`.
  • `TestCheck_TruncatesHugeReleaseBody` — > 16 KiB body gets truncated with marker.
  • `make test` + `make e2e` — green.
  • Smoke on Pi: next release lands, modal shows the "### Bug Fixes / ### Features" sections rendered as headings + bullets, links clickable.

🤖 Generated with Claude Code

Operators currently see only a small "Release notes ↗" link in the update
modal. Clicking it opens GitHub in a new tab — useful, but friction-full
when you want a quick "what's changing?" before hitting Update.

Fetch the release body from the GitHub Releases API, cap it at 16 KiB so
a runaway changelog can't bloat /api/version/check, and render it inline
in the modal. Markdown is rendered via a small allowlist subset of
GitHub-flavored markdown — headings, bullet lists, bold, inline code,
and links (routed through safeHref so javascript: URLs can't sneak in).
Anything outside the allowlist lands as escaped plain text; the
existing release-notes link is kept for the full formatted view.

The inline block is a collapsible <details> default-open, scrollable if
long, so it doesn't push the primary Update button below the fold on
short viewports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@frahlg
frahlg merged commit 6ee2d3e into master Apr 20, 2026
1 check passed
@frahlg
frahlg deleted the 137-update-modal-changelog branch April 20, 2026 07:23
@frahlg frahlg mentioned this pull request Apr 20, 2026
10 tasks
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