anomalyco / anomalyco/opencode
question tool: hover causes option text to overlap gray description (CJK)
@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/solid0.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
- Rendering code:
packages/tui/src/routes/session/question.tsx(lines ~369-395). Each option is abox(defaultflexDirection: column) containing aflexDirection="row"label line plus apaddingLeft={3}description line. Layout structure looks correct. parseFlexDirection(undefined)defaults toFlexDirection.Columnin@opentui/core, so vertical stacking is expected.- I wrote headless reproduction tests against
sst/opentuimain (solidtestRender+ native renderer +mockMouse.moveTosimulating 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. - 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
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.