Skip to content

🐛 fix(keymap): check the grid keys the SQL results grid reads against SQL-tab keys (#141) - #148

Merged
Cemoche merged 2 commits into
mainfrom
issue-141-results-grid-conflicts
Oct 21, 2026
Merged

Cemoche merged 2 commits into
mainfrom
issue-141-results-grid-conflicts

Conversation

@Cemoche

@Cemoche Cemoche commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Closes #141

Summary

Since #115, the read-only results grid of a SQL tab reads some tableTab grid actions, but the Settings conflict check only compared actions in overlapping scopes. A binding such as grid.rowDetails on Ctrl+S was therefore accepted, and in the results grid it silently took over query.save.

  • Registry:
    • New optional field alsoIn: ["queryTab"] on the three grid actions the results grid reads: grid.rowDetails and grid.copyCells (matched in DataGrid's keydown), and grid.setValue (Alt+Enter, given to Glide as its activateCell key, which Glide also takes on read-only cells).
    • New export actionsAlsoIn(scope).
  • conflictFor: an action now also conflicts with the own actions of the scopes in its alsoIn, in both directions.
    • It does not extend to the editor: Ctrl+Space stays both completion and row details.
    • The [Refonte UI] Task 10: Open Anything et parité des raccourcis #90 shadows exemption is unchanged.
    • The Settings recorder, Reset and the saved-binding collision flag all go through conflictFor. They now refuse or flag these bindings, and never rewrite a saved one.
  • Parity test: results_grid_actions_parity renders the real ResultsPanel, gives each registry action a unique key and records which ones the grid takes. It asserts the list equals actionsAlsoIn("queryTab"), so a grid action added to the results grid later can't drift.
  • Other tests:
    • Conflicts in both directions, on Linux and macOS.
    • Table-tab-only grid keys and editor keys stay free.
    • The recorder refuses Ctrl+S for Row details / Copy cells and Ctrl+Space for Save query, and accepts Ctrl+D for Save query.
    • A saved grid.rowDetails = Mod+S is flagged and not rewritten.
  • Docs: amendment Keymap: grid actions used in the SQL results grid aren't checked against SQL-tab keys #141 in spec §5.5.

No action id changed, so there is no Rust change.

How it was tested

$ pnpm exec vitest run --maxWorkers=1 src/lib/keymap.test.ts src/lib/shortcutParity.test.ts \
    src/features/grid/DataGrid.test.tsx src/features/settings/SettingsDialog.test.tsx \
    src/features/editor/ResultsPanel.test.tsx       # 125 tests passed
$ pnpm exec tsc --noEmit                            # clean

The full suite was not run locally because the dev machine was short on RAM. CI runs it.

Manual check list

  1. Settings → Keymap: move "Commit" (grid.commit) to another key. Then record Ctrl+S for
    "Show or hide the row details". Expect it to be refused with the Save query conflict
    message.
  2. Same for "Copy cells": record Ctrl+S, expect it refused.
  3. Record Ctrl+Space for Save query. Expect it refused, naming the row details action.
  4. Record Ctrl+D for Save query. Expect it accepted. In a SQL tab Ctrl+D then saves, and in a
    table tab's grid Ctrl+D still duplicates rows. Then reset Save query.
  5. With a settings file that has "grid.rowDetails": "Mod+S" and "grid.commit": "Alt+S":
    the Row details row shows the collision note naming Save query, and the file is not
    rewritten.
  6. Regression: Ctrl+Space in the SQL editor still completes. Ctrl+Space in the results grid
    still toggles the row details. Ctrl+S in a SQL tab still saves.

Checklist

  • pnpm test green (touched files locally; full suite in CI)
  • pnpm lint green (tsc; no Rust change, clippy in CI)
  • pnpm test:rust green (not applicable: no src-tauri/ change)
  • No secret, token, real password or private key in the diff
  • User-visible strings in src/lib/strings.ts
  • Commits follow <emoji> <type>(<scope>): <description>

🤖 Generated with Claude Code

Cemoche and others added 2 commits October 21, 2026 11:25
… SQL-tab keys

The read-only results grid of a SQL tab takes grid.rowDetails and
grid.copyCells in its keydown, and grid.setValue through Glide's
activateCell, though all three are tableTab actions: Settings accepted
one of them on Ctrl+S (query.save) and the grid then ate the save.

The registry declares them with `alsoIn: ["queryTab"]`; conflictFor
treats such an action as overlapping that scope's own actions (not the
editor's, whose keys never reach the grid; the #90 shadows pairs stay
exempt). A parity test in DataGrid.test.tsx renders ResultsPanel and
checks that the actions its grid takes equal actionsAlsoIn("queryTab").

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…eys (#141)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Cemoche
Cemoche merged commit e8c1037 into main Oct 21, 2026
6 checks passed
@Cemoche
Cemoche deleted the issue-141-results-grid-conflicts branch October 21, 2026 09:45
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.

Keymap: grid actions used in the SQL results grid aren't checked against SQL-tab keys

1 participant