diff --git a/packages/cli/src/ui/AppContainer.tsx b/packages/cli/src/ui/AppContainer.tsx index c564cc5ba..09085846a 100644 --- a/packages/cli/src/ui/AppContainer.tsx +++ b/packages/cli/src/ui/AppContainer.tsx @@ -2054,6 +2054,7 @@ export const AppContainer = (props: AppContainerProps) => { exitEditorDialog, closeSettingsDialog, closeModelDialog, + openModelDialog, openArenaDialog, closeArenaDialog, handleArenaModelsSelected, @@ -2112,6 +2113,7 @@ export const AppContainer = (props: AppContainerProps) => { exitEditorDialog, closeSettingsDialog, closeModelDialog, + openModelDialog, openArenaDialog, closeArenaDialog, handleArenaModelsSelected, diff --git a/packages/cli/src/ui/components/DialogManager.tsx b/packages/cli/src/ui/components/DialogManager.tsx index bd6e30dae..17dbecc14 100644 --- a/packages/cli/src/ui/components/DialogManager.tsx +++ b/packages/cli/src/ui/components/DialogManager.tsx @@ -202,6 +202,14 @@ export const DialogManager = ({ ); } + if (uiState.isModelDialogOpen) { + return ( + + ); + } if (uiState.isSettingsDialogOpen) { return ( @@ -216,6 +224,10 @@ export const DialogManager = ({ uiActions.openEditorDialog(); return; } + if (settingName === 'fastModel') { + uiActions.openModelDialog({ fastModelMode: true }); + return; + } uiActions.closeSettingsDialog(); }} onRestartRequest={() => process.exit(0)} @@ -240,14 +252,6 @@ export const DialogManager = ({ ); } - if (uiState.isModelDialogOpen) { - return ( - - ); - } if (uiState.activeArenaDialog === 'start') { return ( { - if (key.name === 'escape') { + if (key.name === 'escape' || (key.name === 'left' && isFastModelMode)) { onClose(); } }, diff --git a/packages/cli/src/ui/components/SettingsDialog.tsx b/packages/cli/src/ui/components/SettingsDialog.tsx index 8a0decb71..3cfa329cb 100644 --- a/packages/cli/src/ui/components/SettingsDialog.tsx +++ b/packages/cli/src/ui/components/SettingsDialog.tsx @@ -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( diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap index 5b1c5bb95..5282d9c23 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap @@ -9,10 +9,10 @@ exports[`SettingsDialog > Snapshot Tests > should render default state correctly │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode false │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -30,10 +30,10 @@ exports[`SettingsDialog > Snapshot Tests > should render focused on scope select │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode false │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -51,10 +51,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with accessibility sett │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode true* │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -72,10 +72,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with all boolean settin │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode false* │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false* │ │ ▼ │ │ │ @@ -93,10 +93,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with different scope se │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode (Modified in System) false │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -114,10 +114,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with different scope se │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode (Modified in Workspace) false │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -135,10 +135,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with file filtering set │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode false │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -156,10 +156,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with mixed boolean and │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode false* │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -177,10 +177,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with tools and security │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode false │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE false │ │ ▼ │ │ │ @@ -198,10 +198,10 @@ exports[`SettingsDialog > Snapshot Tests > should render with various boolean se │ ● Tool Approval Mode Default │ │ Language: UI Auto (detect from system) │ │ Language: Model auto │ -│ Theme Qwen Dark │ +│ Theme Qwen Dark ▸ │ │ Vim Mode true* │ │ Interactive Shell (PTY) true │ -│ Preferred Editor │ +│ Preferred Editor ▸ │ │ Auto-connect to IDE true* │ │ ▼ │ │ │ diff --git a/packages/cli/src/ui/contexts/UIActionsContext.tsx b/packages/cli/src/ui/contexts/UIActionsContext.tsx index e1a1010b9..6b73ce3ce 100644 --- a/packages/cli/src/ui/contexts/UIActionsContext.tsx +++ b/packages/cli/src/ui/contexts/UIActionsContext.tsx @@ -61,6 +61,7 @@ export interface UIActions { exitEditorDialog: () => void; closeSettingsDialog: () => void; closeModelDialog: () => void; + openModelDialog: (options?: { fastModelMode?: boolean }) => void; openArenaDialog: (type: Exclude) => void; closeArenaDialog: () => void; handleArenaModelsSelected?: (models: string[]) => void;