feat: replace text input with model picker for Fast Model in /settings (#3120)

The Fast Model setting in the settings dialog previously used a plain text
input, making it hard for users to discover available models. This replaces
it with the same model picker dialog used by `/model --fast`, adds a `▸`
visual indicator for sub-dialog settings, and supports right arrow to open
and left arrow to return.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Shaojin Wen 2026-04-11 10:38:02 +08:00 committed by GitHub
parent fb91acdf25
commit a7771bbb93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 63 additions and 29 deletions

View file

@ -567,6 +567,12 @@ export function SettingsDialog({
}
return;
}
if (currentItem?.value === 'fastModel') {
if (name === 'return') {
onSelect('fastModel', selectedScope);
}
return;
}
if (
currentItem?.type === 'number' ||
currentItem?.type === 'string'
@ -575,6 +581,16 @@ export function SettingsDialog({
} else {
currentItem?.toggle();
}
} else if (name === 'right') {
// Right arrow opens sub-dialog settings (like a sub-menu)
const currentItem = items[activeSettingIndex];
if (
currentItem?.value === 'ui.theme' ||
currentItem?.value === 'general.preferredEditor' ||
currentItem?.value === 'fastModel'
) {
onSelect(currentItem.value, selectedScope);
}
} else if (/^[0-9]$/.test(key.sequence || '') && !editingKey) {
const currentItem = items[activeSettingIndex];
if (currentItem?.type === 'number') {
@ -786,6 +802,12 @@ export function SettingsDialog({
displayValue = editBuffer;
}
} else if (item.type === 'number' || item.type === 'string') {
// Settings that open a sub-dialog on Enter
const isSubDialogSetting =
item.value === 'ui.theme' ||
item.value === 'general.preferredEditor' ||
item.value === 'fastModel';
// For numbers/strings, get the actual current value from pending settings
const path = item.value.split('.');
const currentValue = getNestedValue(pendingSettings, path);
@ -813,6 +835,11 @@ export function SettingsDialog({
if (isDifferentFromDefault || isModified) {
displayValue += '*';
}
// Append ▸ for sub-dialog settings to hint Enter opens a picker
if (isSubDialogSetting) {
displayValue = displayValue ? displayValue + ' ▸' : '▸';
}
} else {
// For booleans and other types, use existing logic
displayValue = getDisplayValue(