fix(editor): favorite keyword autocomplete, Cmd+D shortcut, and selectable Details fields#1530
Merged
Conversation
…table Details fields
aed43f1 to
e22cd20
Compare
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.
Three fixes from v0.47.0 feedback. Each goes at the root cause.
1. Field names in the Details panel are selectable
The row Details panel rendered the column name as a plain
Text, which has no selection. Added the native.textSelection(.enabled)to the field header, so both the field name and the type badge can be selected and copied (double-click a word, ⌘C, right-click Copy). Scoped to this panel; the sharedTypeBadgecomponent is untouched.2. Save as Favorite shortcut works again (Cmd+D) + toolbar button
0.47.0 moved the shortcut from Cmd+D to Control-Command-D to leave Cmd+D for the "Don't Save" sheet. But Control-Command-D is the macOS system "Look Up" shortcut, so the system swallowed it and the shortcut never fired (right-click still worked).
3. Favorite keyword expansion shows in autocomplete
A saved favorite's keyword was supposed to surface as an autocomplete suggestion, but never appeared. Root cause: in
SQLCompletionProvider.getCandidates, favorites were appended at the top of the function, then discarded by theitems = ...reassignment in most clause branches, including the.unknownbranch that handles the start of a statement (the natural place to type a keyword).Moved favorite injection into a
favoriteCompletions(matching:)helper appended after the clause switch, so it survives every branch. The early-return dot-prefix path keeps favorites out oftable.columncompletion..favoritealready ranks first, so the suggestion appears at the top of the popup with the favorite's name as its detail.Tests
SQLCompletionProviderTests: keyword expands at statement start, survives clause rebuild, is excluded after a dot prefix, and requires a prefix match.KeyboardShortcutTests: Cmd+D is the Save as Favorite default, Control-Command-D is system-reserved, and no default shortcut collides with a reserved combo.Docs / changelog
docs/features/favorites.mdxanddocs/features/keyboard-shortcuts.mdxupdated for the new shortcut, the toolbar button, and clearer keyword usage.CHANGELOG.mdUnreleased: Added (toolbar button, selectable Details fields), Changed (Cmd+D), Fixed (keyword autocomplete).Production files pass
swiftlint lint --strict. The user builds in Xcode.