feat(FN-4227): add clickable file path links across dashboard
- Add reusable file path linkification utilities and FileBrowser context wiring across dashboard modals and log surfaces - Linkify task detail, review, workflow, chat, activity, agent, dev server, and settings sync outputs so workspace paths open in the file browser - Preserve inline code styling when wrapping detected paths and extend FileBrowserModal handling for linked navigation - Cover the new linking behavior with dashboard tests and add a changeset plus AGENTS guidance for the reusable pattern Fusion-Task-Id: FN-4227
This commit is contained in:
@@ -204,6 +204,31 @@ describe("useModalManager", () => {
|
||||
expect(result.current.detailTaskInitialTab).toBe("definition");
|
||||
});
|
||||
|
||||
it.each([
|
||||
[undefined, undefined, null],
|
||||
["worktree-FN-X", undefined, null],
|
||||
[undefined, "packages/foo/bar.ts", "packages/foo/bar.ts"],
|
||||
])("opens files modal with workspace %s and initial file %s", (workspace, initialFile, expectedInitialFile) => {
|
||||
const { result } = renderHook(() =>
|
||||
useModalManager({ projectId: "proj_1", planningSessions: [] }),
|
||||
);
|
||||
|
||||
act(() => {
|
||||
result.current.openFiles(workspace, initialFile);
|
||||
});
|
||||
|
||||
expect(result.current.filesOpen).toBe(true);
|
||||
expect(result.current.fileBrowserInitialFile).toBe(expectedInitialFile);
|
||||
expect(result.current.fileBrowserWorkspace).toBe(workspace ?? "project");
|
||||
|
||||
act(() => {
|
||||
result.current.closeFiles();
|
||||
});
|
||||
|
||||
expect(result.current.filesOpen).toBe(false);
|
||||
expect(result.current.fileBrowserInitialFile).toBeNull();
|
||||
});
|
||||
|
||||
it("accepts plain Task object in openDetailWithChangesTab", () => {
|
||||
const task = createTask("FN-789");
|
||||
const { result } = renderHook(() =>
|
||||
|
||||
Reference in New Issue
Block a user