Group and clear workspace status in the sidebar (#1317)
* Add status grouping to the workspace sidebar * Mark workspaces as read from the sidebar * Clean package builds before release checks * Fix sidebar status follow-up checks
This commit is contained in:
@@ -329,6 +329,8 @@ describe("keyboard-shortcuts", () => {
|
||||
context: { isMac: true, isDesktop: false },
|
||||
action: "workspace.navigate.relative",
|
||||
payload: { delta: -1 },
|
||||
preventDefault: true,
|
||||
stopPropagation: true,
|
||||
},
|
||||
{
|
||||
name: "matches Alt+] to next workspace on macOS web when Option substitutes event.key",
|
||||
@@ -336,6 +338,8 @@ describe("keyboard-shortcuts", () => {
|
||||
context: { isMac: true, isDesktop: false },
|
||||
action: "workspace.navigate.relative",
|
||||
payload: { delta: 1 },
|
||||
preventDefault: true,
|
||||
stopPropagation: true,
|
||||
},
|
||||
{
|
||||
name: "matches Alt+Shift+W to close current tab on macOS web when Option substitutes event.key",
|
||||
|
||||
@@ -134,6 +134,13 @@ describe("routeKeyboardShortcut — workspace.navigate.index", () => {
|
||||
});
|
||||
|
||||
describe("routeKeyboardShortcut — workspace.navigate.relative", () => {
|
||||
const STATUS_VISUAL_TARGETS = [
|
||||
{ serverId: "srv", workspaceId: "needs-input" },
|
||||
{ serverId: "srv", workspaceId: "running-new" },
|
||||
{ serverId: "srv", workspaceId: "running-old" },
|
||||
{ serverId: "srv", workspaceId: "done" },
|
||||
] as const;
|
||||
|
||||
it("uses the retained navigation workspace selection over a stale pathname", () => {
|
||||
expect(
|
||||
routeKeyboardShortcut(
|
||||
@@ -150,6 +157,57 @@ describe("routeKeyboardShortcut — workspace.navigate.relative", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("moves from status row 2 to row 3 using status visual target order", () => {
|
||||
expect(
|
||||
routeKeyboardShortcut(
|
||||
{ action: "workspace.navigate.relative", payload: { delta: 1 } },
|
||||
makeCtx({
|
||||
pathname: "/h/srv/workspace/ui-expose-archive-worktrees-on-merge",
|
||||
sidebarShortcutTargets: STATUS_VISUAL_TARGETS,
|
||||
navigationActiveWorkspace: { serverId: "srv", workspaceId: "running-new" },
|
||||
}),
|
||||
),
|
||||
).toEqual<ShortcutAction>({
|
||||
kind: "navigate-workspace",
|
||||
serverId: "srv",
|
||||
workspaceId: "running-old",
|
||||
});
|
||||
});
|
||||
|
||||
it("moves backward from status row 2 to row 1 using status visual target order", () => {
|
||||
expect(
|
||||
routeKeyboardShortcut(
|
||||
{ action: "workspace.navigate.relative", payload: { delta: -1 } },
|
||||
makeCtx({
|
||||
pathname: "/h/srv/workspace/ui-expose-archive-worktrees-on-merge",
|
||||
sidebarShortcutTargets: STATUS_VISUAL_TARGETS,
|
||||
navigationActiveWorkspace: { serverId: "srv", workspaceId: "running-new" },
|
||||
}),
|
||||
),
|
||||
).toEqual<ShortcutAction>({
|
||||
kind: "navigate-workspace",
|
||||
serverId: "srv",
|
||||
workspaceId: "needs-input",
|
||||
});
|
||||
});
|
||||
|
||||
it("moves backward from status row 3 to row 2 using status visual target order", () => {
|
||||
expect(
|
||||
routeKeyboardShortcut(
|
||||
{ action: "workspace.navigate.relative", payload: { delta: -1 } },
|
||||
makeCtx({
|
||||
pathname: "/h/srv/workspace/running-old",
|
||||
sidebarShortcutTargets: STATUS_VISUAL_TARGETS,
|
||||
navigationActiveWorkspace: { serverId: "srv", workspaceId: "running-old" },
|
||||
}),
|
||||
),
|
||||
).toEqual<ShortcutAction>({
|
||||
kind: "navigate-workspace",
|
||||
serverId: "srv",
|
||||
workspaceId: "running-new",
|
||||
});
|
||||
});
|
||||
|
||||
it("falls back to the pathname workspace when no retained selection exists", () => {
|
||||
expect(
|
||||
routeKeyboardShortcut(
|
||||
|
||||
Reference in New Issue
Block a user