Merge InputPrompt and multiline-editor and move autocomplete logic directly into InputPrompt (#453)

This commit is contained in:
Jacob Richman
2025-05-20 16:50:32 -07:00
committed by GitHub
parent 937f473651
commit 02ab0c234c
6 changed files with 598 additions and 459 deletions

View File

@@ -21,15 +21,12 @@ interface ThemeDialogProps {
onHighlight: (themeName: string | undefined) => void;
/** The settings object */
settings: LoadedSettings;
/** Callback to set the query */
setQuery: (query: string) => void;
}
export function ThemeDialog({
onSelect,
onHighlight,
settings,
setQuery,
}: ThemeDialogProps): React.JSX.Element {
const [selectedScope, setSelectedScope] = useState<SettingScope>(
SettingScope.User,
@@ -59,7 +56,6 @@ export function ThemeDialog({
];
const handleThemeSelect = (themeName: string) => {
setQuery(''); // Clear the query when user selects a theme
onSelect(themeName, selectedScope);
};
@@ -82,7 +78,6 @@ export function ThemeDialog({
setFocusedSection((prev) => (prev === 'theme' ? 'scope' : 'theme'));
}
if (key.escape) {
setQuery(''); // Clear the query when user hits escape
onSelect(undefined, selectedScope);
}
});