Skip to content

Switching result sets keeps the grid's pending edits #869

Closed

Description

@EVWorth

Severity: P1 (data safety).

The grid's pending edits are kept by row index in useGridEditing, and nothing clears them when the user switches between the result sets of one run (the "Result 1 / Result 2" tabs above the grid, setActiveResult). Save then applies them to the result set now shown, which can be another table.

How to see it

  1. Run SELECT * FROM customers; SELECT * FROM orders;.
  2. On Result 1, turn on Edit Mode and change a cell in row 3.
  3. Click Result 2. Row 3 of orders shows as edited, and Save writes the change against orders.

Cause

src/components/grid/ResultsGrid.tsx passes results (the whole array) as the owner of the edits to useGridEditing, and activeResultIndex changes do not touch the editing state. The fix for #865 on PR #866 drops edits when results changes, but not when only activeResultIndex does.

Fix

Pass the active result (results[activeResultIndex]) as the edits' owner, so switching result sets drops, or better asks about, the pending edits. Alternatively keep pending edits per result set.

Found while fixing #865.


Generated by Claude Code

Activity

  1. added a commit that references this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions