Skip to content

TUI: unreadable mouse text selection in light mode (default opencode theme) #41281

Closed as not planned

Description

@uno0uno

Summary

In light mode, mouse text selection (drag / copy-on-select) becomes unreadable: selected text renders as a near black-on-black block. Dark mode selection looks fine. This reproduces on the default opencode theme and likely any built-in theme whose light-mode text is a dark color, because the TUI theme model does not define mouse selection foreground/background and OpenTUI falls back to inverting colors.

Acceptance criteria

  • With theme opencode (default) and light mode, dragging to select chat/output text keeps readable contrast (clear fg and bg)
  • Copy-on-select still works (selection copies; toast/behavior unchanged)
  • Dark mode selection remains readable (no regression)
  • Themes without explicit selection colors get a luminance-aware fallback (or shared default selection colors), not invert-only on light text
  • Optional but preferred: theme schema/docs allow explicit mouse selection colors (distinct from selectedListItemText used by list UI)

Scope

  • Files/routes: packages/tui/src/theme/index.ts (Theme type / resolve), packages/tui/src/theme/assets/opencode.json (and shared fallback), packages/tui/src/context/theme.tsx / renderer wiring, OpenTUI selection color application as needed
  • Repos: anomalyco/opencode (TUI)
  • Out of scope: Desktop/web chrome; adding new themes to the picker; WARO product work; OpenCode V2 config migration; unrelated theme polish

Code notes (local repro research)


WR sizing decision

Dimension Points Max Notes
Duration 0 25 TUI bugfix, ≤1–2 days
PR scope 5 25 1 PR: selection colors + wire to OpenTUI
Surface 0 20 packages/tui theme/renderer
Repos 0 15 OpenCode only
Shippability 0 15 Independent
Parallelism 0 5 Single track
Total 5 100

Verdict: SINGLE_ISSUE

Workflow

Local clone: /Users/saifer/Documents/WEBS/opencode (dev).

Implement on a fork branch → PR into anomalyco/opencode. Prefer fixing selection colors at theme/renderer level (at least for default opencode light), not recommending users switch themes.

LLM contract

Implementation plan can live in .wr/<issue>.yaml on the PR branch if used locally; GitHub issue body is the source of truth for AC.

Activity

  1. github-actions commented on Aug 8, 2026

    @github-actions
    Contributor

    This issue does not follow our contributing guidelines.

    What needs to be fixed:

    • The issue does not use the standard bug report template (missing required fields: Steps to reproduce, OpenCode version, Operating System, Terminal)
    • The issue body appears to be AI-generated, containing structured WR sizing tables, a "Workflow" section, an "LLM contract" section, and detailed internal code file references — this kind of AI-generated content is not acceptable for issue reports

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. uno0uno commented on Aug 8, 2026

    @uno0uno
    Author

    Summary

    • Added theme-aware mouse selection colors (selectionBg / selectionFg) so light mode no longer relies on OpenTUI invert (black-on-black)
    • Wired into session selectable content; PR opened from fork

    How it was validated

    • packages/tui theme tests → 10 pass (incl. light/dark selection contrast)
    • packages/tui tsgo --noEmit → pass

    PR

    (see linked pull request)


    Posted by Saifer.

  3. github-actions commented on Aug 8, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions