feat: add workspace-aware notification routing and clean up agent screen header

This commit is contained in:
Mohamed Boudra
2026-03-04 10:37:43 +07:00
parent 3c066f5dd9
commit 6de7756952
8 changed files with 73 additions and 417 deletions
@@ -15,6 +15,7 @@ describe("resolveNotificationTarget", () => {
).toEqual({
serverId: "server-123",
agentId: "agent-456",
workspaceId: null,
});
});
@@ -22,15 +23,27 @@ describe("resolveNotificationTarget", () => {
expect(resolveNotificationTarget({ serverId: "", agentId: " " })).toEqual({
serverId: null,
agentId: null,
workspaceId: null,
});
expect(resolveNotificationTarget(undefined)).toEqual({
serverId: null,
agentId: null,
workspaceId: null,
});
});
});
describe("buildNotificationRoute", () => {
it("routes directly to workspace tab when workspace id is present", () => {
expect(
buildNotificationRoute({
serverId: "srv-1",
agentId: "agent-1",
workspaceId: "/tmp/repo",
})
).toBe("/h/srv-1/workspace/L3RtcC9yZXBv/tab/agent_agent-1");
});
it("routes directly to server-scoped agent path when both ids are present", () => {
expect(buildNotificationRoute({ serverId: "srv-1", agentId: "agent-1" })).toBe(
"/h/srv-1/agent/agent-1"