Add slash command menu with /model intercept#15
Open
seamus-mirage wants to merge 1 commit intomainfrom
Open
Conversation
Pop a scrollable autocomplete above the input when the user types `/`. Up/Down to navigate (auto-scrolls the highlight into view), hover to preview without hijacking the scroll, Tab/Return to commit, Esc to dismiss. Recents persist in UserDefaults and float to the top of the list; bare `/` shows recents then the rest of the catalog, and typing fuzzy-filters across all commands. `/model` is handled locally — `claude --input-format stream-json` doesn't interpret slash commands, so any pass-through `/model …` would just be sent to the model as text. Bare `/model` resets to the app default; `/model opus`, `/model claude-opus-4-7`, and `/model "Opus 4.7"` all resolve via the ModelCatalog (id, label, family alias, suffix). Unknown names surface through the existing AppState error alert. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nickdirienzo
approved these changes
Apr 28, 2026
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.
Summary
/. Up/Down navigates with auto-scroll, hover previews without hijacking the scroll position, Tab/Return commits, Esc dismisses. Recents persist in UserDefaults; bare/shows recents then the rest of the catalog, typing fuzzy-filters across the full set./modelis intercepted locally and rewiresconversation.modelID(the--input-format stream-jsonpath that Flight uses doesn't interpret slash commands, so pass-through would otherwise be sent to the model as plain text). Bare/modelresets to the app default;opus/sonnet/haikualiases plus exact id/label/suffix all resolve viaModelCatalog. Unknown names route through the existingAppStateerror alert.PasteableTextViewControllerso a click-driven menu commit can replace the field and park the caret at the end without a hover-vs-keyboard race.Test plan
/, see recents (8) followed by the rest of the catalog; scroll the menu with the wheel and with Up/Down./he,/sec,/com— fuzzy filter ranks the obvious match first./<cmd>./model opusswitches to Opus 4.7 (verify Model dropdown reflects it)./modelalone clears to default./model bogusraises the error alert and leaves the input intact./help,/init, etc. — the command name appears at the top of recents next time you open the menu.swift buildandswift testclean (19 tests passing locally).🤖 Generated with Claude Code