Repository navigation
chore(cli-rs): pin OpenTUI 0.9.8 and share one syntax theme across views - #65901
Conversation
OpenTUI 0.9.8 takes `syntax_theme(impl Into<Arc<SyntaxTheme>>)`, so a view can keep a shared theme instead of its own copy of about 90 styles. `code::syntax_theme` now returns an `Arc`, one per equal theme (the last four kept, as page and dialog surfaces differ), and every view, the transcript's `Paint` and mini's `RunTheme` pass clones of it. Mini's `recolor` is gone: it only ran on the one-style theme already in the entry color, so it changed nothing.
There was a problem hiding this comment.
I couldn't build this: the review environment has no Rust toolchain, so I couldn't run cargo, the test suites or bun run perf. This is a code read only, and I found nothing that blocks a merge.
What I checked:
- Theme cache: the cache in
opencode_ui::code::syntax_themeis keyed onTheme'sPartialEq. That covers everythingstyles()reads: the surface tokens,accent()andcategorical(). - Callers: none of the existing callers mutates the shared
Arc. Mini copies it out withArc::unwrap_or_clonebefore quantizing. - Removed
recolor: inmini/src/scrollback.rsit only ever ran on the one-color fallback theme, so removing it changes no output.
One small note, not blocking: the cache drops the oldest entry, not the least recently used. A theme switch on all three surfaces (page, dialog, dialog footer) can therefore push out entries still in use, and the views would build their own syntax themes again. That only costs the allocation saving; it can't paint wrong colors.
Public API: unchanged. plugin.luau only gains two doc comments on existing types, and the Rust signature changes (&SyntaxTheme → &Arc<SyntaxTheme>) are internal to the cli-rs crates.
What it does
opentui,opentui-sys; the native library table row for the v0.9.8 release, all eightplatform zips checked).
Arc<SyntaxTheme>. The client now builds one per theme and hands clones to every view (transcript, run theme,plugins, dialogs, prompt chips) instead of each view building its own.
plugin.luaufrom the protocol's new request-parameter descriptions (doc comments only).What it buys
Fewer allocations wherever views are built, from
bun run perf(5 runs each), with instruction counts down too:streambuilds one Markdown view and streams into it, so the per-view saving barely shows there. No scenario rose.Behaviour changes in 0.9.8, checked against this client
ScrollBox::sticky(true)now re-sticks only from the edge, as Core does. The transcript, shell output, mini'sfooter and plugin scrolls all turn it on at the edge, so nothing changes for them.
visible text.
Host::release()reads the terminal size before resuming, which fixes a resize while suspended.None needed a code change.
Checks
fmt, clippy, the TUI, store, plugin, UI and mini test suites, and the full parity suites (P-APP, P-TUI, P-CLI, P-PTY,
ACP), all green on the integration branch.