feat(FN-5098): complete Step 1 — add secrets view-state routing

Fusion-Task-Id: FN-5098
Fusion-Task-Lineage: 67ff982f-f0fa-453a-9b73-32ddc3ae5b3a
This commit is contained in:
Fusion (runfusion.ai)
2026-05-19 01:36:43 -07:00
committed by gsxdsm
parent 0b17d7915c
commit 033b3e7148
2 changed files with 22 additions and 1 deletions

View File

@@ -353,6 +353,26 @@ describe("useViewState", () => {
expect(localStorage.getItem("kb:proj_123:kb-dashboard-task-view")).toBe("graph");
});
it("hydrates secrets from ?view and persists scoped round-trip", async () => {
const originalSearch = window.location.search;
window.history.replaceState({}, "", "?view=secrets");
const { result } = renderHook(() =>
useViewState(
createOptions({
currentProject: PROJECT,
}),
),
);
await waitFor(() => {
expect(result.current.taskView).toBe("secrets");
});
expect(localStorage.getItem("kb:proj_123:kb-dashboard-task-view")).toBe("secrets");
window.history.replaceState({}, "", originalSearch ? `?${originalSearch.replace(/^\?/, "")}` : "/");
});
it("restores and persists plugin task views using the canonical composite key", async () => {
localStorage.setItem("kb:proj_123:kb-dashboard-task-view", "plugin:fusion-plugin-dependency-graph:graph");

View File

@@ -5,7 +5,7 @@ import { getScopedItem, setScopedItem } from "../utils/projectStorage";
import { getPluginViewId, isPluginViewId, isPluginViewRegistered } from "../plugins/pluginViewRegistry";
export type ViewMode = "overview" | "project";
export type BuiltInTaskView = "board" | "list" | "graph" | "agents" | "missions" | "chat" | "documents" | "research" | "evals" | "goalsView" | "skills" | "mailbox" | "insights" | "memory" | "reliability" | "devserver" | "dev-server" | "stash-recovery";
export type BuiltInTaskView = "board" | "list" | "graph" | "agents" | "missions" | "chat" | "documents" | "research" | "evals" | "goalsView" | "skills" | "mailbox" | "insights" | "memory" | "reliability" | "secrets" | "devserver" | "dev-server" | "stash-recovery";
export type PluginTaskView = `plugin:${string}:${string}`;
export type TaskView = BuiltInTaskView | PluginTaskView;
@@ -26,6 +26,7 @@ const BUILT_IN_TASK_VIEWS: readonly BuiltInTaskView[] = [
"insights",
"memory",
"reliability",
"secrets",
"devserver",
"dev-server",
"stash-recovery",