LearnNewsExamplesServices
Frontmatter
id8959
titleFeat: Implement hideMode for Grid Columns to support OffscreenCanvas buffering
stateClosed
labels
enhancementai
assigneestobiu
createdAtFeb 3, 2026, 1:11 PM
updatedAtFeb 3, 2026, 1:32 PM
githubUrlhttps://github.com/neomjs/neo/issues/8959
authortobiu
commentsCount1
parentIssue8930
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 3, 2026, 1:32 PM

Feat: Implement hideMode for Grid Columns to support OffscreenCanvas buffering

Closed v12.0.0 enhancementai
tobiu
tobiu commented on Feb 3, 2026, 1:11 PM

We need to implement a buffering strategy for Grid Columns to support cases like OffscreenCanvas where removing the DOM node destroys the worker connection context.

Proposed Changes:

  1. src/grid/column/Base.mjs:

    • Add hideMode config (String, default: 'removeDom').
    • Valid values: 'removeDom', 'visibility' (uses visibility: hidden), 'display' (uses display: none).
    • Note: visibility is preferred for Canvas to maintain layout geometry.
  2. src/grid/Body.mjs:

    • Update rendering logic (createRow) to ensure columns with hideMode !== 'removeDom' are always rendered in the VDOM, regardless of whether they are within the mountedColumns window.
    • If such a column is outside the mounted range, it will be rendered with the appropriate hiding style.

Benefits:

  • Solves the "Zombie Canvas" issue where horizontally scrolling destroys OffscreenCanvas connections.
  • Improves scrolling performance for heavy column components by avoiding reconstruction.
tobiu added the enhancement label on Feb 3, 2026, 1:11 PM
tobiu added the ai label on Feb 3, 2026, 1:11 PM
tobiu referenced in commit e15bb38 - "Feat: Implement hideMode for Grid Columns to support OffscreenCanvas buffering (#8959)" on Feb 3, 2026, 1:32 PM
tobiu added parent issue #8930 on Feb 3, 2026, 1:32 PM
tobiu
tobiu Feb 3, 2026, 1:32 PM

Input from Gemini 3 Pro:

✦ I have implemented the new hideMode configuration for Grid Columns and enabled it by default for Sparkline columns.

Changes Implemented:

  1. src/grid/column/Base.mjs:

    • Added hideMode config (values: 'removeDom', 'visibility', 'display').
    • Default: 'removeDom' (preserves existing behavior for standard columns).
  2. src/grid/Body.mjs:

    • Modified createRow to render all columns during row creation, not just the mounted range.
    • Columns outside the mountedColumns range are now checked:
      • If hideMode === 'removeDom', they are skipped (virtualized).
      • If hideMode === 'visibility', they are rendered with visibility: hidden (buffered).
      • If hideMode === 'display', they are rendered with display: none (buffered).
  3. src/grid/column/Sparkline.mjs:

    • Set default hideMode: 'visibility'.

Outcome: Horizontal scrolling no longer destroys the DOM nodes for Sparkline columns. This maintains the OffscreenCanvas connection to the worker, preventing the "blank canvas" issues caused by re-transferring context, and significantly improves stability for heavy worker-driven components.

tobiu assigned to @tobiu on Feb 3, 2026, 1:32 PM
tobiu closed this issue on Feb 3, 2026, 1:32 PM