LearnNewsExamplesServices
Frontmatter
id9486
titleEpic: Grid Multi-Body Architecture for Zero-Jitter Locked Columns
stateOpen
labels
epicaigrid
assigneestobiu
createdAtMar 16, 2026, 6:41 PM
updatedAtMar 31, 2026, 2:14 PM
githubUrlhttps://github.com/neomjs/neo/issues/9486
authortobiu
commentsCount5
parentIssuenull
subIssues
9487 Grid Multi-Body: Refactor Layout Engine & SubGrid Partitioning
9488 Grid Multi-Body: SubGrid Row Pooling & Vertical Sync Refactoring
9489 Grid Multi-Body: Decoupled Horizontal Scroller & Main Thread Sync
9490 Grid Multi-Body: Remove Obsolete GridColumnScrollPinning Addon & CSS Vars
9491 Grid Multi-Body: Overhaul Column Drag & Drop (SortZone) across Split Headers
9492 Grid Multi-Body: Adapt Selection Models for Split Rows
9493 Grid Multi-Body: Enable Cross-Window SubGrid Detachment (Pop-out)
9494 Grid Multi-Body: Implement Direct Main-Thread Scroll Sync via MessageChannel
9495 Grid Multi-Body: Implement Data-Driven Variable Row Height Architecture
9496 Grid Multi-Body: Adapt Keyboard Navigation for Split Bodies
9497 Grid Multi-Body: Split Column Collections and Orchestration
9498 Grid Multi-Body: Infinite Canvas Cross-Window Column Drag & Drop
9499 Grid Multi-Body: Test Suite Refactoring & Expansion
9611 Grid Multi-Body: Native Vertical Scrollbar & Alignment Spacer
9612 Grid Multi-Body: Scrollbar Refactoring and Vertical Restoration
9613 Grid Multi-Body: Fix horizontal DragScroll and Mousewheel translation
9608 Fix Event Resolution and Parent Hierarchy Regressions in Nested Sub-Grids
9607 GridContainer: `this.items is not iterable` crash on initialization
9615 Sub-Epic: Grid Multi-Body Stabilization (Header Sync & Pinning)
9616 Grid Multi-Body: Implement Two-Tier Horizontal Cell Pooling and Scroll Sync
9617 Grid Multi-Body: Fix Row Scroll Pinning for Thumb Dragging
9618 DevIndex High-Velocity Grid Thumb Drag Scroll Jitter
9619 Grid Multi-Body: Implement and Test Locked Columns in DevIndex
9620 Grid Multi-Body: Fix Null Data Store and Consolidate Loading Mask
9622 Grid Multi-Body: Resolve duplicate cell rendering and phantom nodes
9623 Grid Multi-Body: Fix .neo-last-column border styling logic across multiple bodies
9624 [Multi-Body Grid] Resolve Border Overlap, Header Sync, and Scroll Propagation
9625 Multi-Body Grid: Visually delegate native vertical scrollbar UX with CSS
9614 Grid Multi-Body: Fix Horizontal Row Clipping & Scrollbar SCSS
9626 Epic: Grid Unified Scrolling & VDOM Orchestration
9635 Grid Multi-Body: Restoring Vertical Scrollbar for Dual-Pipeline GPU Thumb Pinning
9636 Grid Multi-Body: Simplify GridDragScroll Scrollbar Hit Detection
9637 Grid Multi-Body: E2E Telemetry Adjustments for Dual-Pipeline Scrolling
9868 R&D: Grid Multi-Body Selection Architecture Redesign
9872 Grid Multi-Body: 3-Tier Component Orchestration and Architecture Refactoring
subIssuesCompleted22
subIssuesTotal35
blockedBy[]
blocking[]

Epic: Grid Multi-Body Architecture for Zero-Jitter Locked Columns

Openepicaigrid
tobiu
tobiu commented on Mar 16, 2026, 6:41 PM

The initial approach to locked columns (locked: 'start' | 'end') relied on a single overflow-x: auto scrolling container and synchronously injecting CSS variables (--grid-locked-start-offset) via a Main Thread addon to counteract the native scroll translation with transform: translateX().

While theoretically sound, testing revealed an insurmountable limitation in browser architecture: Main Thread vs. Compositor Thread synchronization.

When a user scrolls horizontally, the browser's GPU compositor instantly shifts the entire scrolling container and paints the frame. The Main Thread scroll event fires after this native paint. Therefore, our JavaScript-driven CSS variable correction always arrives one frame late, causing an inescapable "elastic lag" or jitter during fast scrolling.

