anomalyco / anomalyco/opencode

tui v2: sidebar slot colors stay stale after system theme change

Open
#40,023 1 comment 0 reactions 1 assignee View on GitHub

@simonklee is already working on this.

Since Aug 1, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

TUI sidebar slot content does not update its foreground colors after the terminal switches between light and dark mode. The sidebar shell updates, but the built-in Context and MCP slot content keeps colors from the mode in which the TUI was opened.

Environment

  • opencode version: 0.0.0-next-16650
  • OS: Ubuntu 26.10, Linux 7.0.0-28-generic x86_64
  • Terminal: Ghostty (TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: zsh
  • Install/channel: npm global install, next
  • Active TUI plugins: local TPS sidebar plugin (oc-tps.tsx)
  • Theme configuration: vercel, mode: "system"

Reproduction

  1. Set theme.mode to "system" and use a theme with both light and dark variants, such as vercel.
  2. Open the TUI while the terminal follows the system light appearance. Context and the MCP list initially render correctly.
  3. Switch the terminal's system appearance to dark without restarting the TUI.
  4. Observe that the sidebar background/title updates to dark mode, but Context and MCP text retains its light-mode dark foreground and becomes nearly invisible.
  5. Restart the TUI while the terminal follows the system dark appearance, then switch the terminal's system appearance to light. The failure is reversed: Context and MCP retain dark-mode light foregrounds and become nearly invisible.

Expected Behavior

All sidebar content, including built-in Context and MCP plugins, updates its foreground colors when the TUI detects a terminal light/dark mode change.

Actual Behavior

Only the sidebar shell updates. Built-in slot content retains colors from the mode active at mount time. The problem reproduces consistently in both directions and does not depend on MCP server configuration.

Screenshots

Light -> dark Dark -> light
Sidebar after switching from light to dark Sidebar after switching from dark to light

Additional Context

The issue is visible in built-in sidebar slots; the local TPS plugin is only an additional symptom:

  • tui/src/feature-plugins/sidebar/context.tsx stores const theme = props.context.theme in View.
  • tui/src/feature-plugins/sidebar/mcp.tsx does the same.

This appears to capture a theme snapshot. The theme provider changes the selected mode and updates the sidebar shell, while these slot colors remain stale.

This also makes custom sidebar plugins unable to safely use context.theme for mode-aware colors. A local TPS sidebar plugin either inherits a foreground that is only visible in one mode or captures the mode active at mount.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.