Skip to content

feat(codex-fleet): iOS-style pane context menu via display-popup#2

Merged
NagyVikt merged 2 commits into
mainfrom
feat/ios-pane-context-menu
May 14, 2026
Merged

feat(codex-fleet): iOS-style pane context menu via display-popup#2
NagyVikt merged 2 commits into
mainfrom
feat/ios-pane-context-menu

Conversation

@NagyVikt
Copy link
Copy Markdown
Contributor

Summary

Right-click context menu was hitting the ceiling of tmux's display-menu: fixed 1-column rows, single-styled title, no per-row two-tone layout for left-icon + label + right-aligned shortcut chip, no rounded card chrome (border-lines are an enum), no live status chip in the header.

Switch to display-popup -E -B running a bash renderer that draws the design with ANSI escapes using the existing lib/ios-menu.sh palette helpers — full chrome control, accent-pill hotkey chips, red Kill row, green LIVE header chip, disabled rows muted when swap/zoom not applicable.

#{mouse_line} content travels into the popup pty via set-environment -g CODEX_FLEET_MENU_LINE "#{q:mouse_line}" so embedded quotes/spaces in the line text survive into the "Copy this line" path without fighting shell quoting.

Mirrors recodeee/recodee#1932 — keeps the standalone extract in lockstep with upstream.

Test plan

  • On a running fleet session, re-source bindings: bash scripts/codex-fleet/style-tabs.sh
  • Right-click any pane → rounded card opens with LIVE chip + accent chips on the right
  • Press C / c / l → clipboard receives whole session / visible / current line
  • Press h / v / z → split / zoom works
  • In a single-pane window, swap rows render muted (gray) and refuse on press
  • Press X → pane dies; press esc → popup closes with no action

🤖 Generated with Claude Code

NagyVikt and others added 2 commits May 14, 2026 15:30
Right-click context menu was hitting the ceiling of tmux's display-menu:
fixed 1-column rows, single-styled title, no per-row two-tone layout
for left-icon + label + right-aligned shortcut chip, no rounded card
chrome (border-lines are an enum), no live status chip in the header.

Swap to display-popup -E -B running a bash renderer that draws the
design with ANSI escapes using the existing lib/ios-menu.sh palette
helpers — full chrome control, accent-pill hotkey chips, red Kill row,
green LIVE header chip, disabled rows muted when swap/zoom not
applicable.

The mouse-line content travels into the popup pty via
set-environment -g CODEX_FLEET_MENU_LINE "#{q:mouse_line}" so embedded
quotes/spaces in the line text survive into the "Copy this line" path
without fighting shell quoting.

Mirrors the same change landed upstream in recodeee/recodee#1932 so
the standalone extract stays in lockstep.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The MouseDown3Pane binding in the previous commit used the shell-style
default ${CODEX_FLEET_REPO_ROOT:-$HOME/Documents/recodee} but tmux's
${VAR} substitution does NOT honor shell defaults — it parses the
whole `CODEX_FLEET_REPO_ROOT:-$HOME/Documents/recodee` as one variable
name, finds `:` inside, and bails with:

  /tmp/codex-fleet-menu.XXX.tmux.conf:N: invalid environment variable

Symptom: style-tabs.sh prints `WARN: sticky menu rebind failed` and
the old display-menu binding stays active. Right-click never opens
the new popup.

Fix: resolve the fallback in bash before sourcing the tmux config,
push the resolved value into tmux's global environment, and reference
it as a plain ${CODEX_FLEET_REPO_ROOT} in the binding.

Mirrors the same fix landing in recodeee/recodee#1932.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NagyVikt NagyVikt merged commit 77abd12 into main May 14, 2026
@NagyVikt NagyVikt deleted the feat/ios-pane-context-menu branch May 14, 2026 13:42
NagyVikt added a commit that referenced this pull request May 15, 2026
…r without --exclude-tmux (#137)

Two cascading bugs in `scripts/codex-fleet/add-workers.sh` made the discovery
wrapper report `only 0 healthy unallocated accounts available` and then fail
with `no healthy accounts available`, even when ≥1 account in the canonical
`agent-auth list` pool passed the 5h<100% / weekly<90% / not-already-active
filter.

Root cause #1 — cap-probe invoked with no email arguments

`pick_accounts()` called `cap-probe.sh "$need"` (only the count). cap-probe's
shebang is `<need_n> email1 email2 ...`: after `shift`, it iterates
`for email in "$@"` over an empty list, probes nothing, and exits with 0
healthy rows. The wrapper then took the empty result as "0 healthy" and
moved on.

Root cause #2 — discover-accounts fail-closes when target tmux session is absent

`bash discover-accounts.sh --exclude-tmux <session>` runs
`tmux list-panes -s -t <session> | sed | sort | tr | sed` under
`set -eo pipefail`. On a host where `<session>` doesn't exist on the
default tmux server (e.g. running `add-workers.sh` outside the fleet
session, or with `CODEX_FLEET_TMUX_SOCKET` unset so the wrapper degrades
to the operator's default tmux), tmux exits 1, pipefail kicks in, the
helper exits before reaching its python emitter, and the wrapper sees an
empty tempfile. The wrapper then treated empty as "all candidates
allocated" instead of "tmux filter unusable, retry without it".

Fix (surgical, in-file only)

1. After the first discover-accounts call, if the tempfile is empty,
   retry without `--exclude-tmux`. We still keep `--exclude-active` so
   accounts already in `fleet-active-accounts.txt` are skipped.
2. Before invoking cap-probe, extract the email column from the
   discovered TSV and pass each email as a positional arg so cap-probe
   has something to probe. Empty discovery skips cap-probe entirely.

The helper-side bug (discover-accounts.sh exiting 1 when the tmux
session is missing instead of treating an empty tmux query as
"no live panes to exclude") is left untouched per file-scope contract;
the wrapper now compensates for it.

Verified on host 2026-05-16:
  bash -n scripts/codex-fleet/add-workers.sh             # exit 0
  docker run koalaman/shellcheck:stable …add-workers.sh  # only pre-existing findings
  bash scripts/codex-fleet/add-workers.sh 1 --dry-run    # picks admin-mite (1 healthy)
  bash scripts/codex-fleet/add-workers.sh 2 --dry-run    # picks 2 healthy

Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
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