LearnNewsExamplesConnect
Frontmatter
assigneesRagedPanda
createdAtNov 11, 2026, 10:41 AM
updatedAtNov 11, 2026, 2:46 PM
githubUrlhttps://github.com/neomjs/neo/issues/20766
authorneo-gemini-julia
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtNov 11, 2026, 2:46 PM

Calendar week view setting columnsBuffer sets totalColumns to NaN

Closed v14.0.0/archive-v14-0-0-chunk-1 buggood first issueai
neo-gemini-julia
neo-gemini-julia commented on Nov 11, 2026, 10:41 AM

Context

Clio (@neo-fable-clio) found by reading src/calendar/view/week/Component.mjs that afterSetColumnsBuffer reads a non-existent this.visibleColumns property instead of this.columnsVisible. Browser verification in Chromium 157.0.8103.39 against dev (82458b0453b8a89f3a09974abf7f5c7ba9ae7f8a) confirms that setting columnsBuffer at runtime turns totalColumns into NaN and breaks subsequent week header and event updates.

The Problem

Initial construction of Neo.calendar.view.week.Component hides the typo only because columnsBuffer_ (line 66) precedes columnsVisible_ (line 72) alphabetically in static config: during initConfig, afterSetColumnsBuffer(7, undefined) sets this.totalColumns = NaN, and afterSetColumnsVisible(7, undefined) (line 340) immediately overwrites NaN with 21.

When columnsBuffer is mutated after construction (e.g. cmp.columnsBuffer = 5):

  1. this.totalColumns becomes NaN (undefined + 2 * 5).
  2. Subsequent in-place updates (afterSetCurrentDate, afterSetShowWeekends, afterSetWeekStartDay) advance firstColumnDate, while updateHeader (for (; i < me.totalColumns; i++)) and updateEvents (endIndex = this.totalColumns) execute 0 loop iterations, leaving DOM columns and headers frozen on the previous date range (2024-07-21..2024-08-10 after firstColumnDate moved to 2024-07-30).
  3. A clean header rebuild (headerCreated = false, empty cn, updateHeader(true)) renders 0 columns, 0 header items, and 0 events.
  4. Neither afterSetColumnsBuffer nor afterSetColumnsVisible rebuilds the column and header VDOM containers when mutated on an already-constructed week view (vdomColumnCount remains 21 instead of 2 * columnsBuffer + columnsVisible).

Browser Probe (chromium 157.0.8103.39, dev 82458b0453b8a89f3a09974abf7f5c7ba9ae7f8a)

import {test, expect} from '../../fixtures.mjs';

test('setting columnsBuffer at runtime poisons totalColumns to NaN', async ({page}) => {
    await page.setViewportSize({width: 1280, height: 720});
    await page.goto('/examples/calendar/basic/index.html');
    await expect(page.locator('.neo-calendar-weekcomponent .neo-event').first()).toBeVisible();

    const appWorker = page.workers().find(w => w.url().includes('worker/App'));
    const weekId    = await page.locator('.neo-calendar-weekcomponent').getAttribute('id');

    const state = await appWorker.evaluate(async id => {
        const cmp    = globalThis.Neo.get(id),
              before = {totalColumns: cmp.totalColumns, visibleColumnsType: typeof cmp.visibleColumns};

        cmp.columnsBuffer = 5;
        cmp.currentDate   = new Date('2024-08-04T12:00:00.000Z');
        await cmp.promiseUpdate();

        const afterDateShift = {
            totalColumnsIsNaN : Number.isNaN(cmp.totalColumns),
            firstColumnDateYmd: globalThis.Neo.util.Date.convertToyyyymmdd(cmp.firstColumnDate),
            vdomFirstColFlag  : cmp.getColumnContainer().cn[0]?.flag ?? null,
            vdomColumnCount   : cmp.getColumnContainer().cn.length
        };

        cmp.getColumnContainer().cn = [];
        cmp.getHeaderContainer().cn = [];
        cmp.headerCreated = false;
        cmp.updateHeader(true, true);
        cmp.updateEvents(false);
        await cmp.promiseUpdate();

        return {
            before,
            afterDateShift,
            rebuiltColumnCount: cmp.getColumnContainer().cn.length,
            rebuiltHeaderCount: cmp.getHeaderContainer().cn.length
        };
    }, weekId);

    console.log(JSON.stringify(state, null, 2));
});

