LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtNov 18, 2026, 4:40 PM
updatedAtNov 18, 2026, 8:46 PM
githubUrlhttps://github.com/neomjs/neo/issues/21360
authorneo-opus-ada
commentsCount3
parentIssue21329
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 21335 The calendar example opens on today''s team week
blocking[]
closedAtNov 18, 2026, 8:46 PM

On a phone the calendar shows the wrong days and cannot open folded

neo-opus-ada
neo-opus-ada commented on Nov 18, 2026, 4:40 PM

Context

#21335's AC-3 asks the calendar example to open as a day view without its side panel at 390 × 844, with no event title cut to a sliver. Building it ran into three engine behaviours. The AC moves here with them. Measured on the dev server at 390 × 844: examples/calendar/basic at 3d6f9374bb (today's team week), and the fixed-data fixture test/playwright/component/apps/calendar-basic (active date Sun 21 July 2024):

  • The week view's header falls out of step with its columns. With the side panel open, the week's scroll container is 170 px wide, so each of the 21 rendered day columns is 17 px. The header items keep their text's width (41 px, min-width: auto on a flex: 1 0 14.2857% item). After the mount scroll of 120 px, the columns start at Sun 21 but the header reads Tue 16 to Thu 18. On today's data it reads Wed 11 to Fri 13 while today is Wed 18. Every event is a 17 px sliver.
  • The calendar cannot be created folded. sideBarExpanded: false at creation throws Cannot set properties of undefined (setting 'style'), then me.items[0].items[1].add is not a function, and no event renders.
  • Folding after mount leaves the day view on the wrong day. Switching to the day view and folding the side panel after mount (on the viewport's resize event) left Tuesday 17 showing, about 125 px into the previous day.

Corrected on 18 Nov: this body first called the header case a wrong-week load and linked it to #20934's unexplained desktop loads. The columns load on the right week; only the header is out of step, and #20934's case (scrollLeft 0) is a different cause.

The Problem

src/calendar/view/MainContainer.mjs construct() calls afterSetSideBarExpanded(false, true) after createItemsContent(). That setter reads me.items[1].items[0] as a component (sideBar._vdom.style) while it is still a config, so a folded start throws, and the 10 ms settings-button timeout then fails too. The week and day views set their horizontal scroll once, 100 ms after mount, to a third of the column container's width (src/calendar/view/week/Component.mjs afterSetMounted()). Nothing re-centers them when their scroll container changes width: a folded side panel, a rotated phone, a resized window. The header row's items can grow past their columns' width, so at narrow widths the header and the columns scroll apart.

The Architectural Reality

  • src/calendar/view/MainContainer.mjs: sideBarExpanded_ (default true), construct(), afterSetSideBarExpanded(), afterSetUseSettingsContainer()'s timeout.
  • src/calendar/view/week/Component.mjs (the day view extends it, with one buffered day on each side): afterSetMounted()'s scroll to rect.width * columnsBuffer / columnsVisible / 3.
  • resources/css/src/calendar/view/week/Component.css: the header row items and the column container.
  • examples/calendar/basic/MainContainer.mjs: a Viewport, which can monitorSize and fire resize. The portal's apps/portal/view/Viewport.mjs maps that width to sizes (≤ 640 is x-small).
  • Three e2e specs pin the week view's position on the fixture. CalendarWeekViewSwitch.spec.mjs asserts the active week at load and after view switches.
  • Design authority: #21140's body for the example, "a day view on the phone"; CalendarWeekViewSwitch.spec.mjs's reading of the week through its header items; and sideBarExpanded_ being a public config, which a creation-time value must not break.

The Fix

  1. A calendar created with sideBarExpanded: false mounts folded: the creation path folds the side panel's config rather than calling the after-setter on a config.
  2. The week view's header items never grow past their columns, so header and columns scroll together at any width.
  3. The week and day views re-center on the active date after their scroll container changes width.
  4. At 640 px or less, examples/calendar/basic opens on today's day view without the side panel.

Acceptance Criteria

  • AC-1: A calendar created with sideBarExpanded: false mounts with its side panel folded and no error. A spec shows it, red on base.
  • AC-2: At 390 × 844, the fixture's week view header reads the active week (Sun 21 to Sat 27 July), in step with its columns. An e2e spec shows it, red on base.
  • AC-3: After the side panel folds, the week and day views still show the active week or day. An e2e spec shows it, red on base.
  • AC-4 (from #21335's AC-3): At 390 × 844, examples/calendar/basic opens on today's day view without the side panel, and no event title is cut to a sliver.
  • AC-5: The pull request shows the example at 390 × 844, dark, before and after.

Out of Scope

  • The all-day row (#20883), recurrence and resources.
  • The month and year views' scrolling.
  • #20934's unexplained desktop loads at scrollLeft 0.

Avoided Traps

  • Fold the side panel later in the example with a timeout. It treats the symptom, and a rotated phone still lands on the wrong day.
  • A longer mount delay. #20934 rejected it: it hides the race on one machine.

Related

  • Parent: #21329
  • Blocked by #21335: the fixture and the example this builds on are in its pull request.
  • #20934 (the week view's mount scroll)

Live latest-open + closed sweep: checked latest 20 open + open and closed search ("calendar phone", "sideBarExpanded", "calendar week view scroll", "calendar day view", "calendar mobile"; #20934 Out of Scope and Avoided Traps read) at 2026-11-18T15:38Z; no equivalent. Backlog: 85 open (red), so this is filed as a leaf of the lane epic #21329. A2A sweep: latest 30 messages, all read states, no claim on this scope. MC sweep: "calendar week view shows the previous week on a narrow screen, side panel folded at creation throws"; 5 results, no prior decision. Own-assignment sweep: none overlapping except #21335, whose AC-3 this takes over.

Retrieval Hint: "calendar phone week view header out of step narrow width sideBarExpanded false throws day view fold resize" Origin Session ID: 700d27bb-8c8b-4bfa-b85e-82e089eac915

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code