[PR #13663] fix(tui): stop truncating last table row after streaming completes #14759

Closed
opened 2026-02-16 18:19:31 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13663

State: closed
Merged: No


Summary

Fixes the experimental markdown renderer cutting off the last row of tables (#13539).

Problem

When OPENCODE_EXPERIMENTAL_MARKDOWN=true, tables always have their last row truncated. The opentui <markdown> component's streaming mode intentionally drops the last table row (which may be incomplete during generation):

const rowsToRender = this._streaming && table.rows.length > 0
  ? table.rows.slice(0, -1)  // drops last row during streaming
  : table.rows

However, in the TextPart component, streaming was hardcoded to true:

<markdown
  streaming={true}  // ← always true, even after message completes
  ...
/>

So the last row stayed hidden permanently, even after the response finished generating.

Fix

Pass the actual streaming state based on whether the message has completed:

<markdown
  streaming={!props.message.time.completed}
  ...
/>
  • While the message is being generated: streaming=true (last row hidden, as intended)
  • After the message completes: streaming=false (all rows visible)

Testing

This is a one-line prop change. The message.time.completed field is already used elsewhere in the same component (e.g., calculating response duration on line 1263). The streaming behavior itself is tested in the opentui package's Markdown.test.ts.

Fixes #13539
Related: #12164, #11223

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13663 **State:** closed **Merged:** No --- ## Summary Fixes the experimental markdown renderer cutting off the last row of tables (#13539). ## Problem When `OPENCODE_EXPERIMENTAL_MARKDOWN=true`, tables always have their last row truncated. The opentui `<markdown>` component's streaming mode intentionally drops the last table row (which may be incomplete during generation): ```ts const rowsToRender = this._streaming && table.rows.length > 0 ? table.rows.slice(0, -1) // drops last row during streaming : table.rows ``` However, in the `TextPart` component, `streaming` was hardcoded to `true`: ```tsx <markdown streaming={true} // ← always true, even after message completes ... /> ``` So the last row stayed hidden permanently, even after the response finished generating. ## Fix Pass the actual streaming state based on whether the message has completed: ```tsx <markdown streaming={!props.message.time.completed} ... /> ``` - While the message is being generated: `streaming=true` (last row hidden, as intended) - After the message completes: `streaming=false` (all rows visible) ## Testing This is a one-line prop change. The `message.time.completed` field is already used elsewhere in the same component (e.g., calculating response duration on line 1263). The streaming behavior itself is tested in the opentui package's `Markdown.test.ts`. Fixes #13539 Related: #12164, #11223
yindo added the pull-request label 2026-02-16 18:19:31 -05:00
yindo closed this issue 2026-02-16 18:19:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14759