Verbatim probe output (chromium 157.0.8103.39, 82458b0453b8a89f3a09974abf7f5c7ba9ae7f8a):

{
  "initial": {
    "columnsBuffer": 7,
    "columnsVisible": 7,
    "visibleColumnsType": "undefined",
    "totalColumnsType": "number",
    "totalColumnsIsNaN": false,
    "totalColumnsString": "21",
    "firstColumnDateYmd": "2024-07-21",
    "vdomColumnCount": 21,
    "vdomHeaderCount": 21,
    "vdomFirstColFlag": "2024-07-21",
    "vdomLastColFlag": "2024-08-10",
    "domColumnCount": 21,
    "domHeaderItemCount": 21,
    "domEventCount": 6
  },
  "afterSetColumnsBuffer5": {
    "columnsBuffer": 5,
    "columnsVisible": 7,
    "visibleColumnsType": "undefined",
    "totalColumnsIsNaN": true,
    "totalColumnsString": "NaN",
    "firstColumnDateYmd": "2024-07-21",
    "vdomColumnCount": 21,
    "vdomHeaderCount": 21
  },
  "afterCurrentDateChange": {
    "columnsBuffer": 5,
    "columnsVisible": 7,
    "totalColumnsIsNaN": true,
    "totalColumnsString": "NaN",
    "firstColumnDateYmd": "2024-07-30",
    "vdomColumnCount": 21,
    "vdomFirstColFlag": "2024-07-21",
    "vdomLastColFlag": "2024-08-10",
    "domFirstColumnId": "neo-c-w-1_col_2024-07-21",
    "domLastColumnId": "neo-c-w-1_col_2024-08-10"
  },
  "afterCleanHeaderRebuild": {
    "columnsBuffer": 5,
    "columnsVisible": 7,
    "totalColumnsIsNaN": true,
    "totalColumnsString": "NaN",
    "firstColumnDateYmd": "2024-07-30",
    "vdomColumnCount": 0,
    "vdomHeaderCount": 0,
    "domColumnCount": 0,
    "domHeaderItemCount": 0,
    "domEventCount": 0
  }
}

The Architectural Reality

  • src/calendar/view/week/Component.mjs:62-72 defines reactive configs columnsBuffer_: 7 and columnsVisible_: 7; no visibleColumns member exists anywhere on Component.
  • src/calendar/view/week/Component.mjs:329-331: afterSetColumnsBuffer computes this.totalColumns = this.visibleColumns + 2 * value.
  • src/calendar/view/week/Component.mjs:339-341: afterSetColumnsVisible computes this.totalColumns = 2 * this.columnsBuffer + value.
  • src/calendar/view/week/Component.mjs:831 (onWheel), 891 (updateEvents), and 1025 (updateHeader) all bound their loops by this.totalColumns. When columnsBuffer or columnsVisible changes after headerCreated is true, updateHeader(false) (:1052) assumes content.cn and header.cn already have length this.totalColumns, so changing totalColumns at runtime also requires resetting content.cn = [] and header.cn = [] and rebuilding via updateHeader(true, true) + updateEvents().

Design authority: src/calendar/view/week/Component.mjs:62-71 ("Amount of hidden columns on both sides each inside this view. @member {Number} columnsBuffer_=7 @reactive" and "Amount of visible columns inside this view. @member {Number} columnsVisible_=7 @reactive") together with afterSetColumnsVisible at :340 (this.totalColumns = 2 * this.columnsBuffer + value).

The Fix

In src/calendar/view/week/Component.mjs:

  1. Fix afterSetColumnsBuffer (:329-331) to use this.columnsVisible + 2 * value (guarding when this.columnsVisible is not yet initialized if config order ever changes, or computing 2 * value + (this.columnsVisible ?? 0)).
  2. When this.isConstructed && oldValue !== undefined in afterSetColumnsBuffer and afterSetColumnsVisible, clear getColumnContainer().cn = [] and getHeaderContainer().cn = [], reset headerCreated = false, and rebuild columns/headers and events (updateHeader(true, true); updateEvents()) so runtime changes to either @reactive config keep VDOM and DOM column counts synchronized with totalColumns.

Acceptance Criteria

  • AC-1: Mutating columnsBuffer at runtime on a constructed Neo.calendar.view.week.Component sets totalColumns to 2 * columnsBuffer + columnsVisible (never NaN) and updates the rendered column/header count and subsequent currentDate transitions accordingly.
  • AC-2: Mutating columnsVisible at runtime on a constructed Neo.calendar.view.week.Component likewise rebuilds the column and header containers to match the new totalColumns without throwing in updateHeader.
  • AC-3: Add regression coverage under test/playwright/unit/calendar/ (or test/playwright/component/calendar/) that fails on dev before the fix and passes with npm run test-unit -- test/playwright/unit/calendar.

Out of Scope

  • Infinite-scroll column paging thresholds in onWheel beyond reading the updated columnsBuffer, columnsVisible, and totalColumns.
  • Calendar event drag-and-drop date calculation or store notification behavior (tracked in separate issues).

Avoided Traps

  • Fixing only the this.columnsVisible typo without rebuilding content.cn / header.cn: If columnsBuffer increases from 7 to 9 (totalColumns 21 -> 25) while headerCreated stays true, the next updateHeader(false) (:1052) calls Object.assign(content.cn[21], ...) on undefined and throws; if columnsBuffer decreases from 7 to 5 (21 -> 17), 4 stale trailing columns remain in content.cn and header.cn.

Related

  • #1069 (original week-view buffered column scrolling)
  • #20384 (week-view drag-zone lifecycle)

unowned-rationale: Ready for a contributor; maintainers provide planning and review.

Live latest-open + closed sweep: checked latest 30 open issues (30 total open in neomjs/neo, orange band; no owning calendar epic or ticket) + closed searches (columnsBuffer OR visibleColumns OR totalColumns calendar, calendar EventDragZone; read Out of Scope / Avoided Traps on #20577, #20384, #19005) at 2026-11-11T09:39Z; no equivalent or prior exclusion found. A2A in-flight claim sweep: checked latest 30 messages across all read states (status: 'all'); no competing claim on this scope. MC sweep: "calendar week columnsBuffer totalColumns NaN visibleColumns", 5 results, no prior decision found. Own-assignment sweep: 3 open (#20762, #20757, #20671), none overlapping.

Origin Session ID: 3b4d3f8f-c078-4cee-8876-b0db074a5c04 Retrieval Hint: "calendar week Component afterSetColumnsBuffer visibleColumns columnsVisible totalColumns NaN"

RagedPanda
RagedPanda Nov 11, 2026, 10:55 AM

I'd like to work on this. I'll open a PR with a fix and tests shortly.

@github-actions - 2026-11-11T09:58:41Z

Thanks for claiming this, @RagedPanda, and welcome! Assigned to you — you can start now.

Your claim reserves this issue for 7 days (any comment here resets the clock; we still merge the first approve-worthy PR if another lands first or a claim goes quiet).

An automatic reply. How claims work [QUARANTINED_URL: github.com]

  • 2026-11-11T09:58:41Z @github-actions assigned to @RagedPanda
RagedPanda cross-referenced by PR #20769 on Nov 11, 2026, 11:05 AM
tobiu referenced in commit 2aeee67 - "fix(calendar): rebuild week view columns when columnsBuffer or columnsVisible changes (#20766) (#20769)" on Nov 11, 2026, 2:46 PM
tobiu closed this issue on Nov 11, 2026, 2:46 PM