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 6d84ce3ba1
commit 4aa028c14e
3 changed files with 17 additions and 6 deletions

View File

@@ -1,7 +1,5 @@
---
"@fusion/dashboard": patch
"@gsxdsm/fusion": patch
---
Don't auto expand the quick add view in list view
Added `autoExpand` prop to QuickEntryBox component to control auto-expand behavior. List view now passes `autoExpand={false}` to keep the interface clean, while board view continues to auto-expand by default.
Keep the list-view quick add input collapsed on focus while preserving board-view auto-expand behavior.

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");