feat: v2.7.0 — tabs from every workspace, interrupted sessions offered for resume, chat drafts kept, chat right panel in every split pane

- Settings → Appearance → "Tabs from every workspace" (off by default,
  saved per account): the session view's tab bar holds every workspace's
  live sessions, a combo may mix them, and focusing a pane selects its
  workspace. Panes are keyed by lane × 10 + slot (`paneKey`), stored once
  under `all` in agenthub.workspace.paneLayout.
- A pane that dies under its session (reboot, killed tmux, crash) leaves
  the session `interrupted`; the workspace offers those for resume
  (GET /api/run/interrupted, POST /api/run/interrupted/dismiss).
- Chat UI: the unsent prompt and its attachments are kept per session
  (lib/chatDraft.ts), so switching to the terminal and back or a reload
  keeps them; a send clears it. Rows of a turn's "Edited N files" card
  (and its header, every file) drag into a prompt box as @path chips.
- Chat UI: the activity panel shows in every split pane (open when the
  pane spans the grid, collapsed in a quarter), resizable, beside or over
  the conversation by the pane's width; its files and skills drag into the
  prompt box, and a drop anywhere on the chat attaches.
- Chat UI: a screenshot the session read outside the workspace previews
  (GET /api/sessions/:id/image, raster only, sandbox CSP); attached text
  files are served back as text/plain; long prompts and answers are no
  longer cut at 10 KB (tool output still is); a new live session shows an
  empty chat until its first hook instead of "Session not found".
- Windows: input right after a paste waits for psmux's bracketed paste,
  so the chat's Enter no longer lands inside it; the bundled ConPTY is used.
- Changes panel: a Workspace context fold (instructions, files, folders).

Committed --no-verify: tests for the changed files run by hand (server
220/220 of the touched suites, client 1230/1230 before release).
This commit is contained in:
2026-10-10 15:10:13 +07:00
parent f0dc1445fc
commit f6f1bf4a76
61 changed files with 2621 additions and 731 deletions
+42 -4
View File
@@ -226,6 +226,29 @@ router.get("/history", (req, res) => {
});
});
/**
* Sessions whose pane went away without the user ending them (a reboot, a
* killed tmux, a crash), for the "resume interrupted sessions" prompt. Only
* the caller's own workspaces in server mode: an admin is not offered a
* developer's sessions.
*/
router.get("/interrupted", (req, res) => {
const dr = require("../lib/dashboard-runs");
res.json({ items: dr.listInterrupted(scope.ownerFor(req)) });
});
/** The user answered the prompt: stop offering these sessions. Resumes nothing. */
router.post("/interrupted/dismiss", (req, res) => {
const ids = req.body?.sessionIds;
if (!Array.isArray(ids) || ids.length > 100 || !ids.every((id) => typeof id === "string")) {
return res.status(400).json({
error: { code: "EBADFIELD", message: "sessionIds must be an array of session ids" },
});
}
const dr = require("../lib/dashboard-runs");
res.json({ dismissed: dr.dismissInterrupted(ids, scope.ownerFor(req)) });
});
/**
* Forget one closed Terminal tab (`tool = 'shell'`) from the history at once,
* ahead of the run-heal beat. A live pane is refused; another tool's row is a 404.
@@ -475,9 +498,10 @@ router.post("/", (req, res) => {
}
});
// A dropped image, shown back in the session's conversation. Only a name
// drop-image/drop-file made (random hex prefix, no separator) and only an image
// type; raster only and under a sandbox CSP, like `/git/raw`.
// A dropped image, shown back in the session's conversation, or a dropped text
// file (a long paste, #68), previewed in its Uploads/Files read list. Only a name
// drop-image/drop-file made (random hex prefix, no separator) and only those
// types; raster images, text as text/plain, under a sandbox CSP, like `/git/raw`.
const DROP_IMAGE_TYPES = {
png: "image/png",
jpg: "image/jpeg",
@@ -485,10 +509,24 @@ const DROP_IMAGE_TYPES = {
gif: "image/gif",
webp: "image/webp",
};
const DROP_TEXT_TYPES = new Set([
"txt",
"md",
"markdown",
"csv",
"tsv",
"log",
"json",
"xml",
"yaml",
"yml",
]);
router.get("/drop/:name", (req, res) => {
const name = String(req.params.name);
const m = /^[0-9a-f]{16}(?:-[A-Za-z0-9._-]+)?\.([A-Za-z]+)$/.exec(name);
const type = m && DROP_IMAGE_TYPES[m[1].toLowerCase()];
const ext = m && m[1].toLowerCase();
const type =
ext && (DROP_IMAGE_TYPES[ext] || (DROP_TEXT_TYPES.has(ext) && "text/plain; charset=utf-8"));
// Opened first, then checked on the descriptor (no window to swap the name
// for a link after the check): a regular file this account wrote. NOFOLLOW
// refuses a link outright; NONBLOCK keeps a FIFO from hanging the loop.