Repository navigation
feat(tui,desktop,mobile): a composer that paints its draft; a language key; a preselected device row - #1383
Merged
Conversation
`ctrl+e` looked like a reading toggle, but it wrote the level it landed on back to `settings.json`, so one peek at the process left every later terminal expanded — the reported "tool calls and thinking show by default" was simply a stored `replyDetail: detailed` that the key had put there. The shipped default was already the folded one (a fresh home draws `▸ 2 tool calls · 1 thought` above the answer, the same row the desktop's process fold shows), so the default a reader saw depended on whether they had ever pressed the key. The level is now a view state, not a preference: a transcript opens folded, and `ctrl+e` (with the `/reply-detail` verb) expands it for the run it is pressed in without writing anything — the exit path stopped persisting it too, which was the second door the old value came through. `replyDetail` is retired from `TuiSettings`: a file that still carries it loads fine and the key is dropped the next time the file is written. The desktop and the phone keep their settings-page toggle; the terminal's hotkey is not a settings page, and a key that reads as "show me this once" must not become one. Tests: `a_new_transcript_opens_folded` pins the opening level, `a_legacy_stored_level_does_not_open_the_transcript_expanded` pins that a stored `detailed` is ignored (it fails if `attach` is handed the level again), and the retired-key case in `settings.rs` now asserts the key is dropped on write. Both TUI guides say `ctrl+e` is per run.
…es up `ctrl+g` opens the language chooser — the same box `/lang` opens, so a key cannot drift from the command it names, and the help table and the shortcut editor read it from the same action. The queue moved off `ctrl+g` to `alt+q` (and keeps `/queue`); the literal `ctrl+g` arm in the fallback match is gone, so a reader who rebinds the key is not still answered by it. The `#` session-mention menu appended each row's workspace right after its title, so the workspace column started wherever that title happened to end — with CJK titles that is a different cell on every row, which is what 'the `#` list is misaligned' showed. The labels are padded to the list's own widest label now, so the second column starts in one cell. `capture.py tui --scenario mention-sessions` is the frame for it.
`system` took the first of `LC_ALL`/`LC_MESSAGES`/`LANG` and only asked the OS on Windows, so a Mac whose language is Chinese drew English whenever its shell carried a `LANG` — which macOS shells always do, a `C.UTF-8` default from `/etc/zprofile` or whatever the profile exports (measured here: `AppleLanguages = ["zh-Hans-CN"]`, `LANG = en_US.UTF-8`). The order is now the per-process POSIX overrides, then the system's own answer (macOS preferred languages through CoreFoundation, the Windows UI language), then `LANG`. On the other Unixes the locale variables already are the system's answer, so nothing there changes. Checked on a `zh-Hans-CN` Mac with `LANG=en_US.UTF-8`: `system` resolves to Chinese, and the demo workbench frame draws in Chinese.
…ow chosen ⌘N asks which computer the conversation lives on, and the dialog already put the caret on this machine — but it drew the row's only highlight through `:focus-visible`, which WebKit does not match for an element focused by script. The row the dialog had chosen looked like every other row, so the list read as "nothing selected, reach for the mouse", and the arrows moved a selection nobody could see. The chosen row is now a piece of state: it starts on this machine, the arrows and Home/End walk it, Enter opens it, and a row reached with Tab or a click moves it back. The keys are listened for on the window, because the caret is the part that could not be trusted — a dialog opened over a composer still answers the arrows when the focus never arrived. The footer's own Enter stays the footer's, so Cancel is still cancelled. Nothing is created by the default: the row is a cursor, and the machine is still the question.
The popover behind the status dot lists every paired machine, and its takeover was wired to remote.takeControl, which speaks only for the open machine. A peer somebody else holds is the ordinary reason the dot is yellow, so the row that carries the action was exactly the row whose machine never heard about it: the open desktop answered "already in control, nothing changed", the sheet closed, and the held machine stayed held. The picker's rows already resolve the row's own runtime, which is why taking over from the device list worked. Wire the badge to takeControlFor, the per-machine path, and pin the wiring in a screen test.
Two faults in the same rectangle: The menu was centred on the *terminal* — 64 columns at 120 wide — so its right border ran into the rail and stood beside the rail's own vertical: two lines one cell apart, with the rail's column cut for the height of the menu. It is now the composer's column it is centred in and clamped to, which is the line it is completing. A row whose left edge cut through a wide glyph lost that half-glyph from the splice instead of keeping its cells, so the band spliced after it started one column early and that row's right border sat one cell left of every other row. `slice_cols` now turns a half-cut glyph into a space, one cell per cell of it inside the window, so a band keeps the offset it was put at.
A draft carrying a pasted picture painted the prompt marker on a row of its
own and pushed the text down one. The box's rows come from the shared
component's `render`, which puts the attachment line ("📎 2 images attached")
first, and the workbench then cut two *bytes* off every row to drop the old
`> ` prompt. That line has no prompt, and the emoji is four bytes, so
`get(2..)` returned `None` and the row arrived empty: `❯` alone, then the
draft under it — reported as "a blank line appeared above the prompt".
The component now separates the value rows (`render_value`) from the
attachment line, and the box takes only the value: the pictures are named in
the box's title, which the chat composer already did and the launchpad did
not. The launchpad gains the same count, and the title string gains the space
it was missing ("Message · enter sends · ctrl+j newline· 📎 2 images").
The launchpad's first message also stops failing silently: when the agent
creates a session but this client does not end up attached to one, `submit`
used to return without a word, leaving the draft and the launchpad exactly as
they were — indistinguishable from a key that does nothing. It now says so
in the notice row, and the draft stays so it can be sent again.
…irst message that cannot attach says so
The prompt row inside the input box was filled with the panel colour while the box had focus, so the composer read as a second surface a shade off the chat around it — on the launchpad and in the follow-up band alike. The cursor already marks the box as the place to type, so the row now sits on the canvas like the top and bottom rules around it, and `palette.panel` stays what its name says: the sidebar, the menus and the overlays. The dead `prompt_row` duplicate (nothing called it) goes with it, and two widget tests pin "no background of its own" on both compositors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch finishes the TUI composer's own rendering (its canvas, its draft row, the straight borders of the
#menu), lets the interface language follow the system instead of the shell'sLANGalone, folds a reopened transcript, and fixes two small client-side defaults: the mobile session row's status dot names the machine it actually belongs to, and the desktop new-conversation device step opens with its first row selected.Commits
refactor(tui): the composer keeps the canvas backgroundfix(tui): the composer paints the draft, not a blank row above itfix(tui): the#menu is the composer's box, with straight bordersfix(mobile): a session row's status dot reaches the machine its row namesfix(desktop): the new-conversation device step opens with its first row chosenfix(tui): follow the system language, not just the shell'sLANGfeat(tui):ctrl+gswitches the interface language, and the#menu lines upfix(tui): a reopened transcript starts foldedVerification
Run locally at
5c73d03f9with the pinned toolchain 1.99.1 from~/.rustup(Homebrew's 1.96 shadowsPATH),ulimit -n 8192:cargo fmt --all -- --check— cleancargo clippy -p future-tui --all-targets -- -D warnings— cleancargo test -p future-tui --lib— 1317 passed, 0 failednpx tsc --noEmitclean;npx eslinton the two touched files clean;npx vitest run src/features/remote-peer/DeviceChoiceDialog.test.tsx— 8 passednpx tsc --noEmitclean;npx eslinton the two touched files clean;npx jest src/screens/__tests__/SessionsScreen.test.ts— 75 passedpython3 -m py_compile scripts/screenshots/capture.py— cleanorigin/mainwas merged into this branch before opening so the branch is not BEHIND; that merge touchedtui/src/workbench/{live,mod}.rsin the same files, and it resolved without conflicts.Notes
LANG;ctrl+gcycles it.