feat(FN-3079): add plugin dashboard views and dependency graph plugin

- Add plugin dashboard view registration and hosting across core, dashboard routes, and plugin SDK exports
- Integrate plugin-provided views into app navigation, mobile/header UI, and view state hooks with coverage
- Add fusion-plugin-dependency-graph example plugin with persisted storage, dashboard view UI, and manifest wiring
- Update plugin authoring and architecture docs for dashboard view extension points
- Add a changeset for @runfusion/fusion covering plugin dashboard view support

Fusion-Task-Id: FN-3079
This commit is contained in:
Fusion
2026-05-01 23:32:32 -07:00
committed by gsxdsm
parent ed477f8c71
commit 9e52028102
38 changed files with 1264 additions and 16 deletions

View File

@@ -0,0 +1,31 @@
import { describe, expect, it, beforeEach } from "vitest";
import { projectScopedKey, loadPositions, savePositions } from "../storage";
const createMemoryStorage = () => {
const map = new Map<string, string>();
return {
getItem: (key: string) => map.get(key) ?? null,
setItem: (key: string, value: string) => {
map.set(key, value);
},
clear: () => map.clear(),
};
};
describe("storage", () => {
const localStorage = createMemoryStorage();
beforeEach(() => {
(globalThis as { window?: { localStorage?: typeof localStorage } }).window = { localStorage };
localStorage.clear();
});
it("builds project-scoped key", () => {
expect(projectScopedKey("proj_123")).toBe("kb:proj_123:dependency-graph-positions");
});
it("persists and restores positions", () => {
savePositions("proj_123", { "FN-1": { x: 10, y: 20 } });
expect(loadPositions("proj_123")).toEqual({ "FN-1": { x: 10, y: 20 } });
});
});