Skip to content

feat(linux): add result grid context menu with Copy as and Export Results dialog - #2669

Merged
datlechin merged 5 commits into
TableProApp:linuxfrom
Seha16:feat/export-results-dialog
Sep 8, 2026
Merged

datlechin merged 5 commits into
TableProApp:linuxfrom
Seha16:feat/export-results-dialog

Conversation

@Seha16

@Seha16 Seha16 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Right-click menu on every result grid, including query results in the SQL editor, which had no menu before: Copy, Copy as (Rows, With Headers, JSON, CSV, CSV with Headers, Markdown, IN Clause, INSERT Statement), Copy column name, Show Row as JSON, Set Value (Empty, NULL), Export Results..., Insert row, Duplicate, Delete. Editable-only items are hidden on read-only grids.
  • Export Results dialog (adw::Dialog) with a format picker (CSV, JSON) and CSV options that match the macOS app: convert NULL to empty, convert line breaks to spaces, field names in first row, sanitize formula-like values, delimiter, quote mode, line break, decimal separator. Reset to Defaults. Options persist in preferences.json.
  • Pure renderers live in tablepro_core::export with unit tests. The old render_csv in the app went through the grid's display formatter, so it truncated text at 10k chars and wrote the NULL sentinel into files; the new path renders full values.
  • serde_json gets preserve_order so JSON output keeps column order.

Deferred to follow-up PRs: Paste rows, Set Value > NOW() / CURRENT_TIMESTAMP (needs a raw SQL expression marker in the change tracker), SQL / Markdown / HTML / XML / XLSX file export.

Test plan

  • ./scripts/ci-local.sh (fmt, clippy -D warnings, build, 338 unit tests; 21 new for the renderers)
  • SQLite smoke DB with a comma, a line break, a " and a =SUM(A1) value. Right-clicking on the editor result grid shows the read-only menu; on a table tab, it shows the full menu.
  • Copy as Markdown / JSON / IN Clause / CSV with Headers and plain Copy read back from the Wayland clipboard with the expected text.
  • Export dialog: switches and dropdowns write preferences.json on change, Reset to Defaults restores defaults, Export writes the file and shows the toast. Output with semicolon + line breaks to spaces: 2;has,comma;'-2.25;"line1 line2";false and 3;'=SUM(A1);10;"say ""hi""";false.
  • Set Value > Empty marks the cell as modified and shows the unsaved-changes bar.
  • Show Row as JSON opens a read-only dialog with column order preserved.
  • Paginator export button opens the same dialog.
  • Dark theme
04-context-menu 05-copy-as-submenu 07-row-as-json 08-export-dialog
tablepro-export-demo-3x.mp4
04-context-menu 05-copy-as-submenu 07-row-as-json 08-export-dialog
tablepro-export-demo-3x.mp4

@datlechin datlechin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@datlechin
datlechin merged commit 3c596b0 into TableProApp:linux Sep 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants