* feat(plugins): add workspace panels and command center contributions Give local plugins contextual UI entry points without making the daemon interpret client placement or callbacks. Panels receive stable IDs and read cached client state through required selectors with shallow equality, avoiding unrelated guest rerenders and context-discovery RPCs. * fix(plugins): align shared client state ownership Workspace panels and Command Center callbacks consume the same frozen client snapshots, so their adapter belongs to the plugin boundary rather than either contribution surface. Refresh the Nix dependency hash for the selector-store dependency added by this feature.
22 lines
901 B
TypeScript
22 lines
901 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { shallowEqual } from "./shallow.js";
|
|
|
|
describe("plugin selector shallow equality", () => {
|
|
it("keeps equivalent selector objects and arrays stable", () => {
|
|
const shared = { id: "shared" };
|
|
expect(shallowEqual({ name: "Paseo", shared }, { name: "Paseo", shared })).toBe(true);
|
|
expect(shallowEqual(["Paseo", shared], ["Paseo", shared])).toBe(true);
|
|
expect(shallowEqual({ name: "Paseo" }, { name: "Changed" })).toBe(false);
|
|
});
|
|
|
|
it("compares map and set selections by their shallow entries", () => {
|
|
expect(shallowEqual(new Map([["status", "running"]]), new Map([["status", "running"]]))).toBe(
|
|
true,
|
|
);
|
|
expect(shallowEqual(new Set(["workspace", "agent"]), new Set(["workspace", "agent"]))).toBe(
|
|
true,
|
|
);
|
|
expect(shallowEqual(new Set(["workspace"]), new Set(["agent"]))).toBe(false);
|
|
});
|
|
});
|