Skip to content

fix(tui): keep sidebar reactive while mounted (fixes #7438) - #7460

Open
MoerAI wants to merge 1 commit into
code-yeongyu:devfrom
MoerAI:fix/tui-sidebar-reactivity
Open

fix(tui): keep sidebar reactive while mounted (fixes #7438)#7460
MoerAI wants to merge 1 commit into
code-yeongyu:devfrom
MoerAI:fix/tui-sidebar-reactivity

Conversation

@MoerAI

@MoerAI MoerAI commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keep the OpenCode sidebar live while its slot remains mounted. Mirror changes now update a Solid signal consumed by a reactive child accessor, so active and idle views reconcile without reopening or resizing the TUI.

Root Cause

OpenCode invokes a slot renderer once and retains its returned node tree. The poller updated a plain closure variable and called requestRender(), but that only requested a frame; it did not rebuild the static sidebar tree.

Changes

File Change
packages/omo-opencode/src/tui.ts Back the mounted sidebar with a Solid signal and reactive insert accessor.
packages/omo-opencode/src/tui.test.ts Add deterministic active and idle transitions against one real OpenTUI renderer root.
script/build.ts Keep solid-js external so OpenTUI and the plugin share one runtime.
package.json, bun.lock Declare OpenTUI's exact Solid peer as a direct runtime dependency.
.omo/evidence/20260828-issue-7438-tui-sidebar-reactivity/README.md Record failing-first, full verification, isolated TUI QA, and DB isolation evidence.

Reproduction Before Fix

Expected mounted frame to contain: runtime-agent
Received: the original Models frame

The poll consumed the changed snapshot, but the already-mounted tree stayed unchanged.

Verification After Fix

TUI sidebar suite: 60 pass, 0 fail, 121 assertions
bun run typecheck: exit 0
bun run build: build: all steps completed
bun install --frozen-lockfile --ignore-scripts: exit 0
TUI_BUNDLE_SOLID_EXTERNAL=PASS

Real OpenCode 1.18.23 TUI under isolated tmux:

ACTIVE_TRANSITION=PASS
IDLE_TRANSITION=PASS
ISOLATION=PASS:7933

The mounted sidebar showed the live agent, removed it on the idle snapshot, and the real OpenCode DB session count remained unchanged.

Risk

Low. The mirror schema, polling cadence, slot order, and rendered view model are unchanged. The patch changes only how the existing view reaches the mounted OpenTUI tree.

Fixes #7438


Summary by cubic

Fixes the TUI sidebar so it stays live while mounted instead of freezing on the originally rendered frame. Mirror snapshot changes now flow through a Solid signal into a reactive child accessor, so active and idle views reconcile without reopening or resizing the TUI. Fixes #7438.

Dependencies

  • Adds solid-js 1.9.12 as a direct runtime dependency, pinned to match OpenTUI's peer.
  • Keeps solid-js external in the bundle so the plugin and OpenTUI share one Solid runtime.

Written for commit 0b447aa. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added the opencode OpenCode edition: packages/omo-opencode label Aug 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b447aab60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

```text
Before fix: expected "runtime-agent"; mounted frame remained on Models.

Sidebar suite: 60 pass, 0 fail, 121 assertions

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add paths to captured QA outputs

This evidence directory contains only this summarized README, with no exact command/output artifacts and no paths to such artifacts. Because the change touches the OpenCode TUI, the recorded pass counts and transition markers cannot be independently audited, and the repository's mandatory QA evidence gate is not satisfied until the captured outputs are stored and referenced here.

AGENTS.md reference: AGENTS.md:L38-L42

Useful? React with 👍 / 👎.

@MoerAI

MoerAI commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

opencode OpenCode edition: packages/omo-opencode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI sidebar panel freezes mid-session — requestRender() doesn't re-run renderSidebar, only a full relayout unsticks it

1 participant