Skip to content

fix(mobile): allow horizontal scrolling for wide rich markdown tables - #36413

Closed
ian-nocturne wants to merge 2 commits into
stablyai:mainfrom
ian-nocturne:fix/mobile-rich-markdown-table-scroll
Closed

ian-nocturne wants to merge 2 commits into
stablyai:mainfrom
ian-nocturne:fix/mobile-rich-markdown-table-scroll

Conversation

@ian-nocturne

@ian-nocturne ian-nocturne commented Oct 30, 2026 •

Copy link
Copy Markdown

ELI5

On a narrow phone screen, wide Markdown tables in the mobile rich editor squeezed every column into tiny vertical strips of letters. Tables in the rich editor now stay comfortably wide per column and scroll sideways inside the document without dragging the whole page.

What Changed

  • mobile/src/components/rich-markdown/document-style.ts:
    • Added display: block, overflow-x: auto, and overscroll-behavior-x: contain to table in richMarkdownEditorStyle().
    • Added min-width: 10em, max-width: 22em, overflow-wrap: break-word, and word-break: keep-all to th, td.

Before: A 7-column Markdown table on a 390px viewport had width: 358px and scrollWidth: 358px, squishing all columns together.

After: The table box remains bounded inside the 390px viewport (width: 358px, right edge 374px), while inner columns lay out cleanly (scrollWidth: 1065px) and pan horizontally (scrollLeft verified at 200px) with overscroll-behavior-x: contain containing horizontal overscroll.

Why

Markdown tables in technical specifications and release notes frequently exceed 4–5 columns. Giving cells a 10em–22em width envelope with word-break: keep-all (preserving CJK word legibility while overflow-wrap: break-word wraps long identifiers/URLs) and making table an overflow-x scroll container fixes readability in CSS alone without altering ProseMirror/TipTap schema DOM wrappers.

Linked Issue

Fixes #36412

Visual Proof

Rendered from the mobile web bundle with the repo's official render harness (config/scripts/mobile-web-app/preview/mobile-web-app-render-harness.mjs) at 390×844 dark theme with a 7-column demo Markdown table (zero personal data, zero page errors or bridge faults).

Before (main, squished at 358px) After (this PR, scrollable 1065px inside 358px box)
Before: 7-column table compresses into 358px without horizontal scrolling After: readable columns scroll horizontally inside the 390px viewport

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Why no unit test file is added: this is a pure CSS stylesheet change in document-style.ts; asserting literal CSS strings in a unit test is an inventory/string-copy anti-pattern (docs/agents-md-refs/test-antipatterns.md) that does not prove browser layout behavior, so behavioral verification was performed via real Chromium layout geometry and scroll checks in the official mobile web render harness:

  • Verified table layout & scroll behavior at phone width (390×844) via config/scripts/mobile-web-app/preview/mobile-web-app-render-harness.mjs: before width: 358 / scrollWidth: 358; after width: 358, scrollWidth: 1065, right: 374 <= 390, scrollLeft pan to 200, zero page errors or bridge faults.
  • Ran pnpm -C mobile typecheck and full 39-step pnpm lint (all exit 0).

AI Disclosure

  • Codex (gpt-6.1-sol) implemented the stylesheet change, ran typecheck and 39-step lint, and produced the 390×844 render-harness screenshots and geometry reports.
  • Gemini (gemini-4-argon) reviewed the diff and render geometry reports, removed the string-copy stylesheet test per test-antipatterns.md, and prepared the issue and PR.

Review

AI review summary (gemini-4-argon):

  • Cross-platform: Pure CSS inside the mobile rich Markdown editor stylesheet; behaves identically across iOS WKWebView, Android Chromium WebView, and mobile web browsers.
  • SSH / remote: Unaffected; no RPC, host, or file-serialization changes.
  • Performance: CSS-only layout rule scoped to table and th, td inside the rich editor; zero runtime JS cost.
  • UI: Preserves existing table borders, padding, and dark/light theme tokens while preventing viewport overflow and accidental parent swipe overscroll (overscroll-behavior-x: contain).
  • Security: Static stylesheet string with no dynamic interpolation; no security surface change.

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

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

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 Oct 30, 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: 3f9d7581-c685-4cb5-8d55-213553e5f9fa
Commits

Reviewing files that changed from the base of the PR and between b2b8b0b and 1ca7a4e.

Files selected for processing: 2
  • mobile/src/components/rich-markdown/document-style.test.ts
  • 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; 8 remain after this review.

Walkthrough

The rich Markdown editor now displays tables as horizontally scrollable blocks with contained horizontal overscroll. Table cells have minimum and maximum widths and rules for breaking long words. A Vitest test checks these styles.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 1ca7a

The mobile table-scrolling change is covered by a focused regression test with no identified merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title is concise, specific, and accurately describes the main stylesheet change: enabling horizontal scrolling for wide rich Markdown tables on mobile.
Linked Issues check Passed Issue #36412 requires wide tables in the mobile rich Markdown editor to scroll horizontally instead of compressing columns. The stylesheet adds display: block, overflow-x: auto, and `overscroll-be…
Out of Scope Changes check Passed The whole-PR diff contains only the scoped rich Markdown table stylesheet changes and one focused regression test. These changes directly support issue #36412. No unrelated product, runtime, or public…
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 description is complete and follows the required template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI disclosure, scope considerations, and che…
Full details: Linked Issues check

Explanation

Issue #36412 requires wide tables in the mobile rich Markdown editor to scroll horizontally instead of compressing columns. The stylesheet adds display: block, overflow-x: auto, and overscroll-behavior-x: contain to table. It adds the requested min-width, max-width, overflow-wrap, and word-break rules to th, td. The new test checks all seven declarations.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff contains only the scoped rich Markdown table stylesheet changes and one focused regression test. These changes directly support issue #36412. No unrelated product, runtime, or public API 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 2 files.

Full details: Description check

Explanation

The description is complete and follows the required template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI disclosure, scope considerations, and checklist status. It reports lint and typecheck results but does not report full test or build results.

  • 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

Comment @coderabbitai help to get the list of available commands.

@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

Thanks for digging into this and for the fix. We landed it in #36966, so I'm closing this one.

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

2 participants