Skip to content

feat: grid keybindings, double-click-to-focus, and app-focus accent overlay#334

Closed
roba-adnew wants to merge 10 commits into
forketyfork:mainfrom
roba-adnew:feat/ui-keybindings-accent
Closed

feat: grid keybindings, double-click-to-focus, and app-focus accent overlay#334
roba-adnew wants to merge 10 commits into
forketyfork:mainfrom
roba-adnew:feat/ui-keybindings-accent

Conversation

@roba-adnew

Copy link
Copy Markdown

Summary

A few grid-interaction refinements plus a window-focus visual cue.

Keybindings / mouse

  • Shift+Arrow moves the grid selection (Cmd+Arrow still works).
  • Double-click a grid pane focuses (zooms) it; a single click no longer focuses. Cmd+Return still focuses the selected pane.
  • Cmd+Esc returns a focused pane to the grid.
  • Double-click a focused pane returns to grid — only when the program isn't capturing the mouse, so mouse-reporting TUIs keep their clicks.

Accent / app-focus indicator

  • When the window is not the frontmost app, an accent fill is drawn over the focused/selected pane, so you can tell which pane is active and that the app is backgrounded.
  • When focused, that pane shows only its accent-coloured border (no fill).

Config

  • [font] grid_scale — grid-pane text size multiplier (alongside the existing [font] size).
  • [ui] inactive_overlay_alpha — strength of the unfocused-pane accent fill (0 disables).

