Skip to content

✨ feat(editor): row details panel for SQL tab results, read-only (#115) - #142

Merged
Cemoche merged 5 commits into
mainfrom
issue-115-sql-row-details
Oct 21, 2026
Merged

Cemoche merged 5 commits into
mainfrom
issue-115-sql-row-details

Conversation

@Cemoche

@Cemoche Cemoche commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Closes #115

Summary

The row detail panel from Task 7 now also works on SQL tab results, read-only.

  • Toggle: Ctrl+Space or Space in the results grid, or the toolbar button. In the editor, Ctrl+Space stays completion; this is tested with the real CodeMirror. The window-wide open state and the panel width are shared across tab kinds.
  • Keymap: grid.rowDetails keeps its tableTab scope, and no id was added. The grid reads the shortcut in its own keydown, as grid.copyCells already does in the results grid. In a table tab the grid now takes Ctrl+Space itself, so the window binding can't toggle twice. That window binding is unchanged: it still toggles from anywhere outside a text field.
  • Layout: the panel sits right of the editor and the results, under the SQL toolbar. That is the same position as in table tabs.
  • When it shows:
    • The panel shows while the run has a result set or is still running.
    • With no run, or a run without a result set, there is no panel. The toolbar button is then softDisabled with its tooltip, and the switch keeps its value.
    • The panel reads "No row selected" in the Message view, during a run, and before a row is picked.
  • Result N: the panel follows the result set on screen. Switching sets clears the selection and the Shift+click anchor.
  • Fields: read-only. JSON is indented, and NULL shows as in the grid. A cut value shows what the result has, plus the Quick Look note "Only the start of this value was loaded." (query results have no key to fetch the rest by).
  • Escape in the panel returns to the results grid, or to the editor in the Message view.
  • Docs: amendment [Refonte UI] Row detail panel for SQL tab results #115 in spec §2.3 (it replaces the Task 7 "no panel on SQL results / button disabled" phrases), the README Results bullet and a shortcut-table row.

Follow-up from the review: #141. A grid.rowDetails rebinding that collides with a SQL-tab key (query.save) is not flagged by Settings; grid.copyCells has the same exposure.

No Rust change.

How it was tested

$ pnpm exec vitest run --maxWorkers=1     # 109 files, 1403 tests passed; after the review round: DataGrid + readmeShortcuts green
$ pnpm exec tsc --noEmit                  # clean

Manual check list (light and dark)

  1. In a SQL tab, run select 1 as id, '{"a":[1,2]}'::jsonb as doc, null as n, repeat('x', 100000) as big;.
    • The toolbar's right-panel button is enabled.
    • Click a cell and press Space: the panel opens on the right of the editor and the results, at the width saved for table tabs.
    • Each field is read-only and greyed: doc is indented, n is an empty box with the NULL placeholder, and big shows its start, "…" and "Only the start of this value was loaded."
  2. With the grid focused, Ctrl+Space closes the panel; Ctrl+Space opens it again. Arrow keys move rows and the panel follows.
  3. Click into the editor and press Ctrl+Space: the completion list opens and the panel doesn't move.
  4. Run two SELECTs.
    • Pick a row in Result 1, then click Result 2: "No row selected". Pick a row there: its fields show.
    • Click Message: "No row selected".
  5. Click into a panel field and press Escape: the focus is back in the results grid, and the arrow keys move rows. Click ×: the panel closes, and the focus goes back to the grid.
  6. With the panel open, switch to a table tab: it is open there. Close it with Ctrl+Space, go back to the SQL tab: closed. Open it with the toolbar button, go to the table tab: open.
  7. In a new SQL tab with no run, the button is greyed. Hover and keyboard focus show the "Row details" tooltip; a click does nothing. Run an UPDATE: still greyed, with no panel. Re-run a SELECT: the panel stays put during the run ("No row selected"), then shows rows to pick.
  8. Drag the panel's left edge in a SQL tab: the 240 minimum and the 60 % cap hold, and the width is shared with table tabs.
  9. Readability in light and dark: the read-only (greyed) field text, the "Only the start…" note and the search box.
  • After switching Result N, Shift+click on a row number selects from that row only (no rows from the previous set).

Checklist

  • pnpm test green
  • 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 5 commits October 21, 2026 06:14
…tails; the panel takes a SQL result

DataGrid: onSelectRow for grids without editing, a new result starts with no
selection, and grid.rowDetails is matched in the grid's own keydown (with Space).
RowDetailPanel: object, info and the edit callbacks may be absent (read-only),
a cut value that cannot be loaded says so, fields keyed by position too (#115).

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

The results grid reports its selected row; the window's one panel shows it on
the right of the editor and the results, following the Result N on screen
(Message view, a run going: No row selected). Space / Ctrl+Space in the results
grid and the toolbar button toggle it; the button is soft-disabled on a SQL tab
whose run has no result set. Ctrl+Space in the editor stays completion.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ndment #115 also replaces "button disabled"

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Cemoche
Cemoche merged commit bdb2947 into main Oct 21, 2026
6 checks passed
@Cemoche
Cemoche deleted the issue-115-sql-row-details branch October 21, 2026 06:36
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.

[Refonte UI] Row detail panel for SQL tab results

1 participant