diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 004baad2..f240defc 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -343,6 +343,7 @@ export function App() { } /> } /> } /> + } /> } /> }> {boardRoutes()} diff --git a/ui/src/lib/company-routes.test.ts b/ui/src/lib/company-routes.test.ts new file mode 100644 index 00000000..d6dc2668 --- /dev/null +++ b/ui/src/lib/company-routes.test.ts @@ -0,0 +1,23 @@ +import { describe, expect, it } from "vitest"; +import { + applyCompanyPrefix, + extractCompanyPrefixFromPath, + isBoardPathWithoutPrefix, + toCompanyRelativePath, +} from "./company-routes"; + +describe("company routes", () => { + it("treats execution workspace paths as board routes that need a company prefix", () => { + expect(isBoardPathWithoutPrefix("/execution-workspaces/workspace-123")).toBe(true); + expect(extractCompanyPrefixFromPath("/execution-workspaces/workspace-123")).toBeNull(); + expect(applyCompanyPrefix("/execution-workspaces/workspace-123", "PAP")).toBe( + "/PAP/execution-workspaces/workspace-123", + ); + }); + + it("normalizes prefixed execution workspace paths back to company-relative paths", () => { + expect(toCompanyRelativePath("/PAP/execution-workspaces/workspace-123")).toBe( + "/execution-workspaces/workspace-123", + ); + }); +}); diff --git a/ui/src/lib/company-routes.ts b/ui/src/lib/company-routes.ts index b8d51fd5..48d71ef2 100644 --- a/ui/src/lib/company-routes.ts +++ b/ui/src/lib/company-routes.ts @@ -6,6 +6,7 @@ const BOARD_ROUTE_ROOTS = new Set([ "org", "agents", "projects", + "execution-workspaces", "issues", "routines", "goals",