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:
Codeman maintainer
2026-10-06 23:23:55 +02:00
parent d2e72143e8
commit b7fafb1c16
14 changed files with 322 additions and 45 deletions
+3 -2
View File
@@ -125,11 +125,12 @@ describe('dragging a tab onto an empty slot', () => {
describe('Ctrl/Cmd+click on a tab', () => {
const click = (mods: Record<string, boolean>) => ({ preventDefault: vi.fn(), ...mods });
it('with the grid closed: opens it with the active session and the clicked one, focusing it', () => {
it('with the grid closed: opens what the Tiles toggle would, plus the clicked one, focusing it', () => {
const app = makeGridApp(IDS);
app.activeSessionId = 's-a';
// Nothing remembered, no split: the open sessions in tab order (the clicked one last).
app.handleSessionTabClick(click({ ctrlKey: true }), 's-c');
expect(app._tileGrid.ids).toEqual(['s-a', 's-c']);
expect(app._tileGrid.ids).toEqual(['s-other', 's-a', 's-b', 's-c']);
expect(app.activeSessionId).toBe('s-c');
expect(app.markIdleAlertSeen).toHaveBeenCalledWith('s-c');
});