Repository navigation
Alternate actions on the selected result with modifier keys - #89
Merged
Merged
Conversation
Cmd+Enter reveals the item in Finder, Option+Enter copies its path, and Control+Enter opens a new instance of the app. Providers without file items, such as piped stdin, keep plain Enter behaviour.
Document that wrapping providers must forward doAction(item:action:) and test the action through the real provider stack. Cmd/Option+Enter on a program no longer runs it when its path is unknown: the path is looked up again, otherwise it beeps. Control+Enter on a settings pane opens it normally instead of failing to start a new instance.
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.
Behaviour
NSWorkspace.activateFileViewerSelecting).OpenConfiguration.createsNewApplicationInstance). For $PATH programs it just runs them in the terminal again.PipeListProvider) and any provider without alternate actions fall back to plain Enter through a defaultListProvider.doAction(item:action:).Implementation
src/ItemAction.swift: theItemActionenum (mapping from modifiers),isSubmit(modified Returns reach the field editor asinsertNewlineIgnoringFieldEditor:(⌥),insertLineBreak:(⌃), ornoop:(⌘), and the Return keyCode check stops ⌃O from triggering it), andFileActions, whose workspace and pasteboard calls can be swapped out in tests.ListProvidergainsdoAction(item:action:)with a default implementation.AppListProvider,CommandListProvider(which now keeps each program's full path), andCompositeListProviderimplement it.SearchViewControllerchanges are limited to the Enter branch and an optionalactionparameter onsubmit.Testing
ItemActionTestscover the modifier mapping, submit detection, the FileActions pasteboard, reveal, and new-instance actions, routing through the App and Composite providers, and the fallback for plain providers. There are also new tests inSearchViewControllerCommandTestsandCommandListProviderTests.xcodebuild ... test: 227 tests, 0 failures.swiftlint --strict: 0 violations.🤖 Generated with Claude Code