Skip to content

Show a table in the chat as a table, as opencode does - #40

Merged
TechNomadCode merged 2 commits into
mainfrom
feat/markdown-tables
Oct 21, 2026
Merged

TechNomadCode merged 2 commits into
mainfrom
feat/markdown-tables

Conversation

@TechNomadCode

@TechNomadCode TechNomadCode commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Slice 19: a Markdown table in the assistant's reply shows as a real table, the way opencode's desktop app shows one (markdown.css, Tables, at 50c5fce), instead of a labelled card per row.

  • The header's named cells are column headers in medium weight over a stronger hairline; rows are apart by faint hairlines; no vertical lines; cells top-aligned with 12px padding. No pipe or Markdown mark shows as typed.
  • <br> stays a line break inside its cell; an empty cell stays empty; a row with more cells than the header keeps them, and every row is padded so the hairlines run the full width.
  • A table wider than the chat scrolls sideways inside the message, never the page. While it scrolls, its box is a named region in the tab order ("Table, scrolls sideways"), so the keyboard reaches it (axe's scrollable-region-focusable); a table that fits adds no tab stop.
  • Unlike opencode's, each cell is at least 144px wide, so a wide table scrolls instead of squeezing its columns to a word per line (docs/decisions.md, Design).
  • A second commit records the owner's choice for slice 20: opencode's "Thinking" row, then "Thought 7s" (docs/decisions.md, docs/plan.md).

For the measurement lane: this changes the parser in src/lib/markdown.ts, which only the browser uses; the model never sees its output. Nothing in src/server changes.

Tests: the parser's and the renderer's unit tests are rewritten for tables; two new end-to-end tests in tests/e2e/chat.spec.ts open a kept conversation holding a wide and a narrow table, at 1440px and 375px, with the accessibility check. Local: verify (468 unit tests) and test:e2e (66) passed.

TechNomadCode and others added 2 commits October 21, 2026 10:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TechNomadCode
TechNomadCode merged commit b446e43 into main Oct 21, 2026
5 checks passed
@TechNomadCode
TechNomadCode deleted the feat/markdown-tables branch October 21, 2026 08:28
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.

1 participant