Skip to content

refactor(erd): export flows move out of ErdView into ErdExporter - #1472

Merged
ZhuchkaTriplesix merged 5 commits into
devfrom
issue/1362-erd-split-1
Oct 11, 2026
Merged

ZhuchkaTriplesix merged 5 commits into
devfrom
issue/1362-erd-split-1

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

First slice of #1362 (the issue stays open: erd_view.dart is still ~1690 lines against a 300 line goal).

The export flows leave the view state:

  • lib/features/erd/erd_exporter.dart: ErdExporter holds Mermaid, DBML, SVG, PNG and PDF export, the clipboard copies and the light-palette / current-theme setting. It talks to the view through the small ErdExportSource interface (data, colours, canvas boundary, withCleanCanvas).
  • _ErdViewState implements ErdExportSource; the screen-only state that has to be hidden for a PNG capture (pick, picked relation, group marks, hover) stays in the view as withCleanCanvas, with the same restore-after rules as before.
  • Behaviour is unchanged. The file shrinks by ~90 lines only: the interface adds boilerplate, the real gain is that exports are now testable without mounting the diagram (erd_exporter_test.dart: Mermaid and DBML file names and content, groups outside the shown tables left out).

Next slices (separate PRs): the saved layout and views (_readSaved, _current, _showState, _switchView), the notes and group operations, then the canvas and search state.

ErdExporter holds Mermaid, DBML, SVG, PNG and PDF export and the export
palette setting; ErdView implements ErdExportSource to give it its data,
colours and the canvas boundary. erd_view.dart: 1784 -> ~1590 lines.

Refs #1362
@github-actions github-actions Bot added frontend Theme parser epic label: frontend ui User interface components and widgets P2 Medium priority / Parity & Refactoring labels Oct 11, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit dc4ab4f into dev Oct 11, 2026
15 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1362-erd-split-1 branch October 11, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Theme parser epic label: frontend P2 Medium priority / Parity & Refactoring ui User interface components and widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant