Parent
Part of #414
Problem
Primary export UI path (DataExportService.formatAsync / saveToFile) builds one giant String (CSV/JSON/Markdown/SQL) on an isolate, then File.writeAsString.
Streaming helper writeResultGridCsv already exists but is not used by this path. Wide × 10⁵-row grids → O(cells) heap + full matrix copy into the isolate.
Evidence
- lib/shared/services/data_export_service.dart (~147–219)
- Callers: results_tab.dart, extension_table_view.dart
- Unused stream: lib/core/csv/result_grid_csv.dart (writeResultGridCsv)
Related
#277 fixed sync UI-isolate CSV freezes; this is the remaining full-document materialization issue across formats.
Acceptance
- File export streams to IOSink for CSV (and preferably JSON/SQL)
- UI wires large exports through streaming path; clipboard may stay string-based with size guard
- No full-string build for file export of ≥N rows (document threshold)
- Smoke test / unit test for streamed write
Suggested fix
Reuse writeResultGridCsv; add streaming JSON/SQL writers; “export to file only” for oversized sets.
Reactions are currently unavailable
Parent
Part of #414
Problem
Primary export UI path (DataExportService.formatAsync / saveToFile) builds one giant String (CSV/JSON/Markdown/SQL) on an isolate, then File.writeAsString.
Streaming helper writeResultGridCsv already exists but is not used by this path. Wide × 10⁵-row grids → O(cells) heap + full matrix copy into the isolate.
Evidence
Related
#277 fixed sync UI-isolate CSV freezes; this is the remaining full-document materialization issue across formats.
Acceptance
Suggested fix
Reuse writeResultGridCsv; add streaming JSON/SQL writers; “export to file only” for oversized sets.