mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 16:59:43 +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:
@@ -97,8 +97,11 @@ export class FakeEl {
|
||||
getAttribute(k: string) {
|
||||
return this.attrs[k] ?? null;
|
||||
}
|
||||
addEventListener(type: string, fn: (ev: unknown) => void) {
|
||||
/** Per event type, whether each listener was registered for the capture phase. */
|
||||
captureFlags: Record<string, boolean[]> = {};
|
||||
addEventListener(type: string, fn: (ev: unknown) => void, opts?: boolean | { capture?: boolean }) {
|
||||
(this.listeners[type] ||= []).push(fn);
|
||||
(this.captureFlags[type] ||= []).push(opts === true || (typeof opts === 'object' && !!opts?.capture));
|
||||
}
|
||||
dispatch(type: string, ev: unknown = {}) {
|
||||
for (const fn of this.listeners[type] ?? []) fn(ev);
|
||||
|
||||
Reference in New Issue
Block a user