Skip to content

feat(schema): tree double-click / shift-click replace the editor content#13

Merged
BorisTyshkevich merged 1 commit into
mainfrom
feat/tree-gestures-replace-editor
Jun 22, 2026
Merged

feat(schema): tree double-click / shift-click replace the editor content#13
BorisTyshkevich merged 1 commit into
mainfrom
feat/tree-gestures-replace-editor

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

What

In the schema tree, the two query-producing gestures used to prepend their query above whatever was already in the editor:

  • double-click a tableSELECT * FROM <table> LIMIT 100
  • shift-click a database/tableSHOW CREATE … (formatted)

Since the editor supports undo, prepending just clutters the buffer. Both now replace the whole editor content — undo restores the prior query.

Unchanged: the identifier inserts that compose a query at the cursor — double-click a database name, double-click a column (its name), shift-click a column (name::type) — still insert at the cursor, since replacing the whole buffer with a bare identifier would defeat that workflow.

Changes

  • editor.js — drop the now-unused insertTopLine (prepend); replaceEditor remains.
  • app.jsinsertCreate replaces instead of prepending; expose a replaceEditor action (replacing the insertTopLine action).
  • schema.js — table double-click calls replaceEditor.
  • tests updated — editor.js and schema.js at 100%.

Verification

npm test green at the per-file gate. Verified e2e on otel: with existing text in the editor, double-clicking a table and shift-clicking it both replaced the buffer (SELECT * / formatted CREATE TABLE); the prior content was gone.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QennTvGKAtJZrv9EpQagef

Double-clicking a table (SELECT * FROM … LIMIT 100) and shift-clicking a
database/table (SHOW CREATE) used to prepend their query above whatever was
already in the editor. Since the editor has undo, prepending just clutters the
buffer — these gestures now replace the whole content (undo restores the prior
query).

Identifier inserts that compose a query at the cursor (double-click a database
name, double-click a column, shift-click a column for name::type) are
unchanged — they still insert at the cursor.

- editor.js: drop the now-unused insertTopLine (prepend); replaceEditor remains.
- app.js: insertCreate replaces instead of prepending; expose a replaceEditor
  action in place of insertTopLine.
- schema.js: table double-click calls replaceEditor.
- tests updated; editor/schema at 100%.

Verified e2e on otel: with existing editor text, double-clicking a table and
shift-clicking it both replaced the buffer (SELECT * / formatted CREATE TABLE);
the prior content was gone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QennTvGKAtJZrv9EpQagef
@BorisTyshkevich BorisTyshkevich merged commit 29d6ac8 into main Jun 22, 2026
2 checks passed
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.

1 participant