Skip to content

Bug: Export CSV and Export PNG buttons permanently disappear after PNG export failure #1648

Description

@sambhavi0

Current Behavior
After clicking "Export PNG" on the Analytics page and getting the
"Failed to export dashboard as image" error, both the Export CSV
and Export PNG buttons disappear from the page and don't come back
unless the page is manually refreshed. This means a failed PNG
export also breaks CSV export, which was working fine before.

Root Cause
In exportToImage() in Analytics.jsx, the buttons are hidden
before the export attempt so they don't appear in the screenshot:

buttonArea.style.display = "none"

The restore line that shows them again sits inside the try block
after the await:

buttonArea.style.display = "flex"

When the export fails and throws (as it currently does in issue #1342),
the catch block runs and the restore line is never reached, leaving
the buttons permanently hidden.

Expected Behavior
Both buttons should remain visible regardless of whether the PNG
export succeeds or fails.

Proposed Fix
Move the restore line into a finally block so it always runs

Steps to Reproduce

  1. Go to Analytics page
  2. Click "Export PNG"
  3. Alert appears: "Failed to export dashboard as image"
  4. Both Export CSV and Export PNG buttons are gone
  5. Only way to get them back is to refresh the page

Related
#1342 : tracks the underlying PNG export crash

Checklist

  • I am a registered GSSoC 2026 contributor
  • I checked for similar existing issues before creating this

Screenshots

export.png.issue.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions