Skip to content

fix(tui): render markdown tables in bounded columns#24074

Closed
glesperance wants to merge 1 commit into
NousResearch:mainfrom
glesperance:fix/tui-markdown-table-rendering
Closed

fix(tui): render markdown tables in bounded columns#24074
glesperance wants to merge 1 commit into
NousResearch:mainfrom
glesperance:fix/tui-markdown-table-rendering

Conversation

@glesperance

Copy link
Copy Markdown
Contributor

Rationale

Markdown tables in the TUI could render as visually broken output when cells contained long titles, links, or HTML line breaks. Adjacent Ink text nodes wrapped independently, which let cells collide (for example, dates glued into paper titles), and optimistic body widths could produce right-edge truncation artifacts.

Summary

  • Render Markdown tables as fixed-width bordered tables with pre-wrapped cell rows.
  • Normalize table cell text by stripping inline Markdown for layout and replacing <br> with spaces.
  • Keep table borders white while leaving table cell content at the default terminal text color; header rows remain bold.
  • Pass measured body width through streaming and non-streaming Markdown render paths.

Test Plan

  • npm test -- --run src/__tests__/markdown.test.ts
  • npm run type-check
  • npm run build
  • npm exec prettier -- --check src/components/markdown.tsx src/__tests__/markdown.test.ts src/components/messageLine.tsx src/components/streamingMarkdown.tsx
  • git diff --check

Note: full npm run lint still reports pre-existing errors outside this change; the changed files only had padding warnings before local cleanup.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 12, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Automated hermes-sweeper review: this looks implemented on current main by the merged TUI table-rendering work in #26195. Thanks for the original fix here — it covered the same markdown-table collision/overflow problem and helped identify the right surface.

Evidence:

  • fix(tui): width-aware markdown table rendering with vertical fallback #26195 was merged as 55c9f32060bbe7eb48bee2b702c157408b468eb2 with the title fix(tui): width-aware markdown table rendering with vertical fallback, and its discussion explicitly notes that it supersedes fix(tui): render markdown tables in bounded columns #24074.
  • Current main has the width-aware renderTable() implementation in ui-tui/src/components/markdown.tsx, including display-width measurement, column shrinking/wrapping, safety overflow detection, and vertical fallback.
  • Current main passes the measured transcript body width through both non-streaming and streaming Markdown render paths in ui-tui/src/components/messageLine.tsx and ui-tui/src/components/streamingMarkdown.tsx.
  • The merge commit is contained in release tag v2026.5.16.

Closing as implemented on main.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants