Skip to content

fix(slides): disable scroll view on mobile to prevent crash#10212

Merged
mscolnick merged 1 commit into
mainfrom
sham/fix-slides-crash-mobile
Jul 17, 2026
Merged

fix(slides): disable scroll view on mobile to prevent crash#10212
mscolnick merged 1 commit into
mainfrom
sham/fix-slides-crash-mobile

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Jul 17, 2026

Copy link
Copy Markdown
Member

📝 Summary

Serving a slides notebook on mobile (e.g. a WASM export opened on a phone) crashes with an error boundary:

undefined is not an object (evaluating 'this.slideTriggers[this.slideTriggers.length-1].range')

Root cause

reveal.js automatically switches to its scroll view when the presentation width drops below scrollActivationWidth (default 435px, i.e. most phones). Scroll view rewrites the slide DOM — it wraps every <section> in .scroll-page nodes and removes the .stack wrappers.

But marimo renders the deck via @revealjs/react, which owns those same nodes and re-runs reveal.sync() whenever the slide structure changes (documented behavior: slides added/removed/reordered/regrouped). During a WASM notebook load, cell outputs stream in and repeatedly change the composition, so sync() fires while scroll view has relocated/removed the nodes. reveal then re-runs syncPages() with zero .scroll-page elements, leaving slideTriggers empty, and setTriggerRanges() dereferences slideTriggers[-1].range → crash.

This is a structural incompatibility, not a tuning issue: the official React wrapper has an open bug where view: 'scroll' collapses the deck into a single slide, and scroll view also breaks deck.slide()/hash navigation which marimo relies on for active-cell sync.

Fix

Set scrollActivationWidth: 0 in the deck config to disable reveal's responsive scroll view. Mobile now keeps the same paginated deck as desktop; reveal's touch navigation (swipe) is on by default, so phone users still navigate naturally. 0 is used rather than null because the installed RevealConfig types the option as number.

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

Copilot AI review requested due to automatic review settings July 17, 2026 13:04
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jul 17, 2026 1:05pm

Request Review

Copilot AI 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.

Pull request overview

Disables reveal.js’s mobile “scroll view” mode for the slides deck to avoid a crash caused by reveal.js rewriting the slide DOM that @revealjs/react manages.

Changes:

  • Set scrollActivationWidth: 0 in the reveal.js config to prevent auto-switching to scroll view on mobile.
  • Document why scroll view is disabled (DOM ownership conflict leading to reveal.sync() crashes).

Comment thread frontend/src/components/slides/reveal-component.tsx
Comment thread frontend/src/components/slides/reveal-component.tsx

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Re-trigger cubic

@Light2Dark
Light2Dark marked this pull request as ready for review July 17, 2026 14:00
@Light2Dark
Light2Dark requested review from mchav and mscolnick July 17, 2026 14:00
@mscolnick
mscolnick merged commit 34a2422 into main Jul 17, 2026
38 of 40 checks passed
@mscolnick
mscolnick deleted the sham/fix-slides-crash-mobile branch July 17, 2026 14:47
@mscolnick

mscolnick commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

I wonder if this will fix #10159

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.15-dev27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants