Skip to content

fix(tui,screenshots): point the capture path at the in-repo scripts; docs follow - #1350

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Oct 25, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

What and why

tui/scripts/shot.sh promised a capture path that no longer exists. It is now a thin wrapper over the scripts that actually produce the images (scripts/screenshots/tui_capture.py, which drives the real TUI, and capture.py, which gained the sizing and pane options the wrapper needs), so regenerating a workbench screenshot is one command instead of a hunt. The guides are corrected in the same change: they describe the capture path that exists, not the one that was removed.

Commits

  • fix(tui): make shot.sh a real wrapper over the in-repo capture path
  • docs(tui): describe the capture path that exists

Verification

Run on the frozen tip (8e4cb4f2b):

  • bash -n tui/scripts/shot.sh — syntax OK
  • python3 -m py_compile scripts/screenshots/capture.py scripts/screenshots/tui_capture.py — clean
  • make check-docs — 327 docs checked; placement, bilingual pairing, local/wiki links, script paths and fences OK; 0 pairs pending bilingualization; provider matrix matches the code (13 rows)

No Rust source changed, so no compile or test class applies; the capture tooling is exercised by hand (shot.sh reproduced the committed images at the previous step of this series).

Notes

  • shot.sh keeps its flags, so existing invocations (and the guide text that documents them) still work.
  • capture.py is shared with the desktop/mobile capture flows; the new options are additive.

`tui/scripts/shot.sh` was in the tree but unusable from a clone: it drove tmux,
then reached for `ansi2png.py` and `click.py` under the gitignored
`.future/workbench-lab/`, so a reader got `exit 2` and the docs that cited it
(`verification.md` §7) pointed at a command that could not work.

It is now a thin wrapper over `scripts/screenshots/capture.py tui`, which is
the single implementation: the app runs in a pty of the requested size and the
bytes it wrote are replayed through the terminal cell model. No tmux and nothing
outside the repository to install.

`capture.py tui` grew what the wrapper needs:

- `--scenario` (`chat`, `help`, `palette`, `todo`, `usage`, `skills`,
  `sessions`) drives the surface the way a reader does. Panels are click-only,
  so those scenarios click a tab — resolved from the frame on screen, not a
  fixed column: counting characters instead of cells put the click on the tab
  *before* the target once any CJK label preceded it (the first version's
  `usage` frame showed the sessions panel). A self-test pins the bytes sent.
- `--addr` attaches to a running agent instead of starting `demo_agent`, and
  leaves the caller's `FUTURE_HOME` alone — the real-session path §7 uses.
- the output argument is optional again (`python3 … capture.py tui`), as the
  docs already wrote it.
- `--self-test` checks the scenario steps without a browser or an agent.

`shot.sh` picks its data source from the environment: `FUTURE_AGENT_GRPC_ADDR`
set means that agent (real transcript, real todos, real usage), otherwise the
scripted demo. It accepts both argument forms the docs use — `chat 120x38` and
`chat out.png` — rejects arguments it does not take rather than ignoring them,
and only a live capture defaults into `docs/tui/assets/`, so a demo frame cannot
silently overwrite the visual baseline.
The verification, parity, redesign and spec pages described tmux `new-session`
/ `resize-window` / `capture-pane -p -e` / `ansi2png.py --cols` as the way to
reproduce the frames. None of that is how a frame is made now, and `SHOT_PY`
named a script that does not exist.

Rewritten to the mechanism in the tree (pty sized before the app starts, bytes
replayed by `tui_terminal.py`), in both languages, and the argument form now
shown as written is the one `shot.sh` accepts (`chat 120x38`). §7 step 5 gains
the `--scenario palette` it always meant — a bare `capture.py tui` renders the
chat surface, not the picker.

The historical statements (how *this* record's frames were produced, and the
`tmux display -p '#{mouse_any_flag}'` measurement in M6) are left alone: they
describe what was done, not what to run.
@huichen
huichen enabled auto-merge (squash) October 25, 2026 11:29
@huichen
huichen merged commit 0f6367c into main Oct 25, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch October 25, 2026 11: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