Repository navigation
fix(sheets): a vertical swipe on a table or code block scrolls the file on phones - #3294
Merged
Merged
Conversation
… 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
|
Warning Review limit reachedYou'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. View limit details
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. |
Owner
Author
|
Review notes for head 5af04f2:
|
Owner
Author
|
Merge note (merge pass) at head 5af04f2:
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3287
What was wrong
On a phone (max-width 640px)
src/styles.cssgives every element inside a sheetoverscroll-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) - hasoverflow-x: auto, so itsoverflow-ycomputes toautotoo: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 whosetable 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 threeMarkdown 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 Newsession (
.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
scripts/markdown-outline-browser-qa.tsgets a table and a code block in itsfixture document and a phone case that swipes up on each and waits for
.file-viewer-bodytoscroll. On
mainit timed out (the document did not move); with the fix it passes.bun run check fast,bun run build, and the browserscripts 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).
containment and 170px with the fix (not committed as a test).
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.
covers the same CSS path.