Skip to content

Commit 9acc44c

Browse files
committed
Remount the widget instead of relying on reactive signal updates
The packaged CLI does not repaint plugin components after their initial frame (separate plugin/host reactive graphs — anomalyco/opencode#39986), so a signal-driven widget freezes after first paint even though timers and fetches keep running. Rework the widget to be fully stateless: the refresh loop and clock tick now dispose and re-claim the sidebar slot with an immutable snapshot, and initial-paint mounting is the one path that always works on affected builds. The keymap layer is kept as a best-effort for builds where it does activate.
1 parent df69ae4 commit 9acc44c

3 files changed

Lines changed: 123 additions & 115 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,10 @@ straight at the TypeScript sources, so there is no build step.
143143
numbers as the web console), not per-machine.
144144
- **Unofficial endpoint**: `/zen/go/v1/usage` is not (yet) in the public Go
145145
docs. It is the endpoint the console uses, but if opencode changes it the
146-
plugin will need a small update.
146+
plugin will need a small update.
147+
- **Host repaint bug on packaged CLI builds**: on some betas the packaged TUI
148+
renders a plugin's initial frame but never repaints its signal updates
149+
(separate reactive graphs — see `anomalyco/opencode#39986`). The widget
150+
sidesteps this by remounting itself with a fresh snapshot on every refresh
151+
and clock tick instead of relying on reactive updates, so it stays live even
152+
on affected builds.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mellena1/opencode-go-usage",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "OpenCode v2 TUI plugin that shows your OpenCode Go subscription usage (5h / weekly / monthly windows) in the sidebar, fetched from the official /zen/go/v1/usage API.",
55
"type": "module",
66
"license": "MIT",

0 commit comments

Comments
 (0)