mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-10 09:19:42 +02:00
feat(tiles): drag a tab onto a tile, Ctrl/Cmd+click a tab, "Open group as tiles"
Three more ways into the grid: - Drag a session tab from the strip onto a tile: a session not yet tiled replaces that tile in place (the replaced session keeps running); one already tiled swaps places with it. A layout that is not full (3 tiles in a 2x2, 5 in a 3x2) shows its empty cells as slots, and a tab dropped on one joins the grid there. Tiles and slots handle the drag in the capture phase and stop it, because its payload is the session id as text and xterm's helper textarea would type it into the PTY; a drag that is not a tab (a file) is left alone. The dropped session takes focus (a human selection). A sorted or grouped rail does not offer tab dragging, so neither does this. - Ctrl/Cmd+click on a tab puts that session in the grid and focuses it, opening the grid on what the Tiles toggle would bring back if it was closed; on a window too narrow for the grid it stays an ordinary click. - "Open group as tiles" in the grouped rail's group menu makes the group's live sessions (as many as the window fits) the grid. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6438,6 +6438,10 @@ class CodemanApp {
|
||||
|
||||
handleSessionTabClick(event, sessionId) {
|
||||
event?.preventDefault?.();
|
||||
// Ctrl/Cmd+click puts the session in the tile grid (opening it if needed)
|
||||
// instead of switching to it; on a window too narrow for the grid it is an
|
||||
// ordinary click.
|
||||
if ((event?.ctrlKey || event?.metaKey) && this.addSessionToTiles?.(sessionId)) return;
|
||||
// On touch with the keyboard hidden, blur the tapped tab so switching
|
||||
// sessions doesn't pop the on-screen keyboard. Focus policy itself lives
|
||||
// in selectSession via _shouldFocusTerminalForTabSwitch().
|
||||
@@ -6914,6 +6918,7 @@ class CodemanApp {
|
||||
const index = groups.findIndex((group) => group.id === groupId);
|
||||
if (index < 0) return false;
|
||||
return this._openTabLayoutMenu(event, `group:${groupId}`, 'Group actions', [
|
||||
...(this.canOpenTileGrid?.() ? [{ label: 'Open group as tiles', run: () => this.openGroupAsTiles(groupId) }] : []),
|
||||
{ label: 'Rename group', run: () => this.startTabGroupRename(groupId) },
|
||||
...(this._canCreateTabGroup() ? [{ label: 'New group', run: () => this.createTabGroup({ index: index + 1 }) }] : []),
|
||||
...(index > 0 ? [{ label: 'Move group up', run: () => this.moveTabGroup(groupId, -1) }] : []),
|
||||
|
||||
Reference in New Issue
Block a user