refactor: remove draft agent routes and consolidate terminal output into session model
This commit is contained in:
@@ -34,9 +34,9 @@ describe("keyboard-shortcut-routing", () => {
|
||||
expect(canToggle).toBe(true);
|
||||
});
|
||||
|
||||
it("allows the shortcut on draft routes", () => {
|
||||
it("allows the shortcut on workspace draft-tab routes", () => {
|
||||
const canToggle = canToggleFileExplorerShortcut({
|
||||
pathname: "/h/server-1/new",
|
||||
pathname: "/h/server-1/workspace/workspace-1/tab/draft_123",
|
||||
toggleFileExplorer,
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ describe("keyboard-shortcut-routing", () => {
|
||||
|
||||
it("blocks the shortcut when no toggle handler exists", () => {
|
||||
const canToggle = canToggleFileExplorerShortcut({
|
||||
pathname: "/h/server-1/new",
|
||||
pathname: "/h/server-1/workspace/workspace-1/tab/draft_123",
|
||||
});
|
||||
|
||||
expect(canToggle).toBe(false);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
parseHostAgentDraftRouteFromPathname,
|
||||
parseHostAgentRouteFromPathname,
|
||||
parseHostWorkspaceRouteFromPathname,
|
||||
parseHostWorkspaceTabRouteFromPathname,
|
||||
@@ -29,11 +28,7 @@ export function resolveSelectedOrRouteAgentKey(input: {
|
||||
|
||||
const route = parseHostAgentRouteFromPathname(input.pathname);
|
||||
if (!route) {
|
||||
const draftRoute = parseHostAgentDraftRouteFromPathname(input.pathname);
|
||||
if (!draftRoute) {
|
||||
return null;
|
||||
}
|
||||
return `${draftRoute.serverId}:${DRAFT_AGENT_ID}`;
|
||||
return null;
|
||||
}
|
||||
return `${route.serverId}:${route.agentId}`;
|
||||
}
|
||||
@@ -54,9 +49,5 @@ export function canToggleFileExplorerShortcut(input: {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (parseHostAgentDraftRouteFromPathname(input.pathname)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user