feat(FN-2975): merge fusion/fn-2975
- Stabilize QuickChatFAB search refresh lifecycle to prevent redundant or stale queries (`useTasks.ts`, `QuickChatFAB.tsx`) - Add unit tests for QuickChatFAB component and `useTasks` hook - Refactor QuickChatFAB styles and component structure Commits merged: - feat(FN-2975): complete Step 2 — stabilize search refresh lifecycle - feat(FN-2972): merge fusion/fn-2972 Files changed: packages/dashboard/app/components/QuickChatFAB.css | 60 ++++++++++++++++---- packages/dashboard/app/components/QuickChatFAB.tsx | 65 +++++++++++----------- .../app/components/__tests__/QuickChatFAB.test.tsx | 32 +++++++++++ .../dashboard/app/hooks/__tests__/useTasks.test.ts | 48 ++++++++++++++++ packages/dashboard/app/hooks/useTasks.ts | 4 +- 5 files changed, 165 insertions(+), 44 deletions(-) Fusion-Task-Id: FN-2975
This commit is contained in:
@@ -109,7 +109,7 @@ export function useTasks(options?: UseTasksOptions) {
|
||||
const refreshTasks = useCallback(async (options?: { clearOnError?: boolean; searchQueryOverride?: string; includeArchivedOverride?: boolean }) => {
|
||||
const requestVersion = ++fetchVersionRef.current;
|
||||
const requestProjectId = projectId; // Capture the projectId for this request
|
||||
const query = options?.searchQueryOverride ?? searchQuery;
|
||||
const query = options?.searchQueryOverride ?? searchQueryRef.current;
|
||||
const wantArchived = options?.includeArchivedOverride ?? includeArchivedRef.current;
|
||||
|
||||
try {
|
||||
@@ -132,7 +132,7 @@ export function useTasks(options?: UseTasksOptions) {
|
||||
}
|
||||
setTasks((current) => current);
|
||||
}
|
||||
}, [projectId, searchQuery]);
|
||||
}, [projectId]);
|
||||
refreshTasksRef.current = refreshTasks;
|
||||
|
||||
/** Lazy-load archived tasks. Called by the Board when the archived column is first expanded. */
|
||||
|
||||
Reference in New Issue
Block a user