mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 16:59:43 +02:00
feat(tiles): selections with the grid open focus tiles, and never collapse it by themselves
selectSession gets the tile branch, right after its "already active" early return: a tiled session is focused in its tile (_selectTiledSession: an activeSessionId change, the shared _refreshSessionPanels and xterm.focus(), no cleanup, replay, resize or socket of the parked main terminal). Decision 1: a USER-initiated pick of a session that is not tiled leaves the grid for the single view (the grid is remembered), and so does an explicit leaveTiles; an app-driven pick (auto) never collapses it. A followed #session= link passes leaveTiles (navigation). App-driven paths pick a tile instead of the first sessionOrder entry: - closeSession on the focused tile focuses the neighbouring tile (next in grid order, else previous), captured before the await like wasActive, since the delete broadcast may already have removed the tile; the last tile closes the grid and falls back to the normal pick. - A tiled session deleted elsewhere loses its tile and a neighbour takes focus with auto (the last one lands on the welcome screen as before); a close from this tab only drops the tile and leaves the follow-up to closeSession. - A tiled session popped out to its own window leaves the grid. Focus rules: pressing a tile is a human selection (pointerdown, never preventDefault); Ctrl+Tab and Alt+[ / Alt+] cycle through the tiles; only a human selection acknowledges an idle alert. Home leaves the grid (remembered); killing every session closes it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -136,7 +136,7 @@ describe('dashboard handling of a #session=<id> link', () => {
|
||||
const app = make(['a']);
|
||||
app._urlSessionId = 'a';
|
||||
expect(app._selectUrlSession()).toBe(true);
|
||||
expect(app.selectSession).toHaveBeenCalledWith('a', { auto: true });
|
||||
expect(app.selectSession).toHaveBeenCalledWith('a', { auto: true, leaveTiles: true });
|
||||
expect(app._urlSessionId).toBeNull();
|
||||
});
|
||||
|
||||
@@ -149,7 +149,7 @@ describe('dashboard handling of a #session=<id> link', () => {
|
||||
app._onSessionCreated({ id: 'other', name: 'other' });
|
||||
expect(app.selectSession).not.toHaveBeenCalled();
|
||||
app._onSessionCreated({ id: 'new', name: 'new' });
|
||||
expect(app.selectSession).toHaveBeenCalledWith('new', { auto: true });
|
||||
expect(app.selectSession).toHaveBeenCalledWith('new', { auto: true, leaveTiles: true });
|
||||
expect(app._urlSessionId).toBeNull();
|
||||
});
|
||||
|
||||
@@ -234,7 +234,7 @@ describe('a #session=<id> link that is still waiting', () => {
|
||||
app._selectUrlSession();
|
||||
vi.advanceTimersByTime(waitMs - 1);
|
||||
app._onSessionCreated({ id: 'new', name: 'new' });
|
||||
expect(app.selectSession).toHaveBeenCalledWith('new', { auto: true });
|
||||
expect(app.selectSession).toHaveBeenCalledWith('new', { auto: true, leaveTiles: true });
|
||||
expect(app._urlSessionWaitTimer).toBeNull();
|
||||
vi.advanceTimersByTime(waitMs);
|
||||
expect(app.showToast).not.toHaveBeenCalled();
|
||||
|
||||
Reference in New Issue
Block a user