feat(results): export results as image - #573
Draft
Gudsfile wants to merge 1 commit into
Draft
Conversation
|
Add an 'Export as image' action to the results screen so users can save and share a snapshot of their listening stats. The button captures the active results view with html-to-image (toPng) and downloads a timestamped PNG, picking up the current light/dark background for a legible card.
Gudsfile
force-pushed
the
feat/189-export-results-image
branch
from
July 26, 2026 20:14
a202461 to
e4f6fff
Compare
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.
1️⃣ First
🔇 Problem
Closes #189.
There was no way to save or share the results screen. Users who want to show off or keep a snapshot of their listening stats had to resort to manual screenshots, which are inconsistent across devices and lose quality.
🎹 Proposal
Add an "Export as image" action to the results screen. The button captures the currently displayed results view and downloads it as a shareable PNG card.
Capture is handled by
html-to-image(toPng), the maintained, generic option agreed on in the issue discussion. It correctly renders fonts and the D3/Observable Plot SVG charts, and it leaves room to grow toward richer custom share images later.Details:
tracksy-YYYY-MM-DD.png).dark:variants, shared button styling).Capture logic lives in a small, testable
exportElementAsImageutility, kept separate from theExportButtonUI.🎶 Comments
Scope is intentionally kept to a clean first version: a single export of the active results container. The button lives in the results view, so whichever tab is on screen (Simple, Lab, Chat, Query) is what gets exported.
🎤 Test
Automated:
moon run app:format,moon run app:lint,moon run app:typecheck,moon run app:testall pass.exportElementAsImageutility (capture + download, filename format, error propagation) and theExportButtoncomponent (render, click-to-capture, failure state, missing target).html-to-imageis mocked viavi.spyOn.Manual:
moon run app:dev.