Attempts to bypass the compositor using position: sticky fail because sticky breaks the position: absolute mathematical layout engine required for cell pooling and virtualization.

To achieve truly zero-jitter locked columns, we must adopt a Multi-Body Architecture.

The V2 Architecture: To prioritize vertical scroll performance (where massive data virtualization happens), we will decouple horizontal and vertical scrolling physics.

  1. The Unified Vertical Wrapper: A single, outer container (overflow-y: auto) will handle vertical scrolling for all bodies natively. This guarantees zero vertical jitter, as the browser compositor moves all bodies up/down as a single unit.
  2. The Split SubGrids: Inside the vertical wrapper, the Grid is structurally split into up to three physical grid bodies sitting side-by-side:
    • Left Body: overflow-x: hidden. Contains only locked: 'start' columns.
    • Center Body: overflow-x: hidden. Contains standard unlocked columns.
    • Right Body: overflow-x: hidden. Contains only locked: 'end' columns.
  3. The Decoupled Horizontal Scroller: Because the Center Body sits inside the tall virtualized vertical wrapper, its native horizontal scrollbar would be pushed to the bottom of the virtual data (e.g., 500,000px down). We must build a decoupled, "fake" horizontal scrollbar locked to the bottom of the grid viewport.
  4. Synchronous Horizontal JS Sync: A Main Thread Addon will capture the scroll event from the decoupled horizontal scroller and synchronously update the scrollLeft of the Center Body and Header.

Distributed Grid Architecture (The Killer Demo): The multi-body architecture naturally enables cross-window capabilities. Because Neo.mjs manages the DOM virtually from the App Worker, SubGrids can be detached from the main window and rendered in entirely separate browser windows (multi-monitor setups).

  • To achieve low-latency scroll synchronization across windows, Main Thread Addons will establish direct MessageChannel communication, passing ports through the App Worker.
  • Visual selection states (Row Hover, Keyboard Nav) will span across windows seamlessly, driven by the App Worker's single source of truth, without requiring OS-level window focus changes.

Future-Proofing for Variable Row Heights: A known risk of split SubGrids is maintaining visual row alignment if variable row heights are introduced in the future. Because Neo.mjs manages the VDOM entirely within the App Worker, we have a strategic advantage over other frameworks that suffer from layout thrashing in this scenario. Instead of relying on expensive Main Thread DOM measurement loops to sync heights across bodies, the App Worker will act as the single source of truth for row heights, injecting identical height configurations across all active SubGrids simultaneously.

The Rewrite Scope: This architecture changes the core assumption that "one record = one DOM node in one container". It requires a comprehensive rewrite of interacting systems, including cross-container Drag & Drop (SortZone), Selection Models (RowModel, CellModel), and Keyboard Navigation.

tobiu added the epic label on Mar 16, 2026, 6:41 PM
tobiu added the ai label on Mar 16, 2026, 6:41 PM
tobiu added the grid label on Mar 16, 2026, 6:41 PM
tobiu assigned to @tobiu on Mar 16, 2026, 6:43 PM
tobiu cross-referenced by #9487 on Mar 16, 2026, 7:15 PM
tobiu added sub-issue #9487 on Mar 16, 2026, 7:15 PM
tobiu cross-referenced by #9488 on Mar 16, 2026, 7:15 PM
tobiu added sub-issue #9488 on Mar 16, 2026, 7:15 PM
tobiu cross-referenced by #9489 on Mar 16, 2026, 7:16 PM
tobiu added sub-issue #9489 on Mar 16, 2026, 7:16 PM
tobiu cross-referenced by #9490 on Mar 16, 2026, 7:18 PM
tobiu added sub-issue #9490 on Mar 16, 2026, 7:18 PM
tobiu cross-referenced by #9491 on Mar 16, 2026, 7:21 PM
tobiu added sub-issue #9491 on Mar 16, 2026, 7:21 PM
tobiu cross-referenced by #9492 on Mar 16, 2026, 7:21 PM
tobiu added sub-issue #9492 on Mar 16, 2026, 7:22 PM
tobiu
tobiu Mar 16, 2026, 10:41 PM

Input from Gemini 3.1 Pro:

✦ I have expanded the scope of this Epic to include the "Distributed Grid Architecture" vision.

The multi-body split enables the "Killer Demo" scenario of detaching a locked column SubGrid into a separate physical browser window while maintaining state and sync.

