anomalyco / anomalyco/opencode

question tool: hover causes option text to overlap gray description (CJK)

Open
#41,393 1 comment 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Aug 9, 2026.

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

Description

Bug: question tool options — hover causes text to overlap the gray description

Environment

  • opencode 1.18.15 (Homebrew), macOS
  • @opentui/core / @opentui/solid 0.4.5
  • Options contain CJK (Chinese) labels and descriptions

Symptom
In the interactive question tool, when the mouse hovers over an option, the option's own text visually overlaps/covers the gray description text below it. The description also renders truncated/misaligned (e.g. 提供相关代码片段 appears as a garbled fragment like 关代码片段 with the leading chars missing). The "Type your own answer" row sometimes shows its text twice, suggesting residual/leftover frame content.

Reproduction pattern: it happens "sometimes" — not every time — and only in the real terminal session, not reproducible in headless tests.

What I investigated

  1. Rendering code: packages/tui/src/routes/session/question.tsx (lines ~369-395). Each option is a box (default flexDirection: column) containing a flexDirection="row" label line plus a paddingLeft={3} description line. Layout structure looks correct.
  2. parseFlexDirection(undefined) defaults to FlexDirection.Column in @opentui/core, so vertical stacking is expected.
  3. I wrote headless reproduction tests against sst/opentui main (solid testRender + native renderer + mockMouse.moveTo simulating real hover, capturing char frames and spans): no overlap, no truncation, no residual text in any frame. Layout and native rendering logic appear fine in isolation.
  4. The bug only shows in the real terminal, and only intermittently — this points to incremental diff re-rendering on onMouseOver (background color change only) interacting with CJK wide-character width handling in the real terminal output path.

Hypothesis

  • Likely the incremental re-render on hover (background color change) has a redraw-region calculation issue when CJK wide chars are involved, or leftover-frame artifacts in the native span feed when only the background changes.
  • Could also be terminal-specific interpretation of emitted ANSI sequences.

Request

  • Confirm whether this is a known rendering issue.
  • I can provide terminal type details and a screen recording of the hover behavior if useful.

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.