mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 09:41:04 +01:00
Make streamlined left sidebar default to on
Flip enableStreamlinedLeftNavigation to default ON so all users get the streamlined sidebar while preserving explicit opt-out via experiments. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
ef0ccf6959
commit
7af78be945
7 files changed
+50
-13
No files matched your search
@@ -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),
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 (PAP-89): 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).
|
||||
|
||||
@@ -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<HTMLButtonElement>(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();
|
||||
|
||||
|
||||
@@ -232,8 +232,10 @@ export function InstanceExperimentalSettings() {
|
||||
|
||||
const enableEnvironments = experimentalQuery.data?.enableEnvironments === true;
|
||||
const enableIsolatedWorkspaces = experimentalQuery.data?.enableIsolatedWorkspaces === true;
|
||||
// Default ON (PAPA-952): 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;
|
||||
|
||||
Reference in new issue
Block a user