feat(tiles): sessions Run from this tab join the open grid; + offers a new session in the tile's case

Every Run path makes each session it created visible through
_ensureCreatedSessionVisible and then selects the first one, a human
selection that used to leave the grid for the single view. That helper now
hands the new session to _joinTileGridFromRun: with the grid open it joins the
next free slot, so Run's selection focuses its tile. No Attach overlay flashes
on it while Run starts its pane. Sessions created elsewhere (agents, other
devices, cron) arrive only by session:created and never join; a grid already
holding what the window fits does not take it, and a hint says the new
session opens on its own.

A tile's + adds "New session in this case": the normal Run (current run mode)
for the case the tile's session belongs to, with the toolbar's case put back
afterwards; the session it creates joins the grid like any Run from this tab.
Disabled for a session outside every case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-06 19:31:16 +02:00
parent 5a58d272ea
commit c206d10e3a
5 changed files with 201 additions and 4 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ describe("a tile's + menu", () => {
app.openTileGrid(['s-a', 's-b']);
app.markIdleAlertSeen.mockClear();
addButtonOf('s-a').dispatch('click', { stopPropagation: vi.fn(), currentTarget: null });
const items = addMenu()!.children;
const items = addMenu()!.children.filter((i) => i.className !== 'tile-add-new');
expect(items.map((i) => i.textContent)).toEqual(['s-other', 's-c']);
items[1].dispatch('click');
expect(app._tileGrid.ids).toEqual(['s-a', 's-b', 's-c']);