Skip to content

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

Closed as not planned

Description

@dmmop

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.

Activity

  1. github-actions commented on Aug 1, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions