Repository navigation
feat(command): add an action menu and Quick Look - #28
Merged
Merged
Conversation
Results could only be opened or revealed. Finder and Spotlight let you preview a file, copy its path, or quit the app you found, and a launcher that can't is a step backwards. The menu is a native NSMenu on ⌘K or a right-click. Quick Look is a QLPreviewView in a non-activating panel beside the launcher rather than the system QLPreviewPanel: a live test showed the system panel couldn't get the keyboard, because the launcher never activates the app, so the launcher closed and later keystrokes went to the previous app. A panel that can't become key leaves the keyboard in the search field, so the arrows move the selection and the preview follows.
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.
Carries over oddurs/common-command#10, which was closed when the app moved here. The diff is the same, applied under
apps/command/. It touches only thecommandarea, not CommonKit orshared/.Problem
A result could be opened, or revealed with ⌘↩, and nothing else. Finder and Spotlight let you preview a file, copy its path, or quit the app you just found.
Approach
ItemCommand.commands(for:isRunning:)in CommandKit (tested) decides what each result offers:NSMenuunder the field for the selected result. A right-click shows the same commands through SwiftUI'scontextMenu, which is also anNSMenu. Menu items carry their symbols and the panel's own keys.QLPreviewViewin a non-activating panel that can never become key, so the keyboard stays in the search field:Look at sceptically
QLPreviewPanelneeds the app to be active before it can take the keyboard, and the launcher never activates. The preview opened while the previous app kept focus, the launcher closed itself, and keystrokes went to the other app. The in-panel preview above replaces it. The replacement has not been seen on screen yet.QLPreviewViewrenders through Quick Look's service, so it can't be checked offscreen. The ⌘K and right-click menus areNSMenus, which the snapshot can't draw either, so there are no screenshots. The result list itself is unchanged.Checklist
scripts/task check commandpasses locally: lint, 112 tests, universal build## [Unreleased]inapps/command/CHANGELOG.md