Show full paths in command palette switcher

https://feedback.yaak.app/p/command-palette-search-should-include-parent-folder-names
This commit is contained in:
Gregory Schier
2025-11-03 05:54:29 -08:00
parent c8d5e7c97b
commit f3e44c53d7
4 changed files with 36 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ import {
} from 'react';
import { useRandomKey } from '../../hooks/useRandomKey';
import { useStateWithDeps } from '../../hooks/useStateWithDeps';
import { generateId } from '../../lib/generateId';
import { IconButton } from './IconButton';
import type { InputProps } from './Input';
import { Label } from './Label';
@@ -99,7 +100,7 @@ export const PlainInput = forwardRef<{ focus: () => void }, PlainInputProps>(fun
}
}, [regenerateFocusedUpdateKey, defaultValue]);
const id = `input-${name}`;
const id = useRef(`input-${generateId()}`);
const commonClassName = classNames(
className,
'!bg-transparent min-w-0 w-full focus:outline-none placeholder:text-placeholder',
@@ -134,7 +135,7 @@ export const PlainInput = forwardRef<{ focus: () => void }, PlainInputProps>(fun
)}
>
<Label
htmlFor={id}
htmlFor={id.current}
className={labelClassName}
visuallyHidden={hideLabel}
required={required}
@@ -177,10 +178,11 @@ export const PlainInput = forwardRef<{ focus: () => void }, PlainInputProps>(fun
)}
>
<input
id={id}
id={id.current}
ref={inputRef}
key={forceUpdateKey}
type={type === 'password' && !obscured ? 'text' : type}
name={name}
defaultValue={defaultValue ?? undefined}
autoComplete="off"
autoCapitalize="off"