mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
remove unused isSearching field (#14509)
This commit is contained in:
@@ -92,7 +92,6 @@ export function SettingsDialog({
|
|||||||
const [showRestartPrompt, setShowRestartPrompt] = useState(false);
|
const [showRestartPrompt, setShowRestartPrompt] = useState(false);
|
||||||
|
|
||||||
// Search state
|
// Search state
|
||||||
const [isSearching, setIsSearching] = useState(false);
|
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
const [filteredKeys, setFilteredKeys] = useState<string[]>(() =>
|
const [filteredKeys, setFilteredKeys] = useState<string[]>(() =>
|
||||||
getDialogSettingKeys(),
|
getDialogSettingKeys(),
|
||||||
@@ -195,8 +194,7 @@ export function SettingsDialog({
|
|||||||
}, [selectedScope, settings, globalPendingChanges]);
|
}, [selectedScope, settings, globalPendingChanges]);
|
||||||
|
|
||||||
const generateSettingsItems = () => {
|
const generateSettingsItems = () => {
|
||||||
const settingKeys =
|
const settingKeys = searchQuery ? filteredKeys : getDialogSettingKeys();
|
||||||
isSearching || searchQuery ? filteredKeys : getDialogSettingKeys();
|
|
||||||
|
|
||||||
return settingKeys.map((key: string) => {
|
return settingKeys.map((key: string) => {
|
||||||
const definition = getSettingDefinition(key);
|
const definition = getSettingDefinition(key);
|
||||||
@@ -563,33 +561,6 @@ export function SettingsDialog({
|
|||||||
(key) => {
|
(key) => {
|
||||||
const { name } = key;
|
const { name } = key;
|
||||||
|
|
||||||
if (isSearching) {
|
|
||||||
if (keyMatchers[Command.ESCAPE](key)) {
|
|
||||||
setIsSearching(false);
|
|
||||||
setSearchQuery('');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (keyMatchers[Command.RETURN](key)) {
|
|
||||||
setIsSearching(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (name === 'backspace') {
|
|
||||||
setSearchQuery((prev) => prev.slice(0, -1));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
key.sequence &&
|
|
||||||
key.sequence.length === 1 &&
|
|
||||||
!key.ctrl &&
|
|
||||||
!key.meta &&
|
|
||||||
!keyMatchers[Command.DIALOG_NAVIGATION_UP](key) &&
|
|
||||||
!keyMatchers[Command.DIALOG_NAVIGATION_DOWN](key)
|
|
||||||
) {
|
|
||||||
setSearchQuery((prev) => prev + key.sequence);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name === 'tab' && showScopeSelection) {
|
if (name === 'tab' && showScopeSelection) {
|
||||||
setFocusSection((prev) => (prev === 'settings' ? 'scope' : 'settings'));
|
setFocusSection((prev) => (prev === 'settings' ? 'scope' : 'settings'));
|
||||||
}
|
}
|
||||||
@@ -908,7 +879,7 @@ export function SettingsDialog({
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<Box height={1} />
|
<Box height={1} />
|
||||||
{isSearching && visibleItems.length === 0 ? (
|
{visibleItems.length === 0 ? (
|
||||||
<Box marginX={1} height={1} flexDirection="column">
|
<Box marginX={1} height={1} flexDirection="column">
|
||||||
<Text color={theme.text.secondary}>No matches found.</Text>
|
<Text color={theme.text.secondary}>No matches found.</Text>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user