Repository navigation
feat(desktop): show who made each beta change and what it does - #57886
Merged
Merged
Conversation
3 of 6 tasks
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.
Issue for this PR
N/A. Kit asked for the "What's new in beta" dialog to say who made each change and to show it with a small animated visual, instead of listing commit subjects.
Type of change
What does this PR do?
Each entry in "What's new in beta" now shows its title (the PR title without type and scope), then a small looping animated SVG of what changed, then a quiet line with the author's avatar and name and the PR link. Entries without a visual show a small kind icon in the left gutter instead (a sparkle for new, a check for a fix, a bolt for a speedup). The list scrolls inside a fixed header and footer, and its edges fade as it scrolls.
Where the visuals come from. The PR template gets an optional
### Visualsection with ansvgcode block. AGENTS.md gets a short rule asking user-facingfeat/fix/perfPRs to include one: 240×72, drawn withcurrentColorand opacity, a good still before any animation runs, CSS or SMIL only, at most 8 KB, no scripts or external references.Build.
packages/desktop/scripts/beta-notes.tsreads every listed PR in one GraphQL query per 100 PRs. It takes the author (name or login, plus GitHub's public avatar URL) and the### Visualblock.packages/desktop/scripts/beta-visual.tsparses the block as XML (htmlparser2) and writes it out again from an allowlist of shape, paint, gradient, clip/mask, text and animation elements and attributes. It refuses the visual unless there is exactly one root<svg>. It also refuses a doctype or entity, a CSS escape (so@\69mportoru\72l(can't hide), an@importor another at-rule besides@keyframes/@media, aurl()that isn't#id, and anything over 8 KB. It drops scripts, foreign objects, images, handlers, outsidehrefs and SMIL that animateshref. The build embeds two copies: the animated one and a still made by removing SMIL elements,@keyframesand everyanimation/transitiondeclaration. A sentence or two from the PR body is kept as the visual's alt text, with template filler skipped and long text cut at 240 characters. With no token, or when GitHub errors or is slow, entries keep their git author name and show kind icons, and the build never fails. The token stays in the build script, and only public data reaches the bundle (the beta build step getsGITHUB_TOKEN, and the workflow getspull-requests: read).Runtime. A visual renders only as
<img src="data:image/svg+xml,…">at a fixed 240×72, so it can never run scripts or load anything. An image doesn't inherit the page's colour, so the dialog sets the SVG'scurrentColorto the theme's icon colour. Under reduced motion (the app setting or the system one), the dialog shows the build's still copy, which has no animation rules left that an authored!importantor inline style could keep running. Avatars load lazily and fade in over the author's initial.Unchanged: the dialog is still shown after an update unless release notes are off in Settings, along with "View all on GitHub", "Got it" and how the list picks its entries.
How did you verify your code works?
bun test scripts/beta-notes.test.tsinpackages/desktop(46 pass). The cases cover rebuilding the visual with its namespace and its still, dropping scripts, foreign objects, images, handlers, outside references and SMIL that animates a link, removing important and inline animations from the still, refusing a missing section, a non-svg root, two roots, a doctype,@importplain or CSS-escaped, an escaped or entity-encoded or outsideurl()(in CSS, attributes and animations) and anything over 8 KB, keeping the SVG out of the alt text, template filler, the length cap, one query per batch, and the offline fallbacks.bun test src/updater/beta-notes.test.tsinpackages/gui-extensions(14 pass), including the theme colour and the reduced-motion still.bun typecheckin both packages, andbun run lint:changedagainst the branch base (0 problems).Visual
Screenshots / recordings
The dialog in real time, its visuals looping:
dialog-loop.mp4
Typical update (dark, light):
Entries without a visual show kind icons (left), and under reduced motion the visuals hold their still (right):
Opening, dark:
open-dark.mp4
Opening, light:
open-light.mp4
Checklist