Skip to content

Make Markdown tables responsive like Notion#16

Merged
minchenlee merged 3 commits into
mainfrom
codex/table-cell-overflow
Jul 24, 2026
Merged

Make Markdown tables responsive like Notion#16
minchenlee merged 3 commits into
mainfrom
codex/table-cell-overflow

Conversation

@minchenlee

Copy link
Copy Markdown
Owner

Summary

  • Rework Markdown table layout around shared, content-driven column widths.
  • Fill the document width when the table fits; expose horizontal scrolling when it does not.
  • Render complete row surfaces with Notion-like header weight, restrained dividers, and consistent cell padding.
  • Keep the horizontal scrollbar rail transparent and show the thumb while scrolling, hovering, or dragging, then fade it after the existing scroll timeout.

Root cause

The previous row/cell layout let cell content determine isolated widget bounds, which caused long content to paint outside its cell and left row backgrounds visually incomplete. The new adaptive layout measures columns together and lays every cell out against the same column widths.

Validation

  • cargo check
  • cargo test --lib (321 passed)
  • cargo test --tests (all passed)
  • cargo build --release --bin rmdv
  • rustfmt --edition 2021 --check src/app.rs src/render.rs
  • git diff --check

Unrelated existing documentation changes in the worktree were intentionally left out of this PR.

@minchenlee
minchenlee marked this pull request as ready for review July 22, 2026 09:01

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f50d6b1551

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/render.rs
Comment on lines +1499 to +1505
for (index, (cell, state)) in self.cells.iter_mut().zip(&mut tree.children).enumerate() {
let column = index % columns;
let node = cell
.as_widget_mut()
.layout(state, renderer, &measure_limits);
column_widths[column] =
column_widths[column].max(node.size().width.min(Self::MAX_COLUMN_WIDTH));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid measuring Fill cells at infinite width

When a table has three or more nonempty columns, the horizontal scrollable supplies an unbounded maximum width (as the comment below notes), but each measured cell is a container(...).width(Length::Fill). That first layout therefore reports an infinite cell width, which this line reduces to MAX_COLUMN_WIDTH; every nonempty column becomes 320 px regardless of its content. For example, a three-column table with single-character headers is rendered at 962 px and horizontally scrolls in the normal 780 px reading column instead of fitting it. Measure a shrink-wrapped version of each cell (or its child) in this pass, then apply the fill cell wrapper only in the fixed-column layout pass.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: ef87b4672e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@minchenlee
minchenlee merged commit 6afdada into main Jul 24, 2026
2 checks passed
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