Skip to content

feat(workspace): implement comprehensive keyboard navigation and multi-cell range selection in DataGrid #662

Description

@ZhuchkaTriplesix

Motivation & Problem

In lib/features/workspace/result_grid_view.dart (lines 780–886), the DataGrid handles clipboard copy (Ctrl+C), staging shortcuts (Ctrl+Del, Ctrl+Z), and inline editing triggers (F2, Enter, Space), but lacks keyboard navigation for moving the active cell selection:

  • Pressing ArrowUp, ArrowDown, ArrowLeft, or ArrowRight does not move cell selection.
  • Shift + Arrow keys do not extend the rectangular cell selection range.
  • Ctrl + A / Meta + A does not select all cells in the grid.
  • Home, End, Ctrl+Home, Ctrl+End, PageUp, PageDown are unhandled.

Proposed Solution

  1. In ResultGridView (_VirtualResultGridState):
    • Add _navigateCell(int dRow, int dCol, {bool extendSelection = false}) supporting arrow keys and shift-arrow range extension.
    • Add Home / End (first/last column), Ctrl+Home / Ctrl+End (first/last cell), and PageUp / PageDown (viewport page step).
    • Add Ctrl+A / Meta+A to select the entire table grid.
    • Implement auto-scroll to ensure newly selected cells are brought into visible viewport.
  2. Add widget tests for keyboard navigation, range selection, and shortcuts.

Acceptance Criteria

  • Arrow keys navigate between cells smoothly.
  • Shift + Arrow keys create and expand multi-cell rectangular selections.
  • Ctrl+A selects all rows and columns.
  • Active cell scrolls into view when navigating outside visible area.
  • Unit and widget tests pass with 0 analyze warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrontendTheme parser epic label: frontend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions