Skip to content

fix(mobile): scroll wide tables sideways in the rich Markdown editor - #36966

Merged
AmoabaKelvin merged 2 commits into
mainfrom
fix/mobile-editor-wide-tables-scroll
Nov 1, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
fix/mobile-editor-wide-tables-scroll

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7

ELI5

On a phone, a Markdown table with many columns in the rich editor got crushed into the screen width, so words broke one letter per line. Now a wide table scrolls sideways on its own, like a code block does, and small tables look the same as before.

What Changed

  • Before: a 7-column table was forced into the 358px editor width. Headers like "Owner" and dates like "2026-10-30" stacked vertically, one or two letters per line.
  • After: the table is its own horizontal scroller. Columns keep whole words, and you swipe the table sideways to see the rest. The page itself never scrolls sideways. Two- and three-column tables still fill the width.
  • Mechanism (CSS only, in mobile/src/components/rich-markdown/document-style.ts):
    • The table has no scroll container, and its cells inherit #editor's overflow-wrap: anywhere. That shrinks each cell's minimum width to one glyph, so auto table layout squeezes every column to fit.
    • table becomes display: block; overflow-x: auto, so it scrolls itself.
    • Cells get overflow-wrap: break-word and word-break: keep-all, so a column is never narrower than its longest word, CJK runs included.
    • Cells get max-width: 16em, so a URL can't make one huge column (chat caps its columns at about 220px).
    • Cells get width: 1%. A block-displayed table otherwise shrinks narrow tables to their content width; the 1% keeps them stretched to full width.

Why

  • Wrapper <div> rejected. This is the usual approach (Tiptap's tableWrapper), but the editor is a raw contenteditable with its own serializer. html-block-markdown.ts flattens a div's content inline, so a wrapper needs serializer changes, plus handling for text typed inside it and Enter cloning it. The CSS change keeps the markup and Markdown round trip untouched.
  • Flex or grid table rejected. Neither stretches the anonymous table box, so narrow tables shrink to content width. With width: 1% cells, grid spreads width evenly instead, giving a 99px ID column.
  • min-width on cells rejected. It makes short 3- and 4-column tables scroll for no reason. Columns now size to whole words, the same rule desktop's editor uses.

Linked Issue

Fixes #36412

Visual Proof

iOS 27 simulator Safari, iPhone width, real iOS WebKit, with the editor's real stylesheet and table markup. On iOS the editor runs in the page, so the DOM and CSS are the same. Left: main. Middle: this PR. Right: this PR after a touch swipe on the table. Only the table moves; the heading and the narrow table stay put.

proof.png

Testing

  • Measured main and this branch with the real stylesheet in Playwright Chromium (Android WebView engine) and WebKit (iOS engine) at 390x844:

    • 7-column table: clamped to 358px on main, with letter-by-letter wrapping. On this branch it is a 358px scroller with 547px of content.
    • #editor: never overflows horizontally.
    • 2- and 3-column tables: still 358px wide.
    • Long-URL cell: capped at 16em.
  • Real touch swipe on the table in iOS 27 simulator Safari (screenshots above).

  • Editing through the real document mount (mountRichMarkdownWebDocument) in both engines:

    • Typing at the end of a cell and Enter in a cell give the same Markdown as main.
    • Typing into an off-screen cell scrolls the table, not the editor.
    • Tapping below a document's last table now puts the caret at the end of the table's last row. Trailing code blocks and quotes already do this on main. On main, a table instead sent the typed text above the table.
  • page-stylesheet.test.ts passes; check:code-quality:changed, react-doctor and oxfmt are clean.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

No automated test: jsdom can't lay out tables, and asserting the CSS text would only restate the stylesheet.

AI Disclosure

Review

Two independent reviews (Codex and Claude) ran:

  • Prose columns sit at word width rather than sizing up to 16em (P2). Kept as a tradeoff, see Why. The CSS comment now says the cap is for unbreakable runs.
  • CJK columns still squeezed to one character (CodeRabbit, Major). Fixed with word-break: keep-all. A 7-column Chinese table went from 51px columns to a 689px scroller.
  • No-caret Code block lands in the first cell of a table-first document in WebKit (P1). Not a regression. On main, a no-caret command already lands in a document's first quote or list, and Code block with the caret in any table cell already gives the same code<br />Key result.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Waiting for blessing. What to try (worktree /Users/kelvinamoaba/orca/workspaces/orca/mobile-wide-tables-36412):

  • Open a Markdown file with a 6–7 column table in the phone's rich editor. The table scrolls sideways, columns keep whole words, and the page itself doesn't move sideways.

  • Check a 2–3 column table. It still fills the width with no scrolling.

  • Tap below a table that ends the document and type. The caret goes to the end of the table's last row, like a trailing code block or quote. On main the text jumped above the table.

  • Mobile only: one stylesheet, used by the native WebView document and, scoped under .orca-rich-markdown-document-host, by the page host.

  • No effect on: wire format, host compatibility, SSH or desktop.

  • Related outside PR fix(mobile): allow horizontal scrolling for wide rich markdown tables #36413 makes a similar CSS change; this is our rebuild on latest main.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ccd06db5-1ed0-4618-b82c-eaeb7b49e659
Commits

Reviewing files that changed from the base of the PR and between ff0236a and 8c1f1b0.

Files selected for processing: 1
  • mobile/src/components/rich-markdown/document-style.ts

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

Walkthrough

Table styles in the mobile rich Markdown editor now allow horizontal scrolling. Table cells use 1% widths, a 16em maximum width, break-word wrapping, and keep-all word breaking. Existing spacing, borders, alignment, and typography remain unchanged.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 8c1f1

The CSS change fulfills the stated mobile table-scrolling behavior without an identified merge-blocking issue.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: enabling sideways scrolling for wide tables in the mobile rich Markdown editor.
Linked Issues check Passed For issue [#36412], table now uses display: block and overflow-x: auto, which provides table-level horizontal scrolling. th, td use overflow-wrap: break-word, word-break: keep-all, `max-wi…
Out of Scope Changes check Passed The whole-PR summary and reviewed file show changes only in mobile/src/components/rich-markdown/document-style.ts. The CSS directly implements issue [#36412] for the mobile rich Markdown editor. No …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Description check Passed The pull request description is complete and follows the required template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, scope, review notes, and checkl…
Full details: Linked Issues check

Explanation

For issue [#36412], table now uses display: block and overflow-x: auto, which provides table-level horizontal scrolling. th, td use overflow-wrap: break-word, word-break: keep-all, max-width: 16em, and width: 1%. These rules prevent letter-by-letter compression and keep narrow tables full width. The existing #editor uses overscroll-behavior: contain. The PR reports phone-width checks for wide, narrow, and long-URL tables, plus passing stylesheet tests. Issue [#36412] does not require a new automated layout test.

Full details: Out of Scope Changes check

Explanation

The whole-PR summary and reviewed file show changes only in mobile/src/components/rich-markdown/document-style.ts. The CSS directly implements issue [#36412] for the mobile rich Markdown editor. No unrelated markup, serialization, wire-format, desktop, SSH, or host-compatibility changes are present.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Description check

Explanation

The pull request description is complete and follows the required template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, scope, review notes, and checklist status. The standard lint, typecheck, test, and build checklist items remain unchecked, but the author documents targeted validation and indicates that CI can cover them.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ca6f210c-e00d-46c4-af0f-5e05c592f225
Commits

Reviewing files that changed from the base of the PR and between f79b478 and ff0236a.

Files selected for processing: 1
  • mobile/src/components/rich-markdown/document-style.ts

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

@AmoabaKelvin
AmoabaKelvin force-pushed the fix/mobile-editor-wide-tables-scroll branch from 8c1f1b0 to 9306e85 Compare November 1, 2026 10:12
@AmoabaKelvin
AmoabaKelvin merged commit 17a43f6 into main Nov 1, 2026
26 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.

[Bug]: Wide tables in mobile rich Markdown editor compress columns instead of scrolling horizontally

1 participant