fix(FN-673): harden dashboard task resync and Claude usage handling

- resync dashboard tasks after stream reconnects and when the tab becomes visible again
- add regression coverage for stale board recovery and usage-fetch edge cases
- replace direct Claude usage API calls with the CLI-based usage command
- document the dashboard resync safeguards and include a published package changeset
This commit is contained in:
gsxdsm
2026-04-01 13:01:52 -07:00
parent 6a69e83e90
commit 7f47013d13
5 changed files with 483 additions and 33 deletions

View File

@@ -52,15 +52,22 @@ vi.mock("../../api", async (importOriginal) => {
};
});
const mockUseTasks = vi.fn(() => ({
tasks: [],
createTask: vi.fn(),
moveTask: vi.fn(),
deleteTask: vi.fn(),
mergeTask: vi.fn(),
retryTask: vi.fn(),
updateTask: vi.fn(),
duplicateTask: vi.fn(),
archiveTask: vi.fn(),
unarchiveTask: vi.fn(),
archiveAllDone: vi.fn(),
}));
vi.mock("../../hooks/useTasks", () => ({
useTasks: () => ({
tasks: [],
createTask: vi.fn(),
moveTask: vi.fn(),
deleteTask: vi.fn(),
mergeTask: vi.fn(),
retryTask: vi.fn(),
}),
useTasks: () => mockUseTasks(),
}));
vi.mock("../../hooks/useProjects", () => ({
@@ -88,6 +95,20 @@ import { fetchAuthStatus, fetchSettings, fetchTaskDetail, updateSettings } from
beforeEach(() => {
vi.clearAllMocks();
mockUseTasks.mockReset();
mockUseTasks.mockImplementation(() => ({
tasks: [],
createTask: vi.fn(),
moveTask: vi.fn(),
deleteTask: vi.fn(),
mergeTask: vi.fn(),
retryTask: vi.fn(),
updateTask: vi.fn(),
duplicateTask: vi.fn(),
archiveTask: vi.fn(),
unarchiveTask: vi.fn(),
archiveAllDone: vi.fn(),
}));
});
describe("App deep link handling", () => {