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

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

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

State: open
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

Single prop change. message.time.completed is already used in the same component for duration calculation. Verified locally — all table rows render after message completes, streaming protection still active during generation.

Fixes #13539
Related: #12164, #11223

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13674 **State:** open **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 Single prop change. `message.time.completed` is already used in the same component for duration calculation. Verified locally — all table rows render after message completes, streaming protection still active during generation. Fixes #13539 Related: #12164, #11223
yindo added the pull-request label 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#14768