Skip to content

fix(sql-editor): sync action state on content changes - #2263

Merged
openai0229 merged 1 commit into
mainfrom
fix/2259-sync-editor-action-state
Jul 27, 2026
Merged

openai0229 merged 1 commit into
mainfrom
fix/2259-sync-editor-action-state

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

Related issue

Closes #2259

Summary

Synchronize SQL editor toolbar availability directly from Monaco model changes instead of waiting for the existing 300 ms debounced value callback.

The new onContentChange path is intentionally limited to lightweight UI state. SQL parsing, completion, parameter hints, and the existing external onChange behavior remain on the debounced path, preserving the editor's performance boundary while covering paste, deletion, undo, redo, and programmatic model updates.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • yarn eslint src/components/SQLEditor/editor/MonacoEditor/index.tsx src/components/SQLEditor/editor/SQLEditor/index.tsx src/components/SQLEditor/editor/SQLEditorWithOperation/index.tsx --max-warnings=0 - passed
    • yarn lint - passed
    • yarn test:i18n - passed
    • yarn build:web:community --app_version=5.3.0 - passed, including all Community prebuild tests
    • git diff --check - passed
  • Manual verification: The branch-specific Community frontend started on port 8890; /workspace and the frontend-proxied /api/system both returned HTTP 200. Interactive paste automation was unavailable in the current browser environment.
  • UI evidence: N/A - no controllable browser instance was available; source timing, production build, and runtime smoke checks were verified.

Risk and compatibility

  • Public API or stored data: N/A - no API or persistence changes.
  • Database or driver compatibility: N/A - the behavior is database-independent.
  • Network, privacy, or security: N/A - no network, clipboard access, or data handling changes.
  • Community / Local / Pro boundary: Community frontend source only; the shared editor behavior remains compatible with existing surfaces.
  • Backward compatibility: The existing debounced onChange callback is unchanged. The new optional callback only synchronizes lightweight content-presence state.

Reviewer map

  • Start here: chat2db-community-client/src/components/SQLEditor/editor/MonacoEditor/index.tsx, inside onDidChangeModelContent.
  • Failure condition: Content-dependent actions remain disabled after a non-empty model change, or SQL parsing/completion begins running synchronously on every edit.
  • Rollback or disable path: Revert this commit to restore the previous debounced-only toolbar synchronization.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: Substantial AI assistance was used for source tracing, implementation, and verification.

@openai0229
openai0229 force-pushed the fix/2259-sync-editor-action-state branch from 11aa12c to 709cca8 Compare July 27, 2026 13:19
@openai0229
openai0229 merged commit e86faec into main Jul 27, 2026
16 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 27, 2026
@openai0229
openai0229 deleted the fix/2259-sync-editor-action-state branch August 5, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

SQL editor action buttons remain disabled after pasting content

1 participant