Skip to content

fix(web): fit wrapped Markdown tables to the available width - #341

Merged
incognitojam merged 3 commits into
mainfrom
styal/fix-markdown-table-truncation
Sep 16, 2026
Merged

incognitojam merged 3 commits into
mainfrom
styal/fix-markdown-table-truncation

Conversation

@incognitojam

@incognitojam incognitojam commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Note

Wrapped tables fit the document width; dense tables can switch to horizontal scrolling without truncating values.

What Changed

Wrapped Markdown tables now use the available width and let rows grow with their content. The footer button keeps the original Expand table cells / Collapse table cells labels and icons. Collapsed mode keeps complete values on one line, accessible with horizontal scrolling and visible scrollbars. Very dense tables can still overflow to keep headings readable.

Why

Prose-heavy tables could extend beyond the document and fade out the last column even with wrapping enabled. Remove the table's unconditional intrinsic minimum width and the column-width measurements that prevented it from shrinking after toggling. This applies to the shared web/desktop Markdown renderer, including messages and file previews; the native mobile renderer is unchanged.

Fork ledger and upstream overlap

The markdown-table-layout ledger entry records the behavior to preserve, exact watched paths, verification limits, and retirement conditions. Upstream pingdotgg/t3code#8868 exposes scrollbars only; the assessed upstream commit e8ca3a82806dff84438d5aba66b693468f7ca426 still locks expanded column widths and truncates collapsed cells. The entry records this as partial overlap with review needed.

Validation

  • 63 focused Markdown and clipboard tests passed.
  • Web typecheck, targeted lint, and formatting checks passed.
  • Fork ledger validation passed for all 54 entries; 63 settings tests passed. Settings tests cover the Word wrap default, while layout evidence comes from the real-client verification below.
  • Verified all five synthetic table cases in the running app at content widths of 480, 640, and 848 pixels, including switching to horizontal scrolling and back without retaining column widths.

UI Changes

The same synthetic document is shown in a 1024 × 768 viewport, with the sidebar hidden and the document panel maximized (848-pixel content width). All screenshots start at the left edge of each table. The main table renderer is unchanged between the PR base and main (a2ed7f7dc); the PR screenshots use bf05cf93d.

Mode Main This PR
Expanded / reading Cells wrap, but the prose table remains wider than the page. Main expanded: the description column overflows Cells wrap to fit the available width. PR expanded: all descriptions and END markers fit
Collapsed / scanning Rows stay short, but long values are truncated with ellipses. Main collapsed: the long code value ends in an ellipsis Rows stay short, with complete values accessible by scrolling horizontally. PR collapsed: long values remain on one line without ellipses

Both implementations retain expanded and collapsed modes with the same labels and icons. Collapsed columns can be wider in this PR because their contents are no longer truncated.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for UI changes

Written by an agent (Codex, GPT-6).

@github-actions github-actions Bot added size:L and removed size:M labels Sep 16, 2026
@github-actions github-actions Bot added size:M and removed size:L labels Sep 16, 2026
@incognitojam
incognitojam enabled auto-merge (squash) September 16, 2026 16:47
@incognitojam
incognitojam merged commit 5c5cc33 into main Sep 16, 2026
12 checks passed
@incognitojam
incognitojam deleted the styal/fix-markdown-table-truncation branch September 16, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant