Skip to content

feat(export): chart and ERD PNG are drawn from the light SVG by default (#1163) - #1235

Merged
ZhuchkaTriplesix merged 4 commits into
devfrom
feat/1163-png-light
Oct 9, 2026
Merged

ZhuchkaTriplesix merged 4 commits into
devfrom
feat/1163-png-light

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Refs #1163

What was wrong

PNG export was a screenshot of the current theme. With a dark theme the PNG was dark while the SVG was light, so the two did not match, and the default export of an image was dark (#1163's first acceptance item).

Changes

  • svgToPng (core/export/svg_png.dart): renders an SVG document to PNG bytes with flutter_svg's vg.loadPicture on a canvas at a given scale. Versions checked in the lock: flutter_svg 2.3.0, vector_graphics 1.2.3.
  • Chart PNG and ERD PNG: with the light palette (the default) they are drawn from the same SVG the SVG export saves; the ERD keeps its 8192 px cap by choosing the scale. With the current-theme setting they stay screenshots.
  • The chart's SVG builder is shared by the SVG and PNG exports (_chartSvg).
  • Test: an SVG rasterises to a PNG whose size is its size times the scale.

Not in this PR

Not verified locally

Tests were not run locally, per the project rule.

…lt (#1163)

PNG export was a screenshot of the current theme, so with a dark theme the PNG
was dark even though the SVG was light. With the light palette, the PNG is now
rasterised from the same SVG document the SVG export saves (flutter_svg's
PictureInfo on a canvas, at the same scale the ERD already capped at 8192 px).
With the current-theme setting, PNG stays a screenshot, as before. The chart's
SVG builder is shared by the SVG and PNG exports.
@github-actions github-actions Bot added enhancement New feature or request ui User interface components and widgets P3 Low priority / Polish & Enhancements labels Oct 9, 2026
The export reads its setting from the local database first; opening it in a
fresh test process can take longer than the 2 s the chart tests waited.
…ase (#1163)

The export reads its setting from the local database; in CI several test
processes share that database, so the chart export tests waited on a read that
sometimes stalled. A test seam answers the setting in the chart tests; the
application still reads the database.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 2097e77 into dev Oct 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request P3 Low priority / Polish & Enhancements ui User interface components and widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant