Skip to content

feat(export): light palette by default for chart and ERD SVG, setting for the current theme (#1163) - #1226

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
feat/1163-export-theme
Oct 9, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
feat/1163-export-theme

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Refs #1163

What was wrong

Chart and ERD exports followed different rules. The chart SVG took the workbench colours, so exported from a dark theme it had a dark background; the ERD SVG always used light literals, while its PNG was a screenshot of the current theme.

Changes

  • A setting export_current_theme, off by default (AppSettings.getExportCurrentTheme).
  • Off: chart and ERD SVG use one light palette for documents (ChartSvg.light, ErdSvgColors()).
  • On: both use the colours of the current theme, as before.
  • The Export menus of the chart and of the diagram have a toggle that flips the setting and says which palette is in use.
  • Tests: the ERD SVG is light by default in the dark test theme.

Not in this PR

  • PNG is not done. Chart and ERD PNG are still screenshots of the current theme, so the default PNG is dark on a dark theme. The issue asks for the PNG to be rendered with the chosen palette. That needs rasterising the SVG, which I have not wired up, since I could not check the flutter_svg rasterising API without an analyzer run.
  • The toggle is in the Export menu, not in Preferences. The issue only asks for the choice to be remembered in settings, and it is.
  • No test for the chart SVG light palette in the widget; the SVG builder is covered by the existing chart SVG tests.

Not verified locally

Tests were not run locally, per the project rule.

… for the current theme (#1163)

Chart and ERD exports followed the current theme inconsistently: the chart SVG
took the workbench colours, the ERD SVG always used light literals. Exports now
use one light palette for documents by default. An export-theme setting, off by
default, switches both to the colours of the current theme; the Export menus of
the chart and the diagram offer the toggle.
@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
…e; drop an unused import (#1163)

Reading the setting touches the local database; without one (tests, a damaged
store) the export must still run, so it uses the light default. The chart file
imported app_toast next to widgets, which already provides it.
The second SVG export of the test reads the setting as well, so one pump was not
enough for it to be saved.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit a194f53 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