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
blockedBy[]
blocking[]
closedAtDec 12, 2025, 10:18 PM

Calendar: Fix YearComponent state regression & enhance State Provider

Closed v11.17.0 bugairegression
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.
tobiu added the bug label on Dec 12, 2025, 10:17 PM
tobiu added the ai label on Dec 12, 2025, 10:17 PM
tobiu added the regression label on Dec 12, 2025, 10:17 PM
tobiu assigned to @tobiu on Dec 12, 2025, 10:17 PM
tobiu referenced in commit 414d04b - "Calendar: Fix YearComponent state regression & enhance State Provider #8098" on Dec 12, 2025, 10:18 PM
tobiu closed this issue on Dec 12, 2025, 10:18 PM