Behaviour changes to be aware of

  • The Escape-hold-to-collapse gesture is removed in favour of Cmd+Esc, so a plain Esc (single or double) now passes straight through to the focused program (an editor's Esc, repeated-Esc shortcuts, etc.). This is the main intentional behaviour change.
  • Single-click no longer focuses a grid pane (double-click does).

Testing

  • zig build, zig build test, zig build lint (zwanzig — clean), and zig fmt --check all pass.
  • Unit tests added for the new config fields and the Shift+Arrow chord.

On quit, capture each pane's agent (Claude Code/Codex/Gemini) session id; on
relaunch, reopen each session in place. Two parts make it reliable:

- Live capture: a SessionStart hook reports the agent's session id over the
  notify socket (new agent_session notification + runtime dispatch), so ids
  are recorded as soon as a session starts instead of only scraped at quit.
- Robust resume: the resume command is injected as ARCHITECT_RESUME_CMD and run
  once by the wrapper rc after the user's shell rc loads -- never typed into the
  PTY, so it cannot race startup or be eaten by a shell prompt.

Also: a normal quit no longer wipes a captured id (teardown only overwrites on a
successful scrape), and the focused/zoomed pane is persisted and restored.
…verlay

- Shift+Arrow moves the grid selection (Cmd+Arrow still works).
- Double-click a grid pane focuses it; a single click does nothing
  (Cmd+Return still focuses the selection). Typing — including Enter —
  goes to the selected grid pane as before.
- Cmd+Esc returns a focused pane to the grid. The Escape-hold-to-collapse
  gesture is removed so single/double Esc pass straight through to the
  program (Claude Code's Esc-Esc rewind, vim's Esc).
- Double-click a focused pane returns to grid (only when the program is
  not capturing the mouse).

Accent / focus indicator:
- When the window is NOT the frontmost app, an accent fill washes only the
  focused/selected pane ([ui] inactive_overlay_alpha, 0 disables) so you can
  still tell which pane is active. When the window is focused, that pane
  shows only its accent-coloured border — no fill. Other panes are unchanged.

Fonts:
- [font] size (focused) + [font] grid_scale (grid text multiplier).
- Cmd+Shift+= / Cmd+- adjusts the focused size; Cmd+Opt+= / Cmd+Opt+-
  adjusts the grid scale (0.5-3.0). Both are persisted to persistence.toml
  and restored on the next launch.
- [ui] inactive_overlay_alpha.

Help overlay and config template updated; tests added for the new config
fields, the Shift+Arrow / grid-font chords, and grid_font_scale persistence.
@roba-adnew roba-adnew force-pushed the feat/ui-keybindings-accent branch from 19ee315 to 4e4bd70 Compare June 21, 2026 14:51
Extends the existing Cmd+click link opener (scheme URLs, OSC-8 hyperlinks) to
bare filesystem paths printed in terminal output, e.g. the "src/foo.zig" paths
Claude Code emits.

- New path_matcher.zig: detects a path-like token under the cursor (absolute,
  ~-relative, or relative), stripping a :line[:col] suffix and trailing dots,
  and rejecting plain words.
- Relative paths resolve against the pane's working directory; the path must
  exist on disk (the existence check keeps arbitrary text from matching).
- Opens via the existing macOS `open` pipeline. Because it hooks the shared
  link matcher, Cmd+hover also underlines the path and shows the pointer
  cursor, exactly like URLs.

Tests: path_matcher token detection + resolveExistingPath filesystem resolution.
When a file path is Cmd+clicked in terminal output, open it in VS Code
(`open -a "Visual Studio Code"`) instead of the default app — except
.html/.htm files, which open with the default handler (the browser).
Web URLs and file:// links keep going to the default handler.

Refactors os/open.zig to a variable-length argv so it can pass the
`-a <app>` form, and adds openTarget() used by the link click handler.
Cmd +/- is now context-aware: in grid view it changes the grid font size,
in focus view it changes the focus font size. The two no longer bleed into
each other (focus zoom compensates the grid scale so the grid holds steady),
and both are persisted to persistence.toml and restored on relaunch.

Replaces the separate Cmd+Opt grid shortcut (and gridFontSizeShortcut) with
this single, more intuitive zoom-what-you-see control.
…d nav

Single-click in grid view now moves the focus/selection highlight to the
clicked pane without spawning a shell or zooming to full screen (double-click
still expands to full screen). Routed via a new SelectGridSession UiAction so
clicks never trigger FocusSession's spawn/zoom.

Remove the Shift+Arrow grid-select chord; Cmd+Arrow remains the grid
navigation control. Shift+Arrow now passes through to the focused terminal as
a normal keystroke. Updates the help overlay, generated-config keybinding
help, and README accordingly.
…kground

- Single-click in grid view now focuses a pane instantly with no animation;
  the moved accent border is the feedback. The nav-wave stays on keyboard
  navigation only, matching the standard pointer-vs-keyboard focus convention
  (:focus-visible) and keeping clicks snappy.
- Remove the translucent background veil that dimmed grid-view panes.
- Default terminal background is now #262624 to match the Cacha dark theme.
Rebuild from the current worktree and quit/relaunch the installed app in one
step, so source edits never leave a stale binary running. Defaults to a
ReleaseFast build (--debug opt-in), sets up the native Homebrew SDL3 + macOS
15.4 SDK workaround so it builds without Nix, and waits for a clean shutdown
before relaunching. Exposed as 'just reload' and a Claude Code skill.
…lling

The reload force-killed Architect after 30s. With busy/looping agents, that
interrupted its quit teardown before each Claude could flush its session to
disk, so the next 'claude --resume' reloaded a rewound transcript (lost
completed turns). Now wait for Architect to exit on its own (re-sending the
quit periodically for a saturated app), and only force-kill as an absolute
last resort after ~5 minutes.
…ending quit

Replace the poll loop + periodic quit re-send with a single graceful quit
followed by 'caffeinate -w <pid>', which blocks on the process-exit event (no
busy-poll, no re-sending). A backgrounded watchdog force-kills only if the
teardown truly hangs (~5 min). The re-send was an unnecessary defensive hack;
the earlier missed-teardown was the old 30s force-kill, not a dropped quit.
@roba-adnew roba-adnew closed this Jun 23, 2026
@roba-adnew roba-adnew deleted the feat/ui-keybindings-accent branch June 23, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant