LearnNewsExamplesServices
Frontmatter
id8098
titleCalendar: Fix YearComponent state regression & enhance State Provider
stateClosed
labels
bugairegression
assigneestobiu
createdAtDec 12, 2025, 10:17 PM
updatedAtDec 12, 2025, 10:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/8098
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtDec 12, 2025, 10:18 PM

Calendar: Fix YearComponent state regression & enhance State Provider

tobiu
tobiu commented on Dec 12, 2025, 10:17 PM

Description

The calendar's YearComponent exhibited a regression where changing the year resulted in visual artifacts or reverted state. This was caused by in-place mutation of Date objects which are shared by reference with the StateProvider.

Changes

  1. YearComponent.mjs: Updated onNavButtonClick and onWheel to use stateProvider.setData() instead of modifying the local config.
  2. State Provider: Enhanced Neo.state.Provider to automatically clone Date objects when setting data. This ensures the provider maintains a clean source of truth and prevents mutation-by-reference bugs.
    • Added protected adjustValue(value) method.
    • Updated processDataObject and #setConfigValue to use adjustValue.

Acceptance Criteria

  • YearComponent navigation works correctly (no double logs, no reverted state).
  • StateProvider clones Date objects on set.