Repository navigation
feat(chat-input): open the model picker from a /model command - #3752
Open
Raing5Days wants to merge 1 commit into
Open
Raing5Days wants to merge 1 commit into
Raing5Days wants to merge 1 commit into
Conversation
`/model` was the one common composer trigger OpenBitFun did not answer, so
changing models always meant leaving the keyboard.
- ChatInput offers `/model` in the slash picker and runs it as a local command:
it removes its own text and asks the model selector to open, landing on the
same view and focus the trigger uses.
- ModelSelector accepts an `openRequest` signal and, for a menu it opened on a
request, hands focus back to the composer once the menu closes, so a
keyboard-only user can keep typing. Trigger-opened menus are unchanged and
opening the model settings page does not pull focus back.
- The command shares the selector's availability contract and warns instead of
doing nothing; `/model <extra>` reports command usage.
- `/model` is offered for local, detached-dispatch (target model probe), and
non-goal sessions. ACP sessions still forward slash text to their agent.
Verification:
- pnpm --dir src/web-ui run test:run src/flow_chat/components/ModelSelectorOpenRequest.test.tsx
src/flow_chat/components/ModelSelectorProviderLevels.test.tsx
src/flow_chat/components/ModelSelectorExternal.test.tsx
src/flow_chat/components/ModelSelectorAcpMode.test.tsx
src/flow_chat/components/ChatInputWorkspaceStripLayout.test.ts
src/flow_chat/components/ChatInputBoostSubmenu.test.tsx
src/flow_chat/utils/slashActionSelection.test.ts
src/flow_chat/session-drivers/useComposerCapabilities.test.tsx
- pnpm run type-check:web
- pnpm run i18n:audit
- eslint on the touched sources
Remote scenarios: no transport, workspace path, or persisted shape changes. The
command is renderer-local and reuses the existing per-driver model selection,
including the detached-dispatch probe; ACP keeps its agent-owned commands. Not
exercised on live remote hosts.
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.
Closes #3738
What this adds
/modelis now a composer slash command on the Desktop (Web UI) surface. It wasthe one common trigger OpenBitFun did not answer, so switching models always
meant leaving the keyboard.
/model(or picking it from the slash menu) and pressing Enter clearsthe command text and opens the model selector beside the composer, landing on
the same view, panel, and focus the trigger opens.
choice, and when the menu closes after a selection or dismissal focus returns
to the composer, so the next message can be typed without reaching for the
mouse. Mouse-opened menus are unchanged, and jumping to the model settings
page does not pull focus back.
refuses changes (inherited side-session settings, a non-editable draft, a
locked dispatch submission) it warns and keeps the text instead of silently
doing nothing.
/model <extra>reports command usage./modelis offered for local sessions, detached-dispatch sessions (over thetarget model probe), and sessions without thread goals. ACP sessions are
deliberately untouched: their slash text still goes to the agent, which may
own its own
/model.Implementation notes
ModelSelectorowns its menu state, so the composer asks it to open through anopenRequestcounter (the same pattern asFlowChatHeader.searchOpenRequest)and receives
onRequestMenuClosedfor the focus handoff. No prop controls theopen state directly, and the trigger path is unchanged.
modelSelectorDisabledvalue and uses it forboth the selector and the command, so the two cannot disagree.
ComposerSlashOpgainsmodelfor the local, non-goal,and dispatch capability sets; new strings in en-US / zh-CN / zh-TW.
Verification
pnpm --dir src/web-ui run test:runover 8 focused files, all green:ModelSelectorOpenRequest.test.tsx: opens on request, answers eachrequest value once, ignores a request while disabled, hands focus back only
for requested menus;
useComposerCapabilities.test.tsx: local and detached sessions bothadvertise
model;pnpm run type-check:webpnpm run i18n:auditpnpm run check:repo-hygieneRemote scenarios: no transport, workspace path, or persisted-shape changes. The
command is renderer-local and reuses each driver's existing model selection
(local catalog, ACP options, detached target probe), so remote paths keep their
current owners. Not exercised against live remote hosts.
Follow-up (not in this PR)
(
src/apps/cli/src/ui/command_menu.rs) keeps its own command set; this PR doesnot touch it. Adding
/modelthere, and any shared command-catalog contractbetween the surfaces, is left as a separate change.
/model <name>query could build onthe same request signal later.