mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 16:59:43 +02:00
fix(tiles): "Open group as tiles" keeps the focused session focused
With the grid already open, openGroupAsTiles closed it (which sets activeSessionId to null, so re-parking does not snapshot the parked terminal) and only then chose the focus, so the active session was never "in the group" and the group's first session always took focus. The picker's Open chooses before closing. Now both do: the focused session keeps focus when the group holds it, otherwise the group's first session gets it. tile-grid-entry-points covers both cases, with the grid open and closed; the open-grid case failed before this change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -879,13 +879,15 @@ Object.assign(CodemanApp.prototype, {
|
||||
this.showToast?.('This group has no session to show as tiles', 'info');
|
||||
return false;
|
||||
}
|
||||
// Before the open grid closes (which drops activeSessionId): the session in
|
||||
// focus keeps it if the group holds it, as with the picker's Open.
|
||||
const focus = ids.includes(this.activeSessionId) ? this.activeSessionId : ids[0];
|
||||
if (this._tilesOwnTerminal()) {
|
||||
this.closeTileGrid({ keepStored: false, reselect: false });
|
||||
// As selectSession's tile branch: the parked terminal still holds what it
|
||||
// showed before the grid, and re-parking must not snapshot it.
|
||||
this.activeSessionId = null;
|
||||
}
|
||||
const focus = ids.includes(this.activeSessionId) ? this.activeSessionId : ids[0];
|
||||
return this.openTileGrid(ids, { focusedId: focus });
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user