feat(KB-656): keep list quick entry collapsed on focus

- Add an autoExpand prop to QuickEntryBox with default focus expansion behavior
- Preserve manual expand and blur persistence while allowing list view to opt out
- Add coverage for autoExpand={false} behavior in QuickEntryBox tests
- Include a published-package changeset describing the quick entry behavior change
This commit is contained in:
gsxdsm
2026-04-01 12:25:00 -07:00
parent 5e257adbc9
commit 78f6a76fd2
3 changed files with 17 additions and 6 deletions

View File

@@ -325,8 +325,11 @@ export function QuickEntryBox({ onCreate, addToast, tasks = [], availableModels,
justResetRef.current = false;
return;
}
// No auto-expand on focus — manual toggle only
}, []);
// Only auto-expand if autoExpand prop is true (defaults to true for backward compatibility)
if (autoExpand) {
setIsExpanded(true);
}
}, [autoExpand]);
const handleBlur = useCallback(() => {
// No auto-collapse on blur — state persists until manually toggled or task is submitted/cancelled

View File

@@ -210,6 +210,16 @@ describe("QuickEntryBox", () => {
expect(textarea.classList.contains("quick-entry-input--expanded")).toBe(true);
});
it("does not expand on focus when autoExpand is false", () => {
renderQuickEntryBox({ autoExpand: false });
const textarea = screen.getByTestId("quick-entry-input");
fireEvent.focus(textarea);
// Should not expand when autoExpand is false
expect(textarea.classList.contains("quick-entry-input--expanded")).toBe(false);
});
it("toggle button collapses the view when expanded", () => {
renderQuickEntryBox();
const textarea = screen.getByTestId("quick-entry-input");