Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions packages/cli/src/ui/components/shared/BaseSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export function BaseSettingsDialog({
(key: Key) => {
// Let parent handle custom keys first (only if not editing)
if (!editingKey && onKeyPress?.(key, currentItem)) {
return;
return true;
}

// Edit mode handling
Expand All @@ -286,43 +286,43 @@ export function BaseSettingsDialog({
// Navigation within edit buffer
if (keyMatchers[Command.MOVE_LEFT](key)) {
editDispatch({ type: 'MOVE_LEFT' });
return;
return true;
}
if (keyMatchers[Command.MOVE_RIGHT](key)) {
editDispatch({ type: 'MOVE_RIGHT' });
return;
return true;
}
if (keyMatchers[Command.HOME](key)) {
editDispatch({ type: 'HOME' });
return;
return true;
}
if (keyMatchers[Command.END](key)) {
editDispatch({ type: 'END' });
return;
return true;
}

// Backspace
if (keyMatchers[Command.DELETE_CHAR_LEFT](key)) {
editDispatch({ type: 'DELETE_LEFT' });
return;
return true;
}

// Delete
if (keyMatchers[Command.DELETE_CHAR_RIGHT](key)) {
editDispatch({ type: 'DELETE_RIGHT' });
return;
return true;
}

// Escape in edit mode - commit (consistent with SettingsDialog)
if (keyMatchers[Command.ESCAPE](key)) {
commitEdit();
return;
return true;
}

// Enter in edit mode - commit
if (keyMatchers[Command.RETURN](key)) {
commitEdit();
return;
return true;
}

// Up/Down in edit mode - commit and navigate.
Expand All @@ -331,15 +331,15 @@ export function BaseSettingsDialog({
if (keyMatchers[Command.DIALOG_NAVIGATION_UP](key) && !key.insertable) {
commitEdit();
moveUp();
return;
return true;
}
if (
keyMatchers[Command.DIALOG_NAVIGATION_DOWN](key) &&
!key.insertable
) {
commitEdit();
moveDown();
return;
return true;
}

// Character input
Expand All @@ -350,7 +350,7 @@ export function BaseSettingsDialog({
isNumberType: type === 'number',
});
}
return;
return true;
}

// Not in edit mode - handle navigation and actions
Expand Down Expand Up @@ -396,16 +396,16 @@ export function BaseSettingsDialog({
// Tab - switch focus section
if (key.name === 'tab' && finalShowScopeSelector) {
setFocusSection((s) => (s === 'settings' ? 'scope' : 'settings'));
return;
return true;
}

// Escape - close dialog
if (keyMatchers[Command.ESCAPE](key)) {
onClose();
return;
return true;
}

return;
return false;
},
{
isActive: true,
Expand Down