feat: add workspace-aware notification routing and clean up agent screen header
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user