diff --git a/packages/shared/src/validators/instance.ts b/packages/shared/src/validators/instance.ts index 9015b094fb..66119debf6 100644 --- a/packages/shared/src/validators/instance.ts +++ b/packages/shared/src/validators/instance.ts @@ -41,7 +41,7 @@ export const patchInstanceGeneralSettingsSchema = instanceGeneralSettingsSchema. export const instanceExperimentalSettingsSchema = z.object({ enableEnvironments: z.boolean().default(false), enableIsolatedWorkspaces: z.boolean().default(false), - enableStreamlinedLeftNavigation: z.boolean().default(false), + enableStreamlinedLeftNavigation: z.boolean().default(true), enableConferenceRoomChat: z.boolean().default(false), enableTaskWatchdogs: z.boolean().default(false), enableIssuePlanDecompositions: z.boolean().default(false), diff --git a/server/src/__tests__/instance-settings-service.test.ts b/server/src/__tests__/instance-settings-service.test.ts index dd83b47b37..30b595e59a 100644 --- a/server/src/__tests__/instance-settings-service.test.ts +++ b/server/src/__tests__/instance-settings-service.test.ts @@ -17,9 +17,8 @@ describe("instance settings service", () => { })).toEqual({ enableEnvironments: true, enableIsolatedWorkspaces: true, - enableStreamlinedLeftNavigation: false, + enableStreamlinedLeftNavigation: true, enableConferenceRoomChat: false, - enableTaskWatchdogs: false, enableIssuePlanDecompositions: true, enableExperimentalFileViewer: true, enableTaskWatchdogs: true, @@ -54,7 +53,7 @@ describe("instance settings service", () => { const current = normalizeExperimentalSettings({}); const enabled = normalizeExperimentalSettings({ ...current, enableConferenceRoomChat: true }); expect(enabled.enableConferenceRoomChat).toBe(true); - expect(enabled.enableStreamlinedLeftNavigation).toBe(false); + expect(enabled.enableStreamlinedLeftNavigation).toBe(true); const disabled = normalizeExperimentalSettings({ ...enabled, enableConferenceRoomChat: false }); expect(disabled).toEqual(current); diff --git a/server/src/services/instance-settings.ts b/server/src/services/instance-settings.ts index d18a5bbdd5..03bf2c02e5 100644 --- a/server/src/services/instance-settings.ts +++ b/server/src/services/instance-settings.ts @@ -46,7 +46,7 @@ export function normalizeExperimentalSettings(raw: unknown): InstanceExperimenta return { enableEnvironments: parsed.data.enableEnvironments ?? false, enableIsolatedWorkspaces: parsed.data.enableIsolatedWorkspaces ?? false, - enableStreamlinedLeftNavigation: parsed.data.enableStreamlinedLeftNavigation ?? false, + enableStreamlinedLeftNavigation: parsed.data.enableStreamlinedLeftNavigation ?? true, enableConferenceRoomChat: parsed.data.enableConferenceRoomChat ?? false, enableIssuePlanDecompositions: parsed.data.enableIssuePlanDecompositions ?? false, enableExperimentalFileViewer: parsed.data.enableExperimentalFileViewer ?? false, @@ -62,7 +62,7 @@ export function normalizeExperimentalSettings(raw: unknown): InstanceExperimenta return { enableEnvironments: false, enableIsolatedWorkspaces: false, - enableStreamlinedLeftNavigation: false, + enableStreamlinedLeftNavigation: true, enableConferenceRoomChat: false, enableTaskWatchdogs: false, enableIssuePlanDecompositions: false, diff --git a/ui/src/components/Sidebar.test.tsx b/ui/src/components/Sidebar.test.tsx index df06f89137..71af3f005f 100644 --- a/ui/src/components/Sidebar.test.tsx +++ b/ui/src/components/Sidebar.test.tsx @@ -207,6 +207,22 @@ describe("Sidebar", () => { }); }); + it("defaults to streamlined navigation while experimental settings are loading", async () => { + mockInstanceSettingsApi.getExperimental.mockImplementation(() => new Promise(() => {})); + const root = await renderSidebar(); + + const navLabels = [...container.querySelectorAll("nav a")].map((a) => a.textContent?.trim()); + expect(navLabels).toContain("Projects"); + expect(container.querySelector('[data-testid="sidebar-projects"]')).toBeNull(); + expect( + container.querySelector('[data-testid="sidebar-agents"]')?.getAttribute("data-streamlined"), + ).toBe("true"); + + flushSync(() => { + root.unmount(); + }); + }); + it("classic (flag OFF): New Task button, Tasks label, per-project collapsible, no top-level Projects link", async () => { mockInstanceSettingsApi.getExperimental.mockResolvedValue({ enableIsolatedWorkspaces: false, diff --git a/ui/src/components/Sidebar.tsx b/ui/src/components/Sidebar.tsx index 61d3f2b63f..8ccf4a161c 100644 --- a/ui/src/components/Sidebar.tsx +++ b/ui/src/components/Sidebar.tsx @@ -57,11 +57,12 @@ export function Sidebar() { }); const liveRunCount = liveRuns?.length ?? 0; const showWorkspacesLink = experimentalSettings?.enableIsolatedWorkspaces === true; - // IA flag (PAP-89): branch the sidebar nav presentation. Default OFF = classic - // (per-project collapsible, no Projects nav link). ON = streamlined - // (top-level Projects link). Issue/Task wording is split to PR #7651. - // Gating is navigation-only; all routes stay registered in both modes. - const streamlined = experimentalSettings?.enableStreamlinedLeftNavigation === true; + // IA flag: branch the sidebar nav presentation. Default ON = + // streamlined (top-level Projects link). Users can opt out in experiments to + // get classic (per-project collapsible, no Projects nav link). Issue/Task + // wording is split to PR #7651. Gating is navigation-only; all routes stay + // registered in both modes. + const streamlined = experimentalSettings?.enableStreamlinedLeftNavigation !== false; // Conference Room Chat flag (PAP-136/PAP-137): the Conference Room nav item // is a new surface, hidden entirely while the flag is off (same no-flash // pattern as showWorkspacesLink above). diff --git a/ui/src/pages/InstanceExperimentalSettings.test.tsx b/ui/src/pages/InstanceExperimentalSettings.test.tsx index 6e6247e774..6a8d8dd5ff 100644 --- a/ui/src/pages/InstanceExperimentalSettings.test.tsx +++ b/ui/src/pages/InstanceExperimentalSettings.test.tsx @@ -40,6 +40,8 @@ async function flushReact() { const CONFERENCE_TOGGLE_SELECTOR = 'button[aria-label="Toggle conference room chat experimental setting"]'; +const STREAMLINED_TOGGLE_SELECTOR = + 'button[aria-label="Toggle streamlined left navigation experimental setting"]'; const TASK_WATCHDOGS_TOGGLE_SELECTOR = 'button[aria-label="Toggle task watchdogs experimental setting"]'; @@ -47,7 +49,7 @@ function defaultExperimentalSettings(): InstanceExperimentalSettingsPayload { return { enableEnvironments: false, enableIsolatedWorkspaces: false, - enableStreamlinedLeftNavigation: false, + enableStreamlinedLeftNavigation: true, enableConferenceRoomChat: false, enableIssuePlanDecompositions: false, enableExperimentalFileViewer: false, @@ -132,6 +134,23 @@ describe("InstanceExperimentalSettings — Conference Room Chat card (PAP-11233) expect(mockInstanceSettingsApi.updateExperimental).not.toHaveBeenCalled(); }); + it("renders the Streamlined Left Navigation toggle on by default and patches opt-out", async () => { + await renderPage(); + + const toggle = container.querySelector(STREAMLINED_TOGGLE_SELECTOR); + expect(toggle?.getAttribute("aria-checked")).toBe("true"); + + await act(async () => { + toggle?.click(); + }); + await flushReact(); + + expect(mockInstanceSettingsApi.updateExperimental).toHaveBeenCalledWith({ + enableStreamlinedLeftNavigation: false, + }); + expect(toggle?.getAttribute("aria-checked")).toBe("false"); + }); + it("renders and patches the Task Watchdogs experimental toggle on and off", async () => { await renderPage(); diff --git a/ui/src/pages/InstanceExperimentalSettings.tsx b/ui/src/pages/InstanceExperimentalSettings.tsx index 0e39845adf..e16ab3501a 100644 --- a/ui/src/pages/InstanceExperimentalSettings.tsx +++ b/ui/src/pages/InstanceExperimentalSettings.tsx @@ -232,8 +232,10 @@ export function InstanceExperimentalSettings() { const enableEnvironments = experimentalQuery.data?.enableEnvironments === true; const enableIsolatedWorkspaces = experimentalQuery.data?.enableIsolatedWorkspaces === true; + // Default ON: treat anything but an explicit `false` as enabled so + // the toggle reflects the streamlined sidebar being the default experience. const enableStreamlinedLeftNavigation = - experimentalQuery.data?.enableStreamlinedLeftNavigation === true; + experimentalQuery.data?.enableStreamlinedLeftNavigation !== false; const enableConferenceRoomChat = experimentalQuery.data?.enableConferenceRoomChat === true; const enableIssuePlanDecompositions = experimentalQuery.data?.enableIssuePlanDecompositions === true;