Skip to content

fix(tui): fix markdown table rendering and dialog dimmer color issues#15814

Closed
trry-hub wants to merge 2 commits intoanomalyco:devfrom
trry-hub:fix/tui-rendering-bugs-13855-13363
Closed

fix(tui): fix markdown table rendering and dialog dimmer color issues#15814
trry-hub wants to merge 2 commits intoanomalyco:devfrom
trry-hub:fix/tui-rendering-bugs-13855-13363

Conversation

@trry-hub
Copy link

@trry-hub trry-hub commented Mar 3, 2026

Issue for this PR

Closes #13855, #13363

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR fixes two TUI rendering bugs:

Bug #13855 - Markdown table last row missing

The last row of markdown tables was missing after message streaming completed. The TextPart component passed streaming={true} unconditionally to markdown and code elements, even for completed messages. OpenTUI skips the last table row during streaming (thinking it's incomplete), and doesn't re-render when streaming changes because tokenRaw hasn't changed.

Fixed by deriving streaming state from message.time.completed using createMemo(). Added const isStreaming = createMemo(() => !props.message.time.completed) and changed streaming={true} to streaming={isStreaming()}. This ensures OpenTUI renders all table rows when the message is complete.

Bug #13363 - Dialog dimmer color on light themes

Dialog backgrounds were rendering incorrectly on light terminal themes since PR #8467 introduced background transparency. The dimmer rendered against a black buffer rather than the terminal background, breaking contrast.

The dialog dimmer used hardcoded black semi-transparent background RGBA.fromInts(0, 0, 0, 150). Fixed by using the theme's background color with 0.6 opacity: new RGBA(theme.background.r, theme.background.g, theme.background.b, 0.6). This ensures proper contrast on both light and dark terminal themes.

How did you verify your code works?

Bug #13855:

  • Tested with OPENCODE_EXPERIMENTAL_MARKDOWN=true
  • Asked AI to output markdown tables with 5+ data rows
  • Verified all rows including the last row are displayed correctly
  • Tested both markdown and code rendering paths

Bug #13363:

  • Tested with light terminal theme
  • Set opencode theme to system
  • Opened various dialogs like /model and /agent
  • Verified dialog dimmer has proper contrast and readability
  • Tested with dark theme to ensure no regression

Screenshots / recordings

Not applicable - both are TUI rendering fixes

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

shihzu added 2 commits March 3, 2026 16:55
…nomalyco#13855)

- Derive streaming state from message.time.completed in TextPart component
- Fixed issue where last table row was missing after message streaming
- Changed streaming from fixed value to reactive: streaming={true} -> streaming={isStreaming()}
- Ensures OpenTUI renders all table rows when message is complete

Closes anomalyco#13855
…alyco#13363)

- Changed dimmer background from hardcoded black to use theme.background
- Fixed dialog visibility issue on light terminal themes
- Now dimmer uses theme's background color with 0.6 opacity
- Improves contrast and readability across all terminal color schemes

Closes anomalyco#13363
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

The following comment was made by an LLM, it may be inaccurate:

Found potential related PRs:

  1. PR fix(tui): use theme-aware color for dialog overlay on system theme #14686 - "fix(tui): use theme-aware color for dialog overlay on system theme"

  2. PR fix(tui): stop streaming markdown/code after message completes #13854 - "fix(tui): stop streaming markdown/code after message completes"

    • Related to the markdown streaming issue. This appears to address similar streaming state problems.
  3. PR fix(tui): stop truncating last table row after streaming completes #13674 - "fix(tui): stop truncating last table row after streaming completes"

These PRs appear to address the same issues covered in PR #15814, particularly around markdown table rendering during streaming and dialog dimmer colors on light themes. You may want to verify if these have already been merged or closed, or if PR #15814 supersedes them.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@trry-hub
Copy link
Author

trry-hub commented Mar 3, 2026

I just discovered that this PR duplicates existing work already in progress:

Markdown table streaming fix (Bug #13855):

Dialog dimmer color fix (Bug #13363):

I apologize for not checking existing PRs before submitting. I'm closing this PR to avoid wasting the maintainers' time and to prevent duplication.

Great work to @mocksoul, @dylan-conlin, and the author of #14686 for already working on these fixes! 🎉

@trry-hub
Copy link
Author

trry-hub commented Mar 3, 2026

Closing as duplicate - fixes already in progress in PRs #13854, #13674, and #14686

@trry-hub trry-hub closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tui): last table row missing in markdown rendering

1 participant