[Design] Redesign SQL editor AI interaction and result workflow #2256
openai0229
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Context
The Community SQL editor has used
/at the start of an empty line to open an inline AI composer. This intercepts ordinary SQL input and couples AI invocation to duplicated Monaco overlay, view-zone, focus, and global keyboard lifecycle code. Issue #2255 tracks removing that legacy behavior while preserving the right-side AI panel and other explicit AI actions.This Discussion is not only about choosing a new button or shortcut. It should define the complete editor AI experience: interaction, runtime logic, performance, compatibility, result presentation, result acceptance, failure recovery, and verification. No replacement should be implemented until these contracts are clear.
User workflow to support
A user writing or reviewing SQL should be able to ask AI about the current selection, statement, or database context without losing typed text, changing focus unexpectedly, hiding the editor, or applying unreviewed output. The flow should be discoverable for a first-time user and efficient for repeated use.
A complete workflow is:
1. Interaction model
Questions to resolve:
Required interaction constraints:
/and every other normal SQL character remain normal editor input.2. Runtime and state logic
The design should define one state machine shared by all entry points, for example: idle, composing, preparing context, requesting, streaming, awaiting review, applying, completed, cancelled, and failed.
Questions to resolve:
The implementation should have one editor integration path, editor-owned cleanup, request ownership identifiers, and no global document keyboard handler.
3. Performance expectations
The AI feature must not slow normal SQL editing when it is unused. The design should include measurable budgets and profiling steps for:
At minimum, no AI bundle or network request should be required for ordinary SQL typing, and closing the flow must release listeners, views, timers, subscriptions, and active requests.
4. Compatibility matrix
The selected design should be reviewed against:
Compatibility should be expressed as an explicit test matrix rather than inferred from one browser and one database.
5. Result presentation
Result presentation should distinguish explanation, generated SQL, proposed edits, tool activity, warnings, and errors instead of rendering every response as one text block.
Questions to resolve:
The presentation must remain stable while streaming and must not continuously resize or shift the SQL editor.
6. Accepting and applying results
Generated output must never execute or overwrite SQL automatically. The design should define explicit operations such as:
Questions to resolve:
A safe default is review before mutation, one-step undo, stale-context detection, and no automatic execution.
7. Errors, cancellation, and recovery
The experience should define visible behavior for missing model configuration, authentication failure, rate limits, timeout, provider errors, malformed streaming chunks, tool failure, tab closure, datasource change, and user cancellation. Error states should preserve the prompt and source SQL when safe, explain whether any result was applied, and offer only valid recovery actions.
Candidate directions
These directions can be combined. We should compare them using the same workflow and test matrix rather than selecting from screenshots alone.
Proposed design process
Decision criteria
The accepted design should prioritize safe SQL typing, discoverability, predictable focus, explicit context, responsive performance, compatibility, review before mutation, reversible acceptance, implementation reuse, and consistent behavior across editions.
Related removal and redesign Issue: #2255
All reactions