fix: Goal sidebar rendering with the OpenTUI function API#15
fix: Goal sidebar rendering with the OpenTUI function API#15tienbac2314 wants to merge 1 commit into
Conversation
Replace src/tui.tsx (JSX-based, broken) with src/tui.ts (function-based, working). Uses same approach as oh-my-opencode-slim: createElement, insert, setProp from @opentui/solid with sidebar_content slot registration and setInterval + requestRender for live updates. Features ported from original: - Sidebar: status, time (live), tokens, auto-turns, checkpoints, objective - Command palette (Ctrl+P > Goal) - Goal action dialog (Refresh/History/Pause/Resume/Clear) - Toast notifications - All prompt functions Known limitation: tokens only update when goal tools run (pause/complete), not during regular agent work.
|
Thanks for the detailed reproduction and for validating the function-API approach on Windows and Ubuntu. The direction looks valuable and appears to address the missing sidebar from #14. I found one functional regression that should be fixed before merge:
Please make the elapsed text reactive (for example, with a signal/accessor insertion) or explicitly update the elapsed text node on each timer tick. It would also be good to add a render-level regression test that mounts an active goal and verifies that the visible elapsed time advances after a tick. The current sidebar registration test uses an empty session, so it does not render or inspect the goal tree and cannot catch this behavior. Local validation otherwise passed for me:
Once the live timer is fixed and covered, I think this should be ready for re-review. |
Summary
Rewrites the Goal TUI entrypoint from TSX/JSX to the
@opentui/solidfunction API because the published raw TSX entrypoint does not render in OpenCode 1.18.3 on the tested Windows 11 and Ubuntu 24.04 installations.The server plugin and
/goalcommand already load correctly. This change keeps the existing sidebar data, lifecycle actions, cache behavior, and command-palette integration while avoiding the failing JSX renderer path.Related issue
Closes #14
Changes
createElement,insert, andsetProp.src/tui.tsxtosrc/tui.tsand update package exports, published files, tests, and README documentation.Verification
Tested the local package with OpenCode 1.18.3 on Windows 11. The vanilla
0.1.24package loaded/goalbut did not show the Goal block; this function-API version rendered it on the same installation.Commands run:
Full
bun testresult on Windows:The only failure is the existing POSIX file-mode assertion in
test/state.test.ts(0o666received instead of0o600on Windows). All TUI and package tests pass.Visual comparison:
Vanilla 0.1.24: Goal block absent
Function-API rewrite: Goal block visible
Checklist
bun testpasses (new behavior has regression coverage)bun run lintpassesbun run typecheckpassesbun run buildpasses anddist/server.jsis committed if server code changed