Environment
Chat2DB Edition
Chat2DB Community
Chat2DB Version
Source build at 5ed077a5
Deployment
Web
Operating System
macOS
Operating System Version
macOS 27.0 (Build 26A5378n)
Database and Version
N/A - the issue is independent of the connected database.
Problem and Reproduction
Problem Summary
When SQL is pasted directly into an empty editor, the SQL text appears immediately but content-dependent toolbar actions can remain disabled. Typing another character causes the toolbar state to refresh.
Steps to Reproduce
- Start Chat2DB Community in Web mode.
- Open an empty SQL console.
- Paste a non-empty SQL statement directly into the Monaco editor.
- Observe the execute-current, explain, save, format, and optimize toolbar actions.
Expected Behavior
Content-dependent toolbar actions become enabled synchronously whenever the editor changes from empty or whitespace-only content to non-empty SQL, including paste, undo, redo, and programmatic edits.
Actual Behavior
The SQL appears in Monaco before the React hasEditorContent state is updated. The toolbar continues rendering its empty-editor disabled state until a later debounced content callback succeeds or another edit triggers synchronization.
Evidence
Logs
N/A - no runtime error is emitted.
Screenshots or Additional Context
The toolbar uses hasEditorContent while the existing Monaco content callback is debounced by 300 ms. UI state synchronization should be immediate; SQL parsing and completion work can remain debounced.
Impact and Workaround
Impact
Degrades a core workflow
Workaround
A partial workaround exists
Typing another character can trigger the toolbar state update.
Submission Checklist
Environment
Chat2DB Edition
Chat2DB Community
Chat2DB Version
Source build at
5ed077a5Deployment
Web
Operating System
macOS
Operating System Version
macOS 27.0 (Build 26A5378n)
Database and Version
N/A - the issue is independent of the connected database.
Problem and Reproduction
Problem Summary
When SQL is pasted directly into an empty editor, the SQL text appears immediately but content-dependent toolbar actions can remain disabled. Typing another character causes the toolbar state to refresh.
Steps to Reproduce
Expected Behavior
Content-dependent toolbar actions become enabled synchronously whenever the editor changes from empty or whitespace-only content to non-empty SQL, including paste, undo, redo, and programmatic edits.
Actual Behavior
The SQL appears in Monaco before the React
hasEditorContentstate is updated. The toolbar continues rendering its empty-editor disabled state until a later debounced content callback succeeds or another edit triggers synchronization.Evidence
Logs
Screenshots or Additional Context
The toolbar uses
hasEditorContentwhile the existing Monaco content callback is debounced by 300 ms. UI state synchronization should be immediate; SQL parsing and completion work can remain debounced.Impact and Workaround
Impact
Degrades a core workflow
Workaround
A partial workaround exists
Typing another character can trigger the toolbar state update.
Submission Checklist