fix(tiles): popping out a tiled session keeps the grid's count

A session popped out while the grid was open (its pop-out button, or
another dashboard tab announcing the pop-out over the window channel) left
the grid through _markDetached, which removed its tile as if the user had
closed it: the stored count dropped to five and its cell stayed a hole the
ranking never filled, so after the window re-docked Tiles off and on showed
five tiles and an empty cell. Popping out with the grid closed, or a reload
reconcile, already kept the count and refilled the cell.

_markDetached now removes the tile as `gone` (it left by itself), the same
as a deleted session or a refused socket, so the count stays and the next
activation fills the cell from the ranking.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-10 06:30:08 +02:00
1 parent 3a40dae1dd
commit 7b95856cc5
3 files changed
+29 -3

No files matched your search

+5 -2
View File
@@ -1820,8 +1820,11 @@ class CodemanApp {
_markDetached(id, on) {
if (on) this.detachedSessions.add(id); else this.detachedSessions.delete(id);
// A popped-out session's window owns its PTY size now, so it leaves the
// tile grid (one place per session in this browser tab).
if (on && this._tileGrid?.has(id)) this.removeTile(id);
// tile grid (one place per session in this browser tab). `gone`: it left by
// itself, not by a tile the user removed, so the grid's count stays and the
// ranking fills that cell the next time the grid opens, as when it pops out
// with the grid closed.
if (on && this._tileGrid?.has(id)) this.removeTile(id, { gone: true });
const container = this.$('sessionTabs');
const tab = container && container.querySelector(`.session-tab[data-id="${id}"]`);
if (tab) tab.classList.toggle('detached', on);