mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 08:59:40 +02:00
feat(tiles): the Tiles button opens the grid at once; the picker is on right-click
Owner decision 8 ("when I hit the tiles button, open the tiles already!").
A click with the grid closed now opens it straight away, and Ctrl+Shift+G
runs the same function (toggleTileGrid), so the two cannot drift. What
opens comes from one pure helper, tileGridOpenSet (constants.js):
a. the grid this tab last had, if any of its sessions survive, opened
exactly (an open split closes and its sessions do not join);
b. else an open split's two sessions, Pane A focused;
c. else the open sessions in tab order (the picker's list: no detached
ones), up to what the grid takes here (the cap of 6, fewer when the
window fits fewer), the active session always among them and focused.
A click with the grid open still closes it.
The picker moved to right-click (oncontextmenu, browser menu suppressed).
With the grid open it is preselected with the current tiles, and Open
replaces them. Ctrl/Cmd+click on a tab with the grid closed opens the
toggle's set plus that session. The button's title, the Help modal and
the wiki say right-click chooses which sessions.
Docs: decision 8 and an as-built entry in the spec (Entry points too),
CLAUDE.md, the invariants (#tile-grid, Opening), the wiki's Tile Grid and
Keyboard Shortcuts pages.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -807,6 +807,8 @@ Further detail: with many sessions the horizontal strip stops being scannable, w
|
||||
|
||||
⚠️ **Chords.** `toggle-tile-grid` (Ctrl+Shift+G), `focus-tile-*` (Alt+Shift+Arrows), `zoom-tile` (Alt+Shift+Enter) and `remove-tile` (unbound) are registry entries kept OUT of `SHORTCUT_ACTIONS`: `tileShortcutFor` decides whether one applies (the toggle while the grid is open, or where one could open AND `showTileGridButton` is on, an owner decision: with the setting off the chord is inert and passes through like any unbound key; the rest only while it is open), the capture handler dispatches it, and the main terminal's and every tile's xterm key handler return false for it, for every event type and BEFORE the Shift+Enter gate (Alt+Shift+Enter would otherwise send `S-Enter`). Outside the grid the focus chords reach the terminal untouched.
|
||||
|
||||
⚠️ **Opening.** The Tiles button's click and `Ctrl+Shift+G` are one function, `toggleTileGrid` (owner decision 8), so the two cannot drift. It opens the grid at once on `tileGridOpenSet` (constants.js, pure): (a) the stored grid if any of its sessions survive, opened EXACTLY (`openTileGrid(..., { mergeSplit: false })`: an open split closes and its sessions do not join), (b) else an open split's two sessions, (c) else the picker's list (tab order, no detached sessions) up to `_tileGridLimit().capacity`, the active session always included and focused. Ctrl/Cmd+click with the grid closed opens the same set plus the clicked session. The picker is on right-click (`oncontextmenu`, which calls `preventDefault` for the browser menu); with the grid open it is preselected with the current tiles and Open REPLACES them (close without reselect, null `activeSessionId`, reopen, as "Open group as tiles" does).
|
||||
|
||||
⚠️ **Chrome.** The header is a fixed 24px sibling of the body, refreshed in place on every tab render (`_renderSessionTabsImmediate` wrapper), never by rewriting the tile (that would take its xterm along) and never growing (#464: the body holds the xterm). Header buttons stop pointerdown, so acting on an unfocused tile does not focus it. × removes the tile only; killing stays behind the session menu's Close session. The `needs` pulse animates `box-shadow` only. Dividers are their own 6px grid tracks (`gap: 0`), tiles placed explicitly; a drag uses pointer capture, reflows the affected tiles locally per animation frame and sends ONE `fit()` (one PTY resize) per affected tile at pointer-up; closing the grid or removing a tile mid-drag tears it down. A tab dragged onto a tile replaces it (or swaps two tiles); tiles and empty slots handle `dragover`/`drop` in the CAPTURE phase and stop it, because the drag carries the session id as text and xterm's helper textarea would type it into the PTY.
|
||||
|
||||
⚠️ **Attach.** A tile whose session has no PTY (`pid === null`) or whose socket closed because it exited (4009) shows an Attach overlay (absolute, the body keeps its size): `POST /interactive` (or `/shell`) with NO body, one in flight per session, a tripped PTY-exit breaker only through the same confirm as the single view, then the tile is remounted (a stopped socket cannot reconnect). The routes report a refusal in the ENVELOPE of a 200, so the response body is read, not `res.ok`. An agent that exited in a live pane (`paneExit`) cannot be started again in place (both routes refuse while the pane's tmux client runs): its tile shows the exit and points at Close session.
|
||||
|
||||
+19
-3
@@ -29,6 +29,14 @@ or settled a question the spec left open. The invariants as built are in
|
||||
B too), and a refresh clears the screen at its turn in the queue, so a waiting tile keeps
|
||||
its last frame.
|
||||
- **4009 lands on the Attach overlay**, and 4003/4004/4010 remove the tile.
|
||||
- **The Tiles button opens the grid at once** (owner decision 8): a click (and
|
||||
`Ctrl+Shift+G`, the same `toggleTileGrid`) opens `tileGridOpenSet` (constants.js): the
|
||||
grid this tab last had, else an open split's two sessions, else the open sessions in tab
|
||||
order up to what the grid takes here (the cap, or fewer when the window fits fewer), the
|
||||
active one always included and focused. A remembered grid wins over an open split: the
|
||||
split closes and its sessions do not join (the owner's order, read literally). Right-click
|
||||
opens the picker; with the grid open it shows the current tiles and Open replaces them.
|
||||
Ctrl/Cmd+click on a tab with the grid closed opens the same set plus that session.
|
||||
- **The grid holds at most 6 tiles** (owner decision 7). `TILE_GRID_MAX` in constants.js is
|
||||
the one cap every limit reads; the layout table keeps 7 to 9 (`TILE_LAYOUT_MAX`), unreachable,
|
||||
so going back to nine is that one line. A stored grid with more ids comes back as its first
|
||||
@@ -143,9 +151,10 @@ work also fixes gaps the split pane has today.
|
||||
|
||||
### Entry points
|
||||
|
||||
- **Header Tiles button** (its own button, beside Split). Opens a picker with
|
||||
checkboxes over open sessions, ordered like the tab strip. When the grid is
|
||||
open, the button toggles it closed.
|
||||
- **Header Tiles button** (its own button, beside Split). As built (decision 8)
|
||||
a click opens the grid at once, the same as the toggle shortcut; the picker
|
||||
with checkboxes over open sessions, ordered like the tab strip, is on
|
||||
right-click. When the grid is open, a click closes it.
|
||||
- **Ctrl/Cmd+click a tab**: add that session to the grid (opens the grid if
|
||||
closed).
|
||||
- **Drag a tab** from the strip onto a tile to replace it, or onto an empty
|
||||
@@ -879,6 +888,13 @@ exits green. Use the browser runner for those files and read the file count.
|
||||
real hardware. The cap is one constant (`TILE_GRID_MAX`), the layout table
|
||||
keeps 7 to 9 working but unreachable, and the user-facing texts say "at most
|
||||
6 tiles" when the cap, not the window, is what limits the grid.
|
||||
8. **The Tiles button opens the grid directly.** Decided by the owner ("when I
|
||||
hit the tiles button, open the tiles already!"): a click opens the grid with
|
||||
no picker in the way, choosing the grid this tab last had, else an open
|
||||
split's two sessions, else the open sessions in tab order up to the cap with
|
||||
the active one focused; `Ctrl+Shift+G` runs the same function. The picker
|
||||
is on right-click of the button (its title says so, as do the wiki and the
|
||||
Help modal).
|
||||
|
||||
## Code anchors
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ Anything you copy is cleaned on the way to the clipboard: each line loses the pa
|
||||
| `Alt+Shift+Arrows` | Focus the tile to the left, right, above or below. |
|
||||
| `Alt+Shift+Enter` | Zoom the focused tile, or restore the grid. |
|
||||
| `Ctrl`+click / `Cmd`+click a tab | Add that session to the grid. |
|
||||
| Right-click the Tiles button | Choose which sessions to show as tiles. |
|
||||
|
||||
While the grid is open, `Ctrl+Tab` and `Alt+[` / `Alt+]` cycle through the tiles, and the
|
||||
terminal shortcuts above act on the focused tile. **Remove Focused Tile** has no key by
|
||||
|
||||
@@ -15,12 +15,14 @@ button in the header, beside Split, and enables `Ctrl+Shift+G`.
|
||||
|
||||
## Opening a grid
|
||||
|
||||
- **Tiles button**: with the grid closed it opens a picker, a checkbox per open session in
|
||||
tab order. It starts with the grid you last had (or the session you are on), says how many
|
||||
tiles this window fits, and greys out the rest. **Open tiles** shows them. With the grid
|
||||
open, the same button closes it.
|
||||
- **`Ctrl+Shift+G`**: toggles the grid. Opening brings back the grid you last had, else an
|
||||
open split as two tiles, else the session you are on.
|
||||
- **Tiles button**: one click shows the tiles straight away. You get the grid you last
|
||||
had; if there is none, an open split as two tiles; otherwise your open sessions in tab
|
||||
order, up to six (fewer if the window is too small), with the session you are on
|
||||
focused. With the grid open, the same button closes it.
|
||||
- **Right-click the Tiles button** to choose which sessions: a checkbox per open session in
|
||||
tab order, starting with the tiles you have (or had), greying out the rest once the grid
|
||||
is full. **Open tiles** shows them, replacing what the grid showed.
|
||||
- **`Ctrl+Shift+G`**: exactly what a click on the Tiles button does.
|
||||
- **`Ctrl`+click (or `Cmd`+click) a tab**: adds that session to the grid and focuses it,
|
||||
opening the grid if it was closed. On macOS use `Cmd`: `Ctrl`+click there opens the tab's
|
||||
rename instead.
|
||||
|
||||
Reference in New Issue
Block a user