Skip to content

Fix export responsiveness during image generation - #145

Merged
jldeen merged 4 commits into
mainfrom
jldeen-fix-social-image-freeze
Aug 18, 2026
Merged

Fix export responsiveness during image generation#145
jldeen merged 4 commits into
mainfrom
jldeen-fix-social-image-freeze

Conversation

@jldeen

@jldeen jldeen commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Centralize PNG export work for wallpapers, Devémon cards, and README banners in a shared async export utility
  • Avoid synchronous SVG data URL encoding for wallpaper exports by rendering from SVG blobs, yielding between heavy stages, and cleaning up canvases/resources
  • Disable action buttons while an export/share operation is in progress so repeated clicks cannot stack multiple captures
  • Add Playwright coverage that verifies the page remains interactive while wallpaper and Devémon card share/download work is in progress

Fixes #127.

Validation

  • npm ci
  • npm run check
  • npm run build
  • npm run test

Browser verification

  • Playwright exercises mocked profile generation, starts wallpaper share/download export work with delayed browser image encoding, and verifies the app can still switch tabs during the operation.
  • Playwright also exercises Devémon card sharing and confirms it does not show the Failed to generate card image. Please try again. alert from the screenshot while keeping the app interactive.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jldeen
jldeen requested a review from Damovisa as a code owner August 17, 2026 23:53
Copilot AI balanced review requested due to automatic review settings August 17, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Centralizes asynchronous image export and improves UI responsiveness during PNG generation.

Changes:

  • Adds shared SVG/DOM-to-PNG export utilities.
  • Refactors wallpaper, card, and banner export/share flows.
  • Adds busy button styling and Playwright responsiveness checks.
Show a summary per file
File Description
tests/export-responsiveness.spec.ts Adds wallpaper responsiveness tests.
src/utils/imageExport.ts Introduces shared export utilities.
src/components/WallpaperGenerator.tsx Adopts shared wallpaper export flow.
src/components/DevemonCard.tsx Centralizes card export and sharing.
src/components/ReadmeBanner.tsx Centralizes banner export and sharing.
src/components/ActionButtonsArea.tsx Adds in-progress action state.
src/components/ui/Button.tsx Supports asynchronous click handlers.
src/components/ui/Button.module.css Styles disabled buttons.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Suppressed comments (1)

src/utils/imageExport.ts:120

  • If canvasToPngBlob rejects, these cleanup assignments are skipped, leaving html2canvas's potentially high-resolution backing store allocated until garbage collection. Use finally so failed card/banner exports release it immediately too.
  const blob = await canvasToPngBlob(canvas);

  canvas.width = 0;
  canvas.height = 0;
  • Files reviewed: 8/8 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment thread src/components/ActionButtonsArea.tsx Outdated
Comment thread src/components/ActionButtonsArea.tsx Outdated
Comment thread tests/export-responsiveness.spec.ts Outdated
Comment thread src/utils/imageExport.ts Outdated
jldeen and others added 3 commits August 17, 2026 17:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ocial-image-freeze

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 17da6765-a3ae-4463-9586-bb1e89db7f48

# Conflicts:
#	src/components/DevemonCard.tsx
#	src/components/ReadmeBanner.tsx
@jldeen
jldeen merged commit 161499f into main Aug 18, 2026
8 of 9 checks passed
@jldeen
jldeen deleted the jldeen-fix-social-image-freeze branch August 18, 2026 01:35
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.

Page becomes unresponsive when generating or copying images for social media

2 participants