Skip to content

feat(workspace): Explain and Cancel in the SQL toolbar - #1131

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1051-explain-and-cancel
Oct 8, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1051-explain-and-cancel

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

The two scenarios still open in #1051 tested features that had no UI: explainQuery and cancelQuery existed on the delegate, but nothing called them while a query was running.

  • UI kit: new QueryaActionButton (lib/shared/widgets/querya_action_button.dart): labelled outline toolbar button with icon, loading spinner, isDestructive, tooltip. The SQL toolbar now uses it for History, Execute, Explain, Cancel, Diagram, Begin, Commit and Rollback instead of seven hand-built OutlineButtons. Documented in docs/ui-kit.md.
  • Explain: shows the plan of the selection (or the whole editor) in the result grid, one line per row; does not run the query. Shown when delegate.supportsExplain (default true; off for generic extension drivers, which cannot explain).
  • Cancel: appears next to Execute while a statement runs and calls delegate.cancelQuery(); the pending run then ends with the driver's cancellation error. supportsCancel is false for extension drivers, whose cancelQuery is a no-op.
  • Tests: e2e_explain_and_cancel_query_test.dart (plan lines, empty editor, error, Cancel interrupts and the editor is usable again, buttons hidden for drivers without support), querya_action_button_test.dart. The fake delegate gets explainPlan, explainError, cancelAbortsGate and the two support flags.

Existing tests that tap Execute (F5) through OutlineButton still match, since the button wraps one.

Written without running locally; CI is the first run.

Closes #1051

@github-actions github-actions Bot added editor Code/SQL editor tests Theme parser epic ui User interface components and widgets data-grid Interactive data grid, cell editor, filtering, groupings P3 Low priority / Polish & Enhancements labels Oct 8, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit cf68f73 into dev Oct 8, 2026
14 checks passed
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Grid scroll benchmark

metric base PR change
p50 15.75 ms 16.78 ms +6.5% ⚠️
p90 24.06 ms 26.31 ms +9.4% ⚠️
p99 47.79 ms 56.45 ms +18.1% ⚠️
stutters 310.00 290.00 -6.5%

Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result.

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data-grid Interactive data grid, cell editor, filtering, groupings editor Code/SQL editor P3 Low priority / Polish & Enhancements tests Theme parser epic ui User interface components and widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant