Skip to content

fix(layout): keep indented tables readable in Read Mode (#8063) - #8121

Merged
autocraft-bot[bot] merged 1 commit into
storytold:mainfrom
OPUZZLES:fix/8063-readable-table-indent
Dec 2, 2026
Merged

autocraft-bot[bot] merged 1 commit into
storytold:mainfrom
OPUZZLES:fix/8063-readable-table-indent

Conversation

@OPUZZLES

@OPUZZLES OPUZZLES commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #8063.

With a 400 pt indent in the reported viewport, the four-column table was reduced to 1 pt in Read Mode. Reserve at least half of the table width fitted to the reading column. The existing position clamp then reduces the indent in either writing direction.

The regression covers the reported indent, an indent just inside the column edge, a normal indent and the authored indent in Print Layout.

Validation

  • The regression failed on the base branch at 1 pt and passes with the fix.
  • cargo test --locked -q -p wordcraft-layout with development-profile dependency overrides. 843 passed and 2 were already ignored.
  • cargo fmt --all --check, cargo clippy --locked -q -p wordcraft-layout --all-targets -- -D warnings, cargo xtask layers and cargo xtask wasm passed.

Summary by CodeRabbit

  • Bug Fixes
    • In Reading view, tables with excessive indentation now fit within the available column while retaining at least half their unindented width. This applies to both left-to-right and right-to-left layouts.
    • Print layout continues to preserve the table’s authored indentation and width. Ordinary indentation in Reading view remains unchanged.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Reading view now reserves a minimum amount of room for indented tables, preventing large positive start offsets from reducing the calculated room to 1 point. Regression tests cover LTR and RTL reading layouts and print layout.

Changes: Reading-view table width

Layer / File(s) Summary
Minimum room and regression coverage
crates/layout/src/table.rs, crates/layout/src/tests.rs
table_frame now keeps room of at least half the fitted table width, capped by available width and with a 1-point minimum. Tests check ordinary and excessive indentation in Reading view for LTR and RTL, and confirm print layout retains the authored indent and table width.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • Issue 6604 concerns how table_frame calculates room for indented tables. This change modifies that calculation, but whether it addresses the issue’s auto-width table behavior is not established.

Suggested reviewers: benandez, vangel76

Merge Risk: Minimal · up to 14111

Tables with a very large indent in Read Mode should now keep a readable width instead of shrinking to 1 pt. Regression tests cover both writing directions and Print Layout, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix and the affected area: indented tables in Read Mode. It matches the main change, which reserves minimum table width so tables stay readable when the indent exceeds the reading …
Linked Issues check Passed [#8063] The issue asks that a table indented past the reading column stay readable in Read Mode. Its reported case is a 4-column table with a 400 pt indent in a column about 360 pt wide. The current f…
Out of Scope Changes check Passed The changes are a small edit to table_frame in crates/layout/src/table.rs (+2/-1) and one regression test in crates/layout/src/tests.rs (+37). Both connect directly to #8063: the code changes the room…
Full details: Title check

Explanation

The title names the fix and the affected area: indented tables in Read Mode. It matches the main change, which reserves minimum table width so tables stay readable when the indent exceeds the reading column. The title follows the conventional commit format and cites issue #8063, which the linked objectives describe.

Full details: Linked Issues check

Explanation

[#8063] The issue asks that a table indented past the reading column stay readable in Read Mode. Its reported case is a 4-column table with a 400 pt indent in a column about 360 pt wide. The current fix, per the PR summary of crates/layout/src/table.rs, changes the room calculation in table_frame. In Reading view, room after a positive start offset is now at least half the fitted table width, capped by available width. Before, room was available width minus the offset, with a 1 pt minimum. The existing position clamp then pulls the indent back inside the column with the table still about half its width. The issue offers capping or dropping the indent as an option and says a decision on appearance is needed. The PR records that decision. The added regression test in crates/layout/src/tests.rs covers the reported 400 pt indent, an indent at column - 12 pt, a normal indent, and print-layout preservation of the authored indent, for LTR and RTL. The author reports that the regression fails at 1 pt on the base and passes with the fix. Limits: the code diff could not be read in this review (blob unavailable), so this verdict rests on the PR summary, the AI-generated change summary, and the author's reported test results.

Full details: Out of Scope Changes check

Explanation

The changes are a small edit to table_frame in crates/layout/src/table.rs (+2/-1) and one regression test in crates/layout/src/tests.rs (+37). Both connect directly to #8063: the code changes the room calculation for indented Read Mode tables, and the test checks that behavior. The summary reports no changes to exported or public declarations. No unrelated change is described. The code diff itself could not be read in this review, so this verdict is based on the PR summary and the change summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 54f6709 and 1411165.

Files selected for processing: 2

  • crates/layout/src/table.rs
  • crates/layout/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@autocraft-bot

autocraft-bot Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Automated message. Not a maintainer decision.

Merged.

Started and approved by automatic merge rule.

Details for maintainers: this item

@autocraft-bot autocraft-bot Bot added the bugfix Fixes something that is broken: wrong result, crash, data loss label Dec 2, 2026
@autocraft-bot
autocraft-bot Bot merged commit 72e5454 into storytold:main Dec 2, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes something that is broken: wrong result, crash, data loss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read Mode: a table indented past the column's width shrinks to almost nothing

2 participants