disable reveal.js' automatic scroll view on narrow screens

When a phone's presentation width dropped to scrollActivationWidth
(435px) during load, reveal.js 5.2 activated its scroll view, which
flattens the nested section structure. The menu plugin, building its
items asynchronously after that, then only found the empty chapter
wrapper sections and degenerated to italic "Slide 1..N" fallback
entries. Keep the regular swipeable slide view on phones instead,
where menu, notes overlay, and pacing timer work; scroll view remains
available via scrollActivationWidth or view: 'scroll' reveal_options.

Change-Id: I131ac15091082697e3f44057feb421c7026b020c
diff --git a/NEWS.md b/NEWS.md
index 50c3c4a..5190f7c 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,7 @@
 # revealjs.ids (development version)
 
+- Disable reveal.js' automatic scroll view on narrow screens (`scrollActivationWidth: 0`): when a phone activated scroll view during load, it restructured the slides DOM and the slides menu degenerated to italic "Slide 1..N" fallback entries. Phones now get the regular swipeable slide view, where menu, speaker notes overlay, and pacing timer work as usual. Re-enable with `reveal_options: list(scrollActivationWidth = 600)` or force scroll view with `view: "scroll"`.
+
 - `ids` theme: on touch devices, a new button next to the fullscreen toggle overlays the current slide with its speaker notes (plus the slide title and planned time, if annotated with a timing comment) -- for practicing talks on mobile browsers, where reveal.js' separate speaker view window is awkward. The overlay follows slide changes and only appears when the deck contains notes.
 
 - Documents with a `bibliography:` in their YAML header are now formatted with the bundled IDS citation style by default (`ids.csl`, based on the style developed for ICLC-10 2023 in Mannheim). A `csl:` entry in the document's YAML header still takes precedence.
diff --git a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
index 55fdfaf..651b950 100644
--- a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
+++ b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
@@ -464,6 +464,18 @@
         // viewDistance in order to save resources.
         mobileViewDistance: $mobileViewDistance$,
 $endif$
+$if(scrollActivationWidth)$
+        // Activate reveal.js' scroll view when the presentation width drops
+        // below this number of pixels
+        scrollActivationWidth: $scrollActivationWidth$,
+$else$
+        // Don't auto-activate reveal.js' scroll view on narrow screens: it
+        // restructures the slides DOM during load, which breaks the menu
+        // plugin (slide titles fall back to "Slide N") and other plugins
+        // relying on the regular slides markup. Pass scrollActivationWidth
+        // or view: 'scroll' via reveal_options to opt back in.
+        scrollActivationWidth: 0,
+$endif$
 $if(display)$
         // The display mode that will be used to show slides
         display: '$display$',