|
| 1 | +--- |
| 2 | +id: 8959 |
| 3 | +title: 'Feat: Implement hideMode for Grid Columns to support OffscreenCanvas buffering' |
| 4 | +state: CLOSED |
| 5 | +labels: |
| 6 | + - enhancement |
| 7 | + - ai |
| 8 | +assignees: |
| 9 | + - tobiu |
| 10 | +createdAt: '2026-02-03T12:11:03Z' |
| 11 | +updatedAt: '2026-02-03T12:32:51Z' |
| 12 | +githubUrl: 'https://github.com/neomjs/neo/issues/8959' |
| 13 | +author: tobiu |
| 14 | +commentsCount: 1 |
| 15 | +parentIssue: 8930 |
| 16 | +subIssues: [] |
| 17 | +subIssuesCompleted: 0 |
| 18 | +subIssuesTotal: 0 |
| 19 | +blockedBy: [] |
| 20 | +blocking: [] |
| 21 | +closedAt: '2026-02-03T12:32:51Z' |
| 22 | +--- |
| 23 | +# Feat: Implement hideMode for Grid Columns to support OffscreenCanvas buffering |
| 24 | + |
| 25 | +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. |
| 26 | + |
| 27 | +**Proposed Changes:** |
| 28 | +1. **`src/grid/column/Base.mjs`**: |
| 29 | + - Add `hideMode` config (String, default: `'removeDom'`). |
| 30 | + - Valid values: `'removeDom'`, `'visibility'` (uses `visibility: hidden`), `'display'` (uses `display: none`). |
| 31 | + - Note: `visibility` is preferred for Canvas to maintain layout geometry. |
| 32 | + |
| 33 | +2. **`src/grid/Body.mjs`**: |
| 34 | + - 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. |
| 35 | + - If such a column is outside the mounted range, it will be rendered with the appropriate hiding style. |
| 36 | + |
| 37 | +**Benefits:** |
| 38 | +- Solves the "Zombie Canvas" issue where horizontally scrolling destroys `OffscreenCanvas` connections. |
| 39 | +- Improves scrolling performance for heavy column components by avoiding reconstruction. |
| 40 | + |
| 41 | + |
| 42 | +## Timeline |
| 43 | + |
| 44 | +- 2026-02-03T12:11:04Z @tobiu added the `enhancement` label |
| 45 | +- 2026-02-03T12:11:04Z @tobiu added the `ai` label |
| 46 | +- 2026-02-03T12:32:09Z @tobiu referenced in commit `e15bb38` - "Feat: Implement hideMode for Grid Columns to support OffscreenCanvas buffering (#8959)" |
| 47 | +- 2026-02-03T12:32:20Z @tobiu added parent issue #8930 |
| 48 | +### @tobiu - 2026-02-03T12:32:30Z |
| 49 | + |
| 50 | +**Input from Gemini 3 Pro:** |
| 51 | + |
| 52 | +> ✦ I have implemented the new `hideMode` configuration for Grid Columns and enabled it by default for `Sparkline` columns. |
| 53 | +> |
| 54 | +> **Changes Implemented:** |
| 55 | +> |
| 56 | +> 1. **`src/grid/column/Base.mjs`**: |
| 57 | +> - Added `hideMode` config (values: `'removeDom'`, `'visibility'`, `'display'`). |
| 58 | +> - Default: `'removeDom'` (preserves existing behavior for standard columns). |
| 59 | +> |
| 60 | +> 2. **`src/grid/Body.mjs`**: |
| 61 | +> - Modified `createRow` to render *all* columns during row creation, not just the mounted range. |
| 62 | +> - Columns outside the `mountedColumns` range are now checked: |
| 63 | +> - If `hideMode === 'removeDom'`, they are skipped (virtualized). |
| 64 | +> - If `hideMode === 'visibility'`, they are rendered with `visibility: hidden` (buffered). |
| 65 | +> - If `hideMode === 'display'`, they are rendered with `display: none` (buffered). |
| 66 | +> |
| 67 | +> 3. **`src/grid/column/Sparkline.mjs`**: |
| 68 | +> - Set default `hideMode: 'visibility'`. |
| 69 | +> |
| 70 | +> **Outcome:** |
| 71 | +> 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. |
| 72 | +
|
| 73 | +- 2026-02-03T12:32:37Z @tobiu assigned to @tobiu |
| 74 | +- 2026-02-03T12:32:51Z @tobiu closed this issue |
| 75 | + |
0 commit comments