Commit graph

22221 commits

Author SHA1 Message Date
Simon Klee
4302b3645f
style(cli-rs): format the dialog footer key rule
rustfmt wraps the let-else of the TS keyless-action rule.
2026-11-04 23:31:18 +01:00
Simon Klee
028ae8f85a
feat(cli-rs): add the update dialog and the home update notice
The updater stays with the CLI: features::update_notification::Source is what D.2 provides through set_source, and until then there is no /update and no notice, as in TS without an updater. With a source, client notices and the installation.* events show the home notice; skip remembers it in update-notifications. The dialog checks, installs, and restarts as DialogUpdate does, proven against a fake updater. The dialog footer now shows an action without a key or command, as TS does, and the P-COMP helper compares the footer band too.
2026-11-04 23:31:18 +01:00
Simon Klee
4f35dfa9e5
feat(cli-rs): add release highlights and their auto-open
DialogHighlights shows the embedded OPENCODE_RELEASE_HIGHLIGHTS, as TS stable builds do; /highlights is registered only when there are some. Once connected, an idle home claims the version in the highlights storage under its lock, ported from util/highlights.ts with its tests.
2026-11-04 23:31:18 +01:00
Simon Klee
b82b9e2f93
feat(cli-rs): add the pair dialog
/pair and /web read GET /api/info and POST /api/pair, then show the connect links, the localhost link, and a QR code of the first link as renderUnicodeCompact draws it (byte mode, level L, smallest version). Proven against a test transport only, since a pairing creates a code on the server.
2026-11-04 23:31:18 +01:00
Simon Klee
85ef533ca9
feat(cli-rs): add the plugin manager and the error source line
/plugins lists the TUI plugins from the registry and the server plugins from GET /api/plugin. Enter toggles a TUI plugin through set_active and remounts the route, space or Enter opens an error, ctrl+u updates and ctrl+r checks packages, ctrl+a shows the built-ins. A configured TS plugin is listed as skipped with the reason as its error. The error details view gains the source path line, and select actions gain hidden_when for row-dependent actions.
2026-11-04 23:31:18 +01:00
Simon Klee
46054a08ab
feat(cli-rs): add the status dialog
/status and <leader>s list the default location MCP servers with their status, as DialogStatus does, and follow the store while open.
2026-11-04 23:31:18 +01:00
Simon Klee
82fb532f4f
feat(cli-rs): add the theme list with preview and restore
Settings → Theme and /themes open DialogThemeList. Moving or filtering previews the theme, Escape restores the opening one, and Enter writes theme.name. The dialog is built again in each previewed theme, as TS restyles it, through a select restore of the selection and scroll.
2026-11-04 23:31:18 +01:00
Simon Klee
da822df66a
fix(cli-rs): keep the queued prompts condition off the store lock
session.queued_prompts read the store in its enabled condition, which
the reentry assert caught under a keymap query. It reads the count the
dock last updated instead (carbon-5).
2026-11-04 23:25:31 +01:00
Simon Klee
49a287616b
test(cli-rs): cover the MS1 review fixes in the TUI
Leaving a missing location session, keymap queries under the store
lock, permission reads after a reconnect, and focus under a dialog
(carbon-2, carbon-5, carbon-6).
2026-11-04 23:25:31 +01:00
Simon Klee
5b2a163227
fix(cli-rs): read permissions and forms again after a reconnect
Permission, SessionForms and HomeForms read each owner once per mount,
so a request created while the event stream was down never showed. They
now read again on a full sync, which a reconnect brings. Reading on
every sync instead loops when a read fails with SessionNotFoundError.

