Problem
Two related display/perf issues in the brain plugin's TUI sidebar:
1. Throttle too aggressive (2s)
In src/four-opencode-brain.ts, the progress callback throttles status updates to once every 2 seconds. For small/medium ingests this means the progress bar barely moves — the user sees mostly stale frames. The ingest itself is fast enough to warrant sub-second updates.
Lines:
- L127: auto-ingest progressCallback —
< 2000
- L257: brain_ingest tool progressCallback —
< 2000
Both should drop to 500 so the user sees smoother progress.
2. ProgressBar wraps onto a new line in sidebar
In src/tui.tsx, the inline <ProgressBar> inside the status row causes the row to break into two lines (ProgressBar on line 2, status text on line 1).
Root cause: @four-bytes/opencode-plugin-lib/tui-components ProgressBar hardcodes <box flexDirection="row" width="100%" ...> on its outer container. When placed inline next to text, that 100% width forces the row to wrap.
Fix
Fix 1 (brain): Change 2000 → 500 in both throttle checks.
Fix 2 (plugin-lib + brain):
- In
opencode-plugin-lib: add a width?: string prop to ProgressBar (default "100%" for backward compat).
- In
tui.tsx: pass width="auto" at the two ProgressBar call sites so it shrinks to content + label.
Branch
fix/throttle-layout
Related
Problem
Two related display/perf issues in the brain plugin's TUI sidebar:
1. Throttle too aggressive (2s)
In
src/four-opencode-brain.ts, the progress callback throttles status updates to once every 2 seconds. For small/medium ingests this means the progress bar barely moves — the user sees mostly stale frames. The ingest itself is fast enough to warrant sub-second updates.Lines:
< 2000< 2000Both should drop to
500so the user sees smoother progress.2. ProgressBar wraps onto a new line in sidebar
In
src/tui.tsx, the inline<ProgressBar>inside the status row causes the row to break into two lines (ProgressBar on line 2, status text on line 1).Root cause:
@four-bytes/opencode-plugin-lib/tui-componentsProgressBar hardcodes<box flexDirection="row" width="100%" ...>on its outer container. When placed inline next to text, that 100% width forces the row to wrap.Fix
Fix 1 (brain): Change
2000→500in both throttle checks.Fix 2 (plugin-lib + brain):
opencode-plugin-lib: add awidth?: stringprop toProgressBar(default"100%"for backward compat).tui.tsx: passwidth="auto"at the two ProgressBar call sites so it shrinks to content + label.Branch
fix/throttle-layoutRelated