mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 08:59:40 +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:
@@ -213,6 +213,28 @@ describe('"Open group as tiles"', () => {
|
||||
expect(app._tileGrid.ids).toEqual(['s-c', 's-a']);
|
||||
});
|
||||
|
||||
it('keeps the focused session focused when the group holds it, open grid or not', () => {
|
||||
for (const gridOpen of [false, true]) {
|
||||
resetGridHarness();
|
||||
const app = makeGridApp(IDS);
|
||||
withGroups(app);
|
||||
if (gridOpen) app.openTileGrid(['s-b', 's-a'], { focusedId: 's-a' });
|
||||
else app.activeSessionId = 's-a';
|
||||
app.openGroupAsTiles('g1');
|
||||
expect(app._tileGrid.ids).toEqual(['s-c', 's-a']);
|
||||
expect(app._tileGrid.focusedId).toBe('s-a');
|
||||
expect(app.activeSessionId).toBe('s-a');
|
||||
}
|
||||
});
|
||||
|
||||
it("focuses the group's first session when it does not hold the focused one", () => {
|
||||
const app = makeGridApp(IDS);
|
||||
withGroups(app);
|
||||
app.openTileGrid(['s-b']);
|
||||
app.openGroupAsTiles('g1');
|
||||
expect(app._tileGrid.focusedId).toBe('s-c');
|
||||
});
|
||||
|
||||
it('is not offered where the grid cannot open', () => {
|
||||
const app = makeGridApp(IDS);
|
||||
const actions = withGroups(app);
|
||||
|
||||
Reference in New Issue
Block a user