fix: Goal sidebar rendering with the OpenTUI function API#15
Draft
tienbac2314 wants to merge 1 commit into
Draft
fix: Goal sidebar rendering with the OpenTUI function API#15tienbac2314 wants to merge 1 commit into
tienbac2314 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.
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.
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