Skip to content

CPLAT-12785: async tmux leftovers and keymap-derived footers/help - #176

Merged
gavin-jeong merged 2 commits into
masterfrom
CPLAT-12785-tui-followup
Oct 14, 2026
Merged

gavin-jeong merged 2 commits into
masterfrom
CPLAT-12785-tui-followup

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

JIRA: https://sendbird.atlassian.net/browse/CPLAT-12785

Summary

Follow-up to #175. Two changes:

  1. Async pane lookups and sends. Update no longer runs tmux pane lookups or send-keys directly.
  2. One binding table. The keymap now drives footers, menu footers, the action hint box and the ? help.

Changes

Async tmux (tmux_async.go)

  • These paths now run FindPane and switch-client in a tea.Cmd: pane jump, live resume, ctrl+g in the live preview, opening the live preview, bulk input, and share-ref.
  • Each result message carries a generation. Update drops a superseded result, so a slow lookup never switches to, or opens, an older target.
  • The live-preview result also checks that the cursor is still on the same session.
  • Two sends used to discard their .Run() errors: the \ continuation (now one sendKeys) and bulk sends (now errors.Join). Both now report the error in the status line.
  • Share-ref shows "Sharing…" until the send finishes. On failure it shows "Share failed: " instead of an early "Shared".

Binding table (bindings.go)

  • A table covers every Keymap field with a footer label and help text. Keys still come from Keymap, which keeps the existing yaml overrides.
  • footer() keeps hints in priority order. When the line is narrow, it drops unpinned hints from the end and shows …. Help and quit stay pinned, and so does esc in the conversation view.
  • These surfaces now read from the table: the session, stats, config and plugins footers; the conversation footer and the menu footers; the session actions hint box; and the ? common and session-list rows.
  • Dispatch now uses keymap keys where the footer advertises them but the code had them hardcoded: stats q, esc and p, and config/plugins x. Left, Right and resize overrides now reach the split pane through resolveSplitKey.
  • scopeKeys now reads from the table.
  • Bug fix: the state menu footer said S:states, but the key is s.

Tests

  • New tmux_async_test.go. It checks that no tmux call runs on the Update path, that stale results are dropped, and that send errors show up in the status line.
  • New bindings_test.go. It covers:
    • table coverage of every keymap field (by reflection)
    • Conflicts()
    • reachability: every bound session action is in ? and not swallowed by a global intercept
    • every footer key appears in ?
    • narrow-footer … with pinned help/quit
    • an override reaching the footer, ? and dispatch together
  • One existing test was adapted: it checked the full conversation footer at width 120. The test now renders wide, because its subject is where the key comes from.
  • go vet ./... and gofmt -l . are clean. go test -race -count=1 ./... passes except TestDayCursorMoveCost, a frame-budget timing test that also fails under -race on master (about 20 ms per move). It passes without -race, which is how CI runs it.

Pane jump (incl. live resume and ctrl+g), live preview open, bulk input
and share-ref now resolve panes in a tea.Cmd; results carry a generation
and Update drops superseded ones. The backslash continuation and bulk
sends report send-keys errors instead of discarding them.
…ap table

bindings.go adds a label/help table over every Keymap field. Footers,
menu footers, the session actions hint box and the ? overlay read keys
and labels from it, so a keys override changes every surface at once.
Footers drop low-priority hints with an ellipsis when narrow and pin
help/quit. Stats/config/plugins dispatch now uses the keymap for the
keys their footers advertise, and Left/Right/resize overrides reach the
split pane. Fixes the state menu footer that said S while the key is s.
Adds Conflicts() and reachability tests.

@jinsekim jinsekim left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jinsekim jinsekim added the auto-review/approved Auto-approved by the Slack auto-reviewer bot label Oct 14, 2026
@gavin-jeong
gavin-jeong merged commit 2b71be8 into master Oct 14, 2026
5 checks passed
@gavin-jeong
gavin-jeong deleted the CPLAT-12785-tui-followup branch October 14, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review/approved Auto-approved by the Slack auto-reviewer bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants