Broaden board task popup routing so the existing popup setting works outside mobile. - Route ordinary board-card opens to the task popup on desktop, tablet, and mobile when the popup setting is enabled. - Rename the Appearance setting copy while preserving the stored openMobileTasksInPopup key for compatibility. - Update tests, documentation, settings schema comments, and the published package changeset for the all-viewport behavior. Files changed: .changeset/fn-7365-task-popups-all-viewports.md | 7 ++++ docs/dashboard-guide.md | 6 ++-- docs/settings-reference.md | 2 +- packages/core/src/settings-schema.ts | 4 +-- packages/core/src/types.ts | 6 ++-- packages/dashboard/app/App.tsx | 6 ++-- .../__tests__/App.openTasksInRightSidebar.test.ts | 42 +++++++++++++++++----- .../settings/sections/AppearanceSection.tsx | 5 +-- .../sections/__tests__/AppearanceSection.test.tsx | 10 +++--- 9 files changed, 62 insertions(+), 26 deletions(-) Fusion-Task-Id: FN-7365 Fusion-Task-Lineage: 58713922-3ff8-4cc9-8f81-26c1e982819e Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
87 lines
2.8 KiB
TypeScript
87 lines
2.8 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { getBoardTaskOpenRoute, shouldOpenBoardTaskInDock } from "../App";
|
|
|
|
describe("board task detail routing", () => {
|
|
it("opens board card clicks in the dock only when the setting and dock surface are both active", () => {
|
|
expect(shouldOpenBoardTaskInDock(true, true)).toBe(true);
|
|
expect(shouldOpenBoardTaskInDock(false, true)).toBe(false);
|
|
expect(shouldOpenBoardTaskInDock(true, false)).toBe(false);
|
|
});
|
|
|
|
it("keeps deep-tab opens on the existing main-panel path", () => {
|
|
expect(shouldOpenBoardTaskInDock(true, true, "changes")).toBe(false);
|
|
expect(shouldOpenBoardTaskInDock(true, true, "retries")).toBe(false);
|
|
expect(shouldOpenBoardTaskInDock(true, true, "workflow")).toBe(false);
|
|
});
|
|
|
|
it("routes ordinary board card clicks to the popup on mobile, tablet, and desktop when enabled", () => {
|
|
for (const isMobile of [true, false]) {
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile,
|
|
openMobileTasksInPopup: true,
|
|
openTasksInRightSidebar: false,
|
|
rightDockActive: false,
|
|
})).toBe("popup");
|
|
}
|
|
});
|
|
|
|
it("keeps setting-off and undefined values on the existing fallback route", () => {
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile: true,
|
|
openMobileTasksInPopup: false,
|
|
openTasksInRightSidebar: false,
|
|
rightDockActive: false,
|
|
})).toBe("main-panel");
|
|
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile: false,
|
|
openMobileTasksInPopup: undefined as unknown as boolean,
|
|
openTasksInRightSidebar: false,
|
|
rightDockActive: false,
|
|
})).toBe("main-panel");
|
|
});
|
|
|
|
it("gives the popup setting deterministic precedence over desktop and tablet right-dock routing", () => {
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile: false,
|
|
openMobileTasksInPopup: true,
|
|
openTasksInRightSidebar: true,
|
|
rightDockActive: true,
|
|
})).toBe("popup");
|
|
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile: false,
|
|
openMobileTasksInPopup: false,
|
|
openTasksInRightSidebar: true,
|
|
rightDockActive: true,
|
|
})).toBe("dock");
|
|
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile: false,
|
|
openMobileTasksInPopup: true,
|
|
openTasksInRightSidebar: false,
|
|
rightDockActive: true,
|
|
})).toBe("popup");
|
|
});
|
|
|
|
it("keeps deep-tab opens off the all-viewport popup path", () => {
|
|
for (const initialTab of ["changes", "retries", "workflow"] as const) {
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile: true,
|
|
openMobileTasksInPopup: true,
|
|
openTasksInRightSidebar: true,
|
|
rightDockActive: true,
|
|
initialTab,
|
|
})).toBe("main-panel");
|
|
|
|
expect(getBoardTaskOpenRoute({
|
|
isMobile: false,
|
|
openMobileTasksInPopup: true,
|
|
openTasksInRightSidebar: true,
|
|
rightDockActive: true,
|
|
initialTab,
|
|
})).toBe("main-panel");
|
|
}
|
|
});
|
|
});
|