feat(schema): tree double-click / shift-click replace the editor content#13
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In the schema tree, the two query-producing gestures used to prepend their query above whatever was already in the editor:
SELECT * FROM <table> LIMIT 100SHOW 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-unusedinsertTopLine(prepend);replaceEditorremains.app.js—insertCreatereplaces instead of prepending; expose areplaceEditoraction (replacing theinsertTopLineaction).schema.js— table double-click callsreplaceEditor.editor.jsandschema.jsat 100%.Verification
npm testgreen 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 */ formattedCREATE TABLE); the prior content was gone.🤖 Generated with Claude Code
https://claude.ai/code/session_01QennTvGKAtJZrv9EpQagef