A permission or form that closed under an open dialog focused the prompt
behind the dialog. The prompt now takes the keys when the dialog closes,
through the new Dialogs::refocus (carbon-6).
2026-11-04 23:25:31 +01:00
Simon Klee
a7832c818a
fix(cli-rs): keep keymap conditions off the store lock
Keymap queries evaluate every command's conditions, and has_sessions, the
prompt's running, the session actions' reverted and child, and
Local::route_fn locked the store. A query under Data::read then hung the
UI thread. Tui::sync now caches the routed session and whether sessions
exist, and the prompt caches running at each refresh (carbon-5).
2026-11-04 23:25:31 +01:00
Simon Klee
1eece51bb1
fix(cli-rs): dispose session view keymap layers
LocationMissing, the scroll controls and the transcript dropped their
Disposer handles, which keeps the layers registered. After a missing
location session, Enter on home opened "Choose directory", and session
commands stayed in the palette. Each view now disposes its layers when it
replaces or drops them (carbon-2).
2026-11-04 23:25:11 +01:00
Simon Klee
ccd8f2e17c
fix(cli-rs): panic on a reentrant store lock in debug builds
The store mutex is not reentrant, so a read under a read hung the UI thread
until the test timeout. Debug builds now track the stores each thread
holds and panic with a stack trace instead (carbon-5).
2026-11-04 23:25:11 +01:00
Simon Klee
58c5e53aec
fix(cli-rs): shift copied theme colors by value
Theme::decrease and increase matched tokens by address, so a Color copied
to a local never shifted and hover and badge surfaces kept the raised
background. A copy now shifts by the tones of the tokens with its value,
and stays unchanged when they disagree (carbon-8).
2026-11-04 23:25:11 +01:00
Simon Klee
4f70268817
test(cli-rs): wait on conditions in the shared state tests
Use support/wait.rs's ceiling and wait for the asserted state instead
of a fixed 50 ms settle after each event.
2026-11-04 22:57:35 +01:00
Simon Klee
c013fb54d6
refactor(cli-rs): follow E.11b's /cd location in the model state
E.11b's home /cd sets the location, as TS does, so Local follows
location::current alone and location::set already syncs it.
2026-11-04 22:57:35 +01:00
Simon Klee
845e38b499
fix(cli-rs): follow home's /cd directory in the model state
TS /cd sets the location that useLocal reads; here it sets the prompt's
home directory, so Local follows that on home too.
2026-11-04 22:57:35 +01:00
Simon Klee
25605936e8
test(cli-rs): prove session.json and history writes against the TS TUI
P-FILE under contention: parity/oracle/MS1-files.ts writes with the
TypeScript TUI's own persistence functions while Rust writes, and a
reader checks every state of both files.
2026-11-04 22:57:35 +01:00
Simon Klee
302a34dded
fix(cli-rs): only append to the prompt history on save
Under real contention a trim by rename dropped a line the TypeScript TUI
was appending without the lock: Node can open the old file before the
rename and write after it. Saves now only append, as TypeScript does
below the limit, and the load trims the file to the newest 50.
2026-11-04 22:57:35 +01:00
Simon Klee
7b6d784b42
test(cli-rs): prove cross-location model state and shared state files
Covers carbon-3 (a project-local agent survives a submit, acknowledged
commits clear the drafts) and carbon-7 (pins and history lines another
client wrote survive, early prompts are kept, deletes prune pins).
2026-11-04 22:57:35 +01:00
Simon Klee
fa4826fe14
fix(cli-rs): read model state for the session's location
Local takes its models, providers, agents, integrations, and configured
model from the store for the current location, and follows it when the
TUI moves. Acknowledged agent and model commits clear their drafts, and
session.deleted drops drafts and pins, as context/local.tsx does
(carbon-3).
2026-11-04 22:57:35 +01:00
Simon Klee
fb92812629
fix(cli-rs): lock and re-read session.json and prompt history writes
Pins and history entries are written in order on one worker, under the
file's Flock lock, from what the file holds then, with uniquely named
atomic rewrites. Pins and lines the TypeScript TUI wrote since survive,
and prompts submitted before the history loads are kept (carbon-7).
2026-11-04 22:57:34 +01:00
Simon Klee
ec8f9bac9f
test(cli-rs): cover pastes, attachments, and the stash file with TS
TestApp tests over a recording fixture and the clipboard sink: compact pastes and their expansion, clipboard images and text, read errors, pasted paths and SVGs, previews and the image dialog, copy, and the stash dialog. P-FILE runs the real PromptStashProvider on the Rust stash file and back.
2026-11-04 22:55:49 +01:00
Simon Klee
38f311bacf
feat(cli-rs): copy pasted text, not its label, from the prompt
A mouse selection copied while the prompt is focused expands each [Pasted ~N lines] label to its text, as the TS prompt's getClipboardText does. Drops parts::files, which the attachment path replaced.
2026-11-04 22:55:49 +01:00
Simon Klee
5830f6b707
test(cli-rs): prove compact pastes against TS with a paste step
The P-APP harness gains a bracketed paste step on both sides. E.4/paste collapses a three-line paste, expands it by pasting it again, and strips ANSI from a short paste; every checkpoint equals TS.
2026-11-04 22:55:49 +01:00
Simon Klee
c50a4c3e36
feat(cli-rs): add pastes, attachments, image previews, and the stash
Long pastes collapse into [Pasted ~N lines] parts on the E.3 extmark map, pasted file paths and clipboard images attach as [Image N] or [PDF N], and the prompt stash keeps prompt-stash.jsonl in step with the TS TUI. Adds the image preview and stash dialogs, and opens the preview from transcript images.
2026-11-04 22:55:48 +01:00
Simon Klee
cb4d98c584
test(cli-rs): make the TS oracles' waits exact and say which timed out
File times come from a coarse clock that can trail Date.now(), so the load's
rewrite is now told by a changed mtime rather than one past the mount time.
The frecency appends land in any order, so they are compared as a set. A wait
that runs out now names itself on stderr, where a failing test shows it.
2026-11-04 22:53:35 +01:00
Simon Klee
a082899e80
fix(cli-rs): append prompt history in submit order
Each append ran on its own blocking task, so two quick submits could reach
prompt-history.jsonl in reverse order, and one made before the load finished
was dropped. Entries now queue in submit order, each task appends the whole
queue while it holds the history, and whichever task runs first loads the
file. prompt.rs caught the reversed file on a loaded machine.
2026-11-04 22:53:35 +01:00
Simon Klee
b4f9221bd3
test(cli-rs): let the TS oracles' load rewrite land before appending
The TypeScript history and frecency providers rewrite the file on load without
awaiting it. Under load, an append made after the load could land first and be
truncated by the rewrite. The oracles now wait for the rewrite, by mtime,
before running the ops. This is a race in the TS client itself.
2026-11-04 22:53:35 +01:00
Simon Klee
199077f8ff
test(cli-rs): wait for the TS oracles' appends to land
The E.2 and E.3 oracles gave the TypeScript appends a fixed 50 ms and the load
1 s. They now wait, up to 30 s, until the file ends with the appended lines,
read through a fresh BunFile each time, since a reused one can keep a stale
size.
2026-11-04 22:53:35 +01:00
Simon Klee
b9c8e299c8
test(cli-rs): serve ses_a's collections in the prompt fixture
ses_a's inbox, permission and form reads answered SessionNotFoundError, as for
a session not created yet. When one landed after the test set ses_a running,
the store marked ses_a deleted and dropped its status, so 'esc interrupt' never
showed.
2026-11-04 22:53:35 +01:00
Simon Klee
daadabcb58
test(cli-rs): wait for every autocomplete row the skills test checks
Skills, references and agents load separately; the test waited for a skill and
then asserted a reference that had not landed yet.
2026-11-04 22:53:35 +01:00
Simon Klee
cab5645cd2
fix(cli-rs): write tab changes to tabs.json in order
Each tabs update wrote the file on its own blocking task, and the tasks could
run out of order: a tab's title, set once its session read landed, could reach
the file before the tab itself, and was then lost. Each task now writes every
pending update, in order, while it holds the queue. tabs.rs caught it on a
loaded machine: ses_b stayed untitled in tabs.json for 30 s.
2026-11-04 22:53:35 +01:00
Simon Klee
9b9622f6d2
test(cli-rs): wait for the line-range row before picking it
The typed '@src/main.rs#3-5' already matched the wait, so on a loaded machine
Enter picked the stale '#3' row before the search for '#3-5' landed.
2026-11-04 22:53:35 +01:00
Simon Klee
c4b40b8a68
chore(cli-rs): format the ui crate's dialog, select and theme oracle
cargo fmt --check failed on these three files at d759713d61.
2026-11-04 22:53:35 +01:00
Simon Klee
b48fafd029
test(cli-rs): wait for conditions, not fixed times, in TUI tests
tabs, navigate, prompt and complete failed on a loaded machine. Waits now share
a 30 s ceiling (tests/support/wait.rs) and return once their condition holds;
fixed sleeps before assertions became waits for the asserted state.

