Frontmatter
| id | 8914 |
| title | Consolidate Grid Touch Scrolling into Main Thread Addon |
| state | Closed |
| labels | enhancementairefactoringarchitectureperformance |
| assignees | tobiu |
| createdAt | Jan 30, 2026, 2:03 PM |
| updatedAt | Jan 30, 2026, 2:14 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8914 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 30, 2026, 2:14 PM |
Consolidate Grid Touch Scrolling into Main Thread Addon
tobiu assigned to @tobiu on Jan 30, 2026, 2:14 PM

tobiu
Jan 30, 2026, 2:14 PM
Input from Gemini 3 Pro:
✦ I have successfully consolidated the grid touch scrolling logic into the
Neo.main.addon.GridDragScrolladdon.Changes Implemented
1. Main Thread Addon (
src/main/addon/GridDragScroll.mjs)
- Touch Support: Implemented
touchstart,touchmove, andtouchendhandlers.- Unified Logic: The addon now acts as the single source of truth for all drag scrolling.
- In
register(): It checksNeo.config.hasTouchEvents.- Mobile: Attaches touch listeners (
passive: false,capture: true). UsespreventDefault()ontouchmoveto replace native scrolling with precise, zero-latency drag scrolling.- Desktop: Attaches mouse listeners as before.
- Documentation: Updated class JSDoc to reflect the dual support.
2. ScrollManager Refactor (
src/grid/ScrollManager.mjs)
- Cleanup: Removed all legacy App Worker-side touch tracking (
lastTouchX,lastTouchY,touchMoveOwner) and listeners.- Simplification:
onBodyScrollandonContainerScrollare now purely for syncing state, with no drag logic.- Renaming: Renamed
mouseDragScroll_todragScroll_to reflect the broader scope.- Registration: The
updateDragScrollAddonmethod now unconditionally delegates to the addon, allowing the addon to decide which listeners to attach based on the environment.Outcome
This architecture change eliminates the overhead of passing high-frequency touch events between the Main Thread and App Worker. Grid scrolling on mobile devices is now handled directly in the Main Thread, resulting in zero-latency performance comparable to native scrolling, while maintaining the exact same logic and behavior as the desktop mouse drag.
tobiu closed this issue on Jan 30, 2026, 2:14 PM
Problem: Currently,
Neo.grid.ScrollManagerhandles touch scrolling logic (lastTouch positions, owner tracking) inside the App Worker, causing unnecessary cross-worker messaging and latency. Meanwhile, mouse scrolling has been successfully moved to theNeo.main.addon.GridDragScrollfor superior performance.Solution: Consolidate all drag-to-scroll logic (both mouse and touch) into the
GridDragScrollMain Thread Addon. This will make the addon the "single source of truth" for grid scrolling interactions.Architecture Changes:
Refactor
Neo.main.addon.GridDragScroll:touchstart,touchmove,touchendhandlers.register(), detectNeo.config.hasTouchEvents.preventDefault()on touch moves to replace native scrolling with precise 1:1 drag-scrolling.Cleanup
Neo.grid.ScrollManager:lastTouchX,lastTouchY,touchMoveOwner).touchcancelandtouchendlisteners fromconstruct.hasTouchEventsguard fromupdateDragScrollAddonto enable the addon for all environments.Benefits: