Environment
- OpenCode Desktop 2.2.2 (AppImage, Linux x64)
- Omarchy 4.0.6, Hyprland, Wayland
Summary
In the right pane's New tab view, some launcher rows do not respond to mouse clicks, while their keyboard shortcut still works. The rows that break are exactly the ones whose host menu item is registered with a factory function, so the item object is rebuilt on every recomputation of the shared menu memo.
Steps to reproduce
- Open a session with the right pane visible.
- Focus the composer so the session streams a response (or use a session with uncommitted file changes).
- Click a launcher row such as
Review.
Actual behaviour
Nothing happens. The row highlights on hover, so hit testing works, but the click never reaches item.run().
Expected behaviour
Clicking the row opens the panel, exactly as Ctrl+Alt+R does.
Evidence
A MutationObserver on the New tab view counted repeated creation of the same launcher buttons while the app sat idle:
thẻ mới được tạo: 145 ReviewCtrlAltR
thẻ mới được tạo: 146 Git & GitHubChanges,
thẻ mới được tạo: 147 ReviewCtrlAltR
thẻ mới được tạo: 148 Git & GitHubChanges,
... 160+
Only Review and Git & GitHub were recreated. Terminal and Open file stayed put.
Root cause
app/src/runtime/plugin/panel-menu.ts builds the shared list in a memo:
return createMemo(() =>
host
.list(MenuItem)
.flatMap((item) => (item.menu === "session.panel" ? [item] : []))
.toSorted((a, b) => (a.order ?? 0) - (b.order ?? 0)),
)
host.list(MenuItem) invokes every registered factory inside that memo's tracking scope, so reactive reads inside any factory become dependencies of the whole memo. When one of those reads changes, the memo recomputes and every factory-registered item comes back as a new object.
Two of the four items read fast-changing state:
gui-plugins/src/review/renderer.tsx reads the routed session and its changed-file count.
- The
Git & GitHub item in opencode-github-panel/src/window.tsx:107 reads ctx.sessions.current() and ctx.layout.state(...).
Terminal is registered as a static object, and Open file's factory reads no reactive session state, so both keep their identity.
app/src/runtime/plugin/side-region.tsx then renders those items with <For>, which reconciles by object identity:
A new object identity makes Solid destroy the existing <button> and create a replacement. Because a click requires mousedown and mouseup on the same node, the replacement between the two events cancels the click. The keyboard shortcut still works because it is registered as a command and calls run() directly.
Impact
A third-party plugin can break the clicks of a core launcher (Review is shipped with the app). Removing opencode-github-panel reduced the churn to zero and the launcher clicks started working again, which confirms the mechanism.
Suggested fix
Make the list stable per item id, so a recomputation keeps DOM nodes:
- Deduplicate and key items by
${plugin}:${id} in createSessionPanelMenu(), returning the previous object when its id is unchanged.
- Or render with a keyed list instead of
<For> on raw objects.
Either change makes click handling independent of how often item factories run.