fix: optimistic archiving/closing and tab UX improvements

- Archive agents optimistically on close with rollback on error
- Close tabs immediately instead of waiting for RPC response
- Kill terminals in background with cache invalidation on failure
- Bulk close fires RPC in background, closes all tabs upfront
- Move new-tab button out of scroll area, rename to "New agent tab"
- Support invalidateQueries option in applyArchivedAgentCloseResults
- Fix workspace descriptor id/projectId types (string not number)
This commit is contained in:
Mohamed Boudra
2026-04-06 08:32:10 +07:00
parent 6362d429c7
commit d3e5d6929d
8 changed files with 212 additions and 135 deletions
@@ -42,8 +42,8 @@ describe("normalizeWorkspaceDescriptor", () => {
},
];
const workspace = normalizeWorkspaceDescriptor({
id: 1,
projectId: 1,
id: "1",
projectId: "1",
projectDisplayName: "Project 1",
projectRootPath: "/repo",
workspaceDirectory: "/repo",
@@ -71,8 +71,8 @@ describe("normalizeWorkspaceDescriptor", () => {
it("defaults missing services to an empty array", () => {
const payload = {
id: 1,
projectId: 1,
id: "1",
projectId: "1",
projectDisplayName: "Project 1",
projectRootPath: "/repo",
workspaceDirectory: "/repo",
@@ -82,6 +82,7 @@ describe("normalizeWorkspaceDescriptor", () => {
status: "done",
activityAt: null,
diffStat: null,
services: [],
} as WorkspaceDescriptorPayload;
const workspace = normalizeWorkspaceDescriptor(payload);