Problem Statement
Currently in VirtualResultGrid (lib/features/workspace/result_grid_view.dart:729), right-clicking on any table cell (onCellSecondaryTap) executes:
void _onCellSecondaryTap(int row, int column) {
_focusNode.requestFocus();
widget.onRowSelected?.call(row);
if (_selection != null && _selection!.contains(row, column)) {
_copySelection();
} else {
// ...
_copySelection();
}
}
This creates critical UX friction:
- Destructive clipboard overwrite: Right-clicking on a cell immediately and silently overwrites the user's OS clipboard with the cell value. If the user had copied a query, password, or URL elsewhere, that clipboard content is wiped without warning.
- Missing context menu: Users in professional database clients (DataGrip, DBeaver, TablePlus) expect a context menu offering copy variants, quick filtering, value inspection, and DML operations.
Proposed Architecture & Solution
Implement a native desktop ContextMenu on cell secondary click (using shadcn_flutter's ContextMenu / showContextMenu consistent with connections_panel_sidebar.dart):
1. Copy Actions
- Copy Value (
Ctrl+C / Cmd+C)
- Copy with Headers
- Copy as JSON (encodes selected row/cells as JSON object or array)
- Copy as CSV / TSV
2. Instant Filter Bridge (Filter by Cell)
- Filter by Value: Appends or sets
column = 'value' in DataGridFilterBar.
- Filter Out Value: Appends
column != 'value'.
- Filter Greater / Less than: For numeric/date columns.
3. Value Inspection & Editing
- Inspect Cell Value… (
Ctrl+I / Cmd+I): Opens showGridCellInspectorDialog for viewing large JSON, XML, or multi-line strings.
- Set NULL (
Alt+N): Explicitly sets cell to NULL in DataGridStagingBuffer.
- Set to Default / Empty String.
- Revert Cell Changes: If modified in staging buffer.
4. Row Operations
- Duplicate Row (seeds a new insert in staging buffer).
- Delete Row (marks row deleted in staging buffer).
Acceptance Criteria
Problem Statement
Currently in
VirtualResultGrid(lib/features/workspace/result_grid_view.dart:729), right-clicking on any table cell (onCellSecondaryTap) executes:This creates critical UX friction:
Proposed Architecture & Solution
Implement a native desktop
ContextMenuon cell secondary click (usingshadcn_flutter'sContextMenu/showContextMenuconsistent withconnections_panel_sidebar.dart):1. Copy Actions
Ctrl+C/Cmd+C)2. Instant Filter Bridge (Filter by Cell)
column = 'value'inDataGridFilterBar.column != 'value'.3. Value Inspection & Editing
Ctrl+I/Cmd+I): OpensshowGridCellInspectorDialogfor viewing large JSON, XML, or multi-line strings.Alt+N): Explicitly sets cell to NULL inDataGridStagingBuffer.4. Row Operations
Acceptance Criteria
DataGridFilterBarand re-evaluates filtered rows.Ctrl+C,Ctrl+I,Alt+N) remain fully functional.