Repository navigation
Add web search keyword shortcuts - #91
Merged
Merged
Conversation
Typing <keyword> <query> puts a result such as "Search Google for 'x'" at the top of the list. Shortcuts open a URL with the query percent-encoded, or run a command in the configured terminal with the query shell-quoted (Claude Code, Codex). Defaults cover Google, DuckDuckGo, GitHub, YouTube, Wikipedia, Claude, ChatGPT and Perplexity, and are editable in a new Shortcuts settings pane. Off when a list is piped in.
A List nested in a grouped Form is laid out as plain rows with scrolling turned off, so shortcuts past the visible area could not be reached. Lay the pane out as a plain stack with a bordered, scrollable list and keep the buttons below it.
Rename the default gh shortcut to ghs and drop the claude keyword, so gh pr list and claude still run as commands. When the keyword is a program listed from $PATH, the shortcut goes after the regular matches. Stored lists are left as they are. Decode stored shortcuts one by one so an invalid entry no longer replaces the whole list with the defaults, let the settings pane take injected settings, and keep tests off the user's defaults.
# Conflicts: # README.md # src/SearchService.swift
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.
Typing
<keyword> <query>(e.g.g swift actors) puts a result like Search Google for 'swift actors' at the top of the list; Enter opens it.{query}is percent-encoded (RFC 3986 unreserved chars only) and the URL opens in the default browser.{query}is shell-quoted and the command runs in the terminal from Settings → General (reusesTerminalLauncher).gGoogle,ddgDuckDuckGo,ghGitHub,ytYouTube,wWikipedia,c/claudeClaude,gpt/chatgptChatGPT,pPerplexity,cc→claude '<prompt>',cx→codex '<prompt>'.Implementation: a new
SearchShortcutProviderwraps the composite provider and implements a smallQueryListProviderprotocol.SearchServiceputs those query-dependent items in front of the fuzzy matches. Changes to shared files are small: SearchService (+3 lines), ProviderFactory (+1), AppDelegate (pane + identifier), plus the factory test.Testing: new
SearchShortcutsTests(parsing, percent-encoding, shell quoting incl.'/$(), placeholder fallback, persistence/corrupt data, case-insensitive matching, provider routing, SearchService ordering, settings model, pane). Fullxcodebuild ... testpasses (231 tests), andswiftlint --strictis clean.🤖 Generated with Claude Code