feat(KB-656): add autoExpand prop to QuickEntryBox for list view

- Add autoExpand prop to QuickEntryBox component (defaults to true for backward compatibility)
- Pass autoExpand={false} from ListView to prevent automatic expansion on focus
- Keep board view with default auto-expand behavior
- Add test coverage for autoExpand={false} behavior
- Add changeset for patch release
This commit is contained in:
gsxdsm
2026-03-31 23:29:29 -07:00
parent 2a0c660aa8
commit 48c4c357b4
5 changed files with 23 additions and 7 deletions

View File

@@ -22,6 +22,11 @@ interface QuickEntryBoxProps {
* Called when the user clicks the "Subtask" button to trigger subtask breakdown.
*/
onSubtaskBreakdown?: (description: string) => void;
/**
* When false, the component will not auto-expand on focus.
* Defaults to true for backward compatibility.
*/
autoExpand?: boolean;
}
function getModelSelectionValue(provider?: string, modelId?: string): string {
@@ -44,7 +49,7 @@ function parseModelSelection(value: string): { provider?: string; modelId?: stri
};
}
export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels, onPlanningMode, onSubtaskBreakdown }: QuickEntryBoxProps) {
export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels, onPlanningMode, onSubtaskBreakdown, autoExpand = true }: QuickEntryBoxProps) {
const [description, setDescription] = useState(() => {
if (typeof window !== "undefined") {
return localStorage.getItem(STORAGE_KEY) || "";
@@ -309,8 +314,11 @@ export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels,
justResetRef.current = false;
return;
}
setIsExpanded(true);
}, []);
// Only auto-expand if autoExpand prop is true (defaults to true for backward compatibility)
if (autoExpand) {
setIsExpanded(true);
}
}, [autoExpand]);
const handleBlur = useCallback(() => {
// Clear any existing timeout