Skip to content

fix(sheets): a vertical swipe on a table or code block scrolls the file on phones - #3294

Merged
devswha merged 2 commits into
mainfrom
fix/markdown-table-scroll-chain
Nov 7, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/markdown-table-scroll-chain

Conversation

@devswha

@devswha devswha commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Fixes #3287

What was wrong

On a phone (max-width 640px) src/styles.css gives every element inside a sheet
overscroll-behavior: contain. A box that scrolls only sideways - a Markdown table
(.markdown-table-wrap), a code block (.hl-code), a display formula
(.markdown-math-display) - has overflow-x: auto, so its overflow-y computes to auto too:
it is a scroll container on both axes, always at its vertical ends. With contained overscroll,
a vertical swipe begun on it is swallowed and never chains to .file-viewer-body, so a file whose
table or code fills the screen cannot be scrolled at all. The reporter's root-cause analysis was
right.

Reproduced on current main (Chromium 156, 390x844, touch events over the real FileViewer):
a swipe on the table moved the document ~14px, on a code block or a formula 0px; after the fix the
same swipes scroll it like a swipe on a paragraph. Chrome before 144 ignored overscroll-behavior
on a box with nothing to scroll, which is why this showed up now on current Chrome and on Firefox.

Fix

Inside the sheet rule, give the sideways-only boxes overscroll-behavior-y: auto: the three
Markdown boxes above, plus the two other sideways rows that live in sheets and had the same trap
(found in review): the theme cards in Settings (.theme-cards) and the recent-folder chips in New
session (.new-session-folder-chips).
Real vertical lists in sheets keep their contained overscroll; nothing else changes. This is the
browser's default scroll chaining: a vertical swipe on a wide table scrolls the page around it.

Validation

  • Failing first: scripts/markdown-outline-browser-qa.ts gets a table and a code block in its
    fixture document and a phone case that swipes up on each and waits for .file-viewer-body to
    scroll. On main it timed out (the document did not move); with the fix it passes.
  • In the CI runner image (standalone clone): bun run check fast, bun run build, and the browser
    scripts that cover sheets and the file viewer: markdown-outline-browser-qa,
    file-viewer-mobile-regression, file-viewer-regression, device-security-demo-regression,
    files-documents-demo-regression, files-panel-demo-regression, mobile-viewport-regression,
    phone-worktree-sheet-regression, prompt-dock-demo-regression. All passed
    (check fast: typecheck, build, unit 12986 pass / 0 fail; every browser script exit 0).
  • Theme cards: a scratch Chromium touch run over the real CSS moved the list 0px with the old
    containment and 170px with the fix (not committed as a test).
  • After adding the two rows: bun run check fast (unit 12987 pass / 0 fail), markdown-outline-browser-qa,
    file-viewer-mobile-regression, files-panel-demo-regression re-run on the host: all pass.
  • Not run: a real Android device with Firefox (the reporter's setup); the Chromium touch run
    covers the same CSS path.

… file on phones

Inside a phone sheet every element got overscroll-behavior: contain. A box
that scrolls only sideways (markdown table, code block, display formula) is
still a scroll container on both axes and sits at its vertical ends, so the
contained overscroll swallowed every vertical stroke begun on it and the file
viewer never scrolled. Release the vertical overscroll on those boxes.

Fixes #3287
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fd86d91 and 5af04f2.

Files selected for processing: 3

  • changelog.d/sheet-table-scroll.md
  • scripts/markdown-outline-browser-qa.ts
  • src/styles.css
  • 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

@devswha

devswha commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Review notes for head 5af04f2:

  • CodeRabbit did not review this PR (review limit reached), so it has no CodeRabbit review at this head.
  • omo review (dori): CLEAR at 5af04f2.
  • Codex adversarial review (on c02e1cf):
    • MEDIUM, fixed in 5af04f2: two other sideways-only rows in sheets had the same trap, the theme
      cards in Settings (.theme-cards) and the recent-folder chips in New session
      (.new-session-folder-chips). Both are now in the same rule; a scratch Chromium touch run over
      the theme cards moved the list 0px before and 170px after.
    • LOW, left as is: the new phone case uses a table and code block that fit the 390px width, and
      no display formula. The bug does not depend on the content overflowing (any overflow-x: auto
      box is a vertical scroll container), so the case still fails on main.
    • No vertical-scroller use of the released classes inside sheets, and no flakiness found.

@devswha
devswha merged commit 31814ee into main Nov 7, 2026
15 checks passed
@devswha

devswha commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Merge note (merge pass) at head 5af04f2:

  • Merged on GitHub's required checks, all green on this head (Fast checks, Integration and browser, Native Windows install).
  • omo review receipt: CLEAR at this exact head. Unresolved review threads: 0 (GraphQL). CodeRabbit: neutral; no CodeRabbit review ran on this head.
  • Fixes Vertical scrolling locked on mobile when touching Markdown tables in FileViewer #3287: in a phone sheet, a box that scrolls only sideways (a table, code, a formula, theme cards, folder chips) no longer swallows a vertical swipe begun on it: those boxes get overscroll-behavior-y: auto inside .modal-scrim, so the list around them scrolls. Failing-first phone case; 9 sheet and file-viewer scripts green. CodeRabbit hit its review limit; the merge pass read the CSS change in full.

@devswha
devswha deleted the fix/markdown-table-scroll-chain branch November 7, 2026 21:41
@devswha devswha mentioned this pull request Nov 7, 2026
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.

Vertical scrolling locked on mobile when touching Markdown tables in FileViewer

1 participant