New sub-issues added:

  • #9493 Grid Multi-Body: Enable Cross-Window SubGrid Detachment (Pop-out)
  • #9494 Grid Multi-Body: Implement Direct Main-Thread Scroll Sync via MessageChannel
  • #9495 Grid Multi-Body: Implement Data-Driven Variable Row Height Architecture
tobiu added sub-issue #9493 on Mar 16, 2026, 10:41 PM
tobiu added sub-issue #9494 on Mar 16, 2026, 10:41 PM
tobiu added sub-issue #9495 on Mar 16, 2026, 10:41 PM
tobiu cross-referenced by #9496 on Mar 16, 2026, 10:51 PM
tobiu added sub-issue #9496 on Mar 16, 2026, 10:51 PM
tobiu cross-referenced by #9497 on Mar 16, 2026, 11:13 PM
tobiu added sub-issue #9497 on Mar 16, 2026, 11:13 PM
tobiu cross-referenced by #9498 on Mar 16, 2026, 11:23 PM
tobiu added sub-issue #9498 on Mar 16, 2026, 11:23 PM
tobiu cross-referenced by #9499 on Mar 16, 2026, 11:29 PM
tobiu added sub-issue #9499 on Mar 16, 2026, 11:29 PM
tobiu
tobiu Mar 17, 2026, 8:00 PM

quick info: this epic is currently planned after the release of neo v12.1, since the scope is massive.

tobiu cross-referenced by #9577 on Mar 27, 2026, 12:25 PM
tobiu
tobiu Mar 31, 2026, 12:02 PM

Input from Gemini 3.1 Pro (Antigravity):

✦ ### Architectural Refinement (Pre-Flight Plan)

Following initial analysis of the multi-body architecture, we have codified two major structural refinements:

  1. Symmetric Wrapper Architecture (~#9487) To eliminate all transform math hacks, the split must apply perfectly to both the Body and the Header Toolbar.

    • bodyWrapper_: A protected hbox container with overflow-y: auto, holding up to 3 grid.Body instances (bodyStart, bodyCenter, bodyEnd).
    • headerWrapper_: A protected hbox container holding up to 3 localized header.Toolbar instances. The center pairs cleanly sync their horizontal scroll together via the decoupled scroller, while start and end pairs remain static. The GridContainer remains backward compatible by accepting a single columns array, internally partitioning it, and instantiating only the necessary 1-3 pairs.
  2. Row Height Synchronization Strategy (~#9495)

    • Version 1 (Static): All instantiated sub-grids will rigorously enforce the unified, fixed rowHeight configured on the parent GridContainer.
    • Version 2 (Future Variable Heights): Because the split bodies share the exact same startIndex and endIndex pooling calculation, the physical arrays map 1:1. The App Worker will calculate the Math.max() height for a specific row index and inject an identical explicit style.height directly into the VDOM of all sibling body rows simultaneously. This guarantees perfect cross-body alignment without layout thrashing.

We are now commencing Phase 1 (#9497: Split Column Collections and Orchestration) implementation based on this refined blueprint.

tobiu referenced in commit 098490d - "fix: Grid Multi-Body Architecture Type Desynchronization (#9486)" on Mar 31, 2026, 2:09 PM
tobiu
tobiu Mar 31, 2026, 2:10 PM

Resolved: Stabilized Grid Multi-Body Architecture by decoupling column instantiation from toolbar items creation. Passed tests.

tobiu closed this issue on Mar 31, 2026, 2:10 PM
tobiu reopened this issue on Mar 31, 2026, 2:12 PM
tobiu reopened this issue on Mar 31, 2026, 2:14 PM
tobiu added sub-issue #9611 on Mar 31, 2026, 4:07 PM
tobiu cross-referenced by #9612 on Mar 31, 2026, 4:25 PM
tobiu added sub-issue #9612 on Mar 31, 2026, 5:14 PM
tobiu added sub-issue #9613 on Mar 31, 2026, 5:14 PM
tobiu added sub-issue #9608 on Mar 31, 2026, 5:14 PM
tobiu added sub-issue #9607 on Mar 31, 2026, 5:14 PM
tobiu added sub-issue #9615 on Mar 31, 2026, 10:21 PM
tobiu cross-referenced by #9616 on Mar 31, 2026, 10:22 PM
tobiu added sub-issue #9616 on Mar 31, 2026, 10:22 PM
tobiu cross-referenced by #9617 on Mar 31, 2026, 10:45 PM
tobiu added sub-issue #9617 on Mar 31, 2026, 10:45 PM