anomalyco / anomalyco/opencode
tui v2: sidebar slot colors stay stale after system theme change
@simonklee is already working on this.
Since Aug 1, 2026.
- 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
- Set
theme.modeto"system"and use a theme with both light and dark variants, such asvercel. - Open the TUI while the terminal follows the system light appearance. Context and the MCP list initially render correctly.
- Switch the terminal's system appearance to dark without restarting the TUI.
- 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.
- 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 |
|---|---|
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.tsxstoresconst theme = props.context.themeinView.tui/src/feature-plugins/sidebar/mcp.tsxdoes 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.