feat(FN-947): show files-changed on done column task cards

- Extend useSessionFiles hook to fetch files for done column tasks
- Update TaskCard to display files-changed indicator on done column cards
- Add tests for useSessionFiles done column support
- Add tests for TaskCard files-changed display in done column
This commit is contained in:
gsxdsm
2026-04-04 18:54:13 -07:00
parent 648b054cb6
commit 753f2561cd
4 changed files with 165 additions and 12 deletions

View File

@@ -50,4 +50,24 @@ describe("useSessionFiles", () => {
expect(result.current.files).toEqual([]);
});
it("fetches session files for done column tasks with a worktree", async () => {
mockFetchSessionFiles.mockResolvedValueOnce(["src/x.ts", "src/y.ts", "src/z.ts"]);
const { result } = renderHook(() => useSessionFiles("FN-456", "/repo/.worktrees/kb-456", "done"));
await waitFor(() => expect(result.current.loading).toBe(false));
expect(result.current.files).toEqual(["src/x.ts", "src/y.ts", "src/z.ts"]);
expect(mockFetchSessionFiles).toHaveBeenCalledWith("FN-456", undefined);
});
it("does not fetch for done column tasks without a worktree", async () => {
const { result } = renderHook(() => useSessionFiles("FN-456", undefined, "done"));
await waitFor(() => expect(result.current.loading).toBe(false));
expect(result.current.files).toEqual([]);
expect(mockFetchSessionFiles).not.toHaveBeenCalled();
});
});

View File

@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { fetchSessionFiles } from "../api";
const ACTIVE_COLUMNS = new Set(["in-progress", "in-review"]);
const ACTIVE_COLUMNS = new Set(["in-progress", "in-review", "done"]);
interface UseSessionFilesResult {
files: string[];