Skip to content

Scroll Enable/Disable Flag#4

Merged
mack-at-pieces merged 1 commit into
mainfrom
feat/scroll-enablement
Aug 26, 2025
Merged

Scroll Enable/Disable Flag#4
mack-at-pieces merged 1 commit into
mainfrom
feat/scroll-enablement

Conversation

@mack-at-pieces

@mack-at-pieces mack-at-pieces commented Aug 21, 2025

Copy link
Copy Markdown

This pull request introduces a new scrollingEnabled property across the Super Editor codebase, allowing user scrolling and auto-scrolling behaviors to be toggled on or off in various document reader and editor widgets. This enhancement provides finer control over scrolling interactions, which can be useful for implementing read-only modes or custom interaction patterns. The changes affect several core widgets and internal auto-scrolling logic.

Scrolling Enable/Disable Propagation

  • Added a scrollingEnabled (or scrollEnabled) property to SuperReader, DocumentScaffold, DocumentScrollable, ReadOnlyDocumentMouseInteractor, ReadOnlyAndroidDocumentTouchInteractor, and SuperReaderIosDocumentTouchInteractor, with corresponding wiring through constructors and state classes. This property controls whether user scrolling and auto-scrolling are allowed. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]

Auto-Scrolling Logic Updates

  • Updated the DragHandleAutoScroller class to respect the new enabled property, preventing automatic scrolling actions when disabled. All relevant methods now check this flag before performing scroll operations. [1] [2] [3] [4] [5] [6] [7]

Gesture and Selection Handling

  • Modified gesture and selection handlers in ReadOnlyDocumentMouseInteractor to respect the scrollingEnabled flag, skipping auto-scrolling and selection visibility logic when scrolling is disabled. [1] [2] [3] [4]

Internal Cleanups

  • Removed unused imports in document_scaffold.dart for better code hygiene.

These changes collectively enable more flexible control over document scrolling behaviors in Super Editor, supporting advanced use cases such as strict read-only modes or custom navigation patterns.

Introduces a scrollingEnabled property to SuperReader, DocumentScaffold, DocumentScrollable, and related touch/mouse interactors. This flag allows enabling or disabling user scrolling and auto-scrolling behaviors, providing more control over document interaction. All relevant auto-scroller logic and gesture handlers now respect this flag.
Copilot AI review requested due to automatic review settings August 21, 2025 17:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive mechanism for controlling scrolling behavior and enabling inline widget tap exclusion in SuperReader. The primary goal is to provide developers with fine-grained control over when scrolling and auto-scrolling occur, while ensuring inline widgets like URL chips can receive direct tap interactions.

  • Added scrollingEnabled parameter throughout the widget hierarchy to control user scrolling and auto-scrolling
  • Enhanced gesture recognizers and interactors to respect the scrolling enabled state
  • Implemented auto-scroller enable/disable functionality with proper guards

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
super_reader.dart Added scrollingEnabled parameter and passed it to document scaffolds and interactors
read_only_document_mouse_interactor.dart Added scrolling controls and guards for auto-scroll operations
read_only_document_ios_touch_interactor.dart Added scrollingEnabled parameter and passed it to auto-scroller
read_only_document_android_touch_interactor.dart Added scrollingEnabled parameter and passed it to auto-scroller
mobile_documents.dart Enhanced DragHandleAutoScroller with enabled property and guards
document_scaffold.dart Added scrollingEnabled parameter and passed it to document scrollable
document_scrollable.dart Implemented scroll physics control based on scrollEnabled parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mack-at-pieces mack-at-pieces merged commit fa37988 into main Aug 26, 2025
18 of 26 checks passed
@mack-at-pieces mack-at-pieces deleted the feat/scroll-enablement branch August 26, 2025 01:44
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.

2 participants