- navigate: a page-up near the top moves two frames later, and when the older
  page arrived before the first render the move landed on the next key's
  frame. press and dispatch now render until no frame is pending.
- tabs: wait for both stored titles, not just two tabs.
- complete: wait for the search for 'ma', not only its results.
2026-11-04 22:53:35 +01:00
Simon Klee
803fdcb190
fix(cli-rs): keep a file pick made before frecency loads
The frecency load and a pick's update ran on separate blocking threads, and an
update that ran first found no loaded data and was dropped, so the pick was
never counted or written. Whichever runs first now loads the file under the
same lock. complete.rs's frecency tests failed this way on a loaded machine.
2026-11-04 22:53:35 +01:00
Simon Klee
406262efc5
feat(cli-rs): pick directories from the worktrees dialog
The location-missing view chooses its directory in the worktrees dialog,
creating a new worktree first when asked, as TS does. The open dialog goes
home in the chosen project or created worktree through the location
context.
2026-11-04 22:50:14 +01:00
Simon Klee
57fd2dacdd
test(cli-rs): prove worktree moves, staging, and quick switch
TestApp tests over a logging fixture: ctrl+m moves the session, a pick goes
home in that checkout, a staged worktree is created before the session on
the first submit, and quick switch slots follow the pins. Builds of the
worktrees dialog now read the state when they run, so a read that lands
while one is queued is not lost.
2026-11-04 22:50:14 +01:00
Simon Klee
5a4549357c
test(cli-rs): add the worktrees P-APP scenarios
worktrees: /worktrees on home, the delete mark, the name dialog, and the
staged "(new worktree)" footer. worktree-delete: a refused delete lists the
file changes, and the forced delete fails with the toast. Also show a
declared error by its message, as errorMessage does.
2026-11-04 22:50:14 +01:00
Simon Klee
c423a2ad8e
feat(cli-rs): add worktrees, staging, and quick switch
Port DialogWorkspaces, DialogWorktreeName and DialogWorkspaceFileChanges,
the prompt session.move command (/worktrees) with home staging of a new
worktree, and the session.quick_switch.1-9 commands with pin pruning.
The home prompt now reads its location from the location context, which
/cd sets, instead of a separate stand-in.
2026-11-04 22:50:14 +01:00
Simon Klee
b0e97fec9b
test(cli-rs): count the goal footer's RPC get as a read in the queue tests 2026-11-04 22:49:16 +01:00
Simon Klee
848e902dde
test(cli-rs): record the E.10b queue with the real prompt footer
E.14 made the footer hints real, so the scenario drops its footer mask and the fixtures are recorded again from the merged code.
2026-11-04 22:49:16 +01:00
Simon Klee
6eb64b10b0
test(cli-rs): prove the E.10b queue against the TypeScript cells 2026-11-04 22:49:16 +01:00
Simon Klee
7b4f75e691
test(cli-rs): cover the queue and message actions over a fixture server 2026-11-04 22:49:16 +01:00
Simon Klee
1914eafb53
feat(cli-rs): add the queued prompts dock and pending prompt dialogs
The dock above the prompt, session.queued_prompts and its dialog (steer, delete, undo), the pending steer dialog, and the message actions dialog that a click on a user message or the timeline opens. Queued prompts leave the transcript, and a prompt still in the inbox takes the border color. The pending actions share one single-flight helper with the empty submit.
2026-11-04 22:49:16 +01:00
Simon Klee
b91c306e2a
fix(cli-rs): scroll select options past multi-line titles
TS scrolls by each row's laid-out y, so a title with line breaks takes one row per line. The Rust estimate counted one, and a move to the next option did not scroll it into view.
2026-11-04 22:49:16 +01:00
Simon Klee
867eff6d9b
chore(cli-rs): format the diff viewer 2026-11-04 22:46:43 +01:00
Simon Klee
87e9d70d7c
test(cli-rs): prove the diff viewer over repository fixtures
Four P-APP scenarios record the TS viewer over patches from temporary git repositories: the docked panel, full screen with the tree and split view, the full-screen route from home, and the failed and committed-without-base states. The viewer keeps its current instance alive, and image cards get a deviation file.
2026-11-04 22:46:43 +01:00
Simon Klee
5cd7bdc39b
feat(cli-rs): add the diff viewer plugin
Ports the opencode.diffs viewer (F15): /diff docks it beside the session or opens it full screen, with the file tree, sticky file cards, split or unified hunks by width, the diff.* commands, and reviewed marks. The E.15b dialogs are stubs at their call sites.
2026-11-04 22:46:43 +01:00