Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/releases/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Example:

## Fixed

- Fixed a calendar view issue where creating or modifying events, timeblocks, etc. could reset the visible date back to today
- Fixed documentation deployment CI failures caused by `docs-builder/src/js/main.js` being excluded by a broad `.gitignore` `main.js` rule
- Added a specific unignore rule so the docs site client script is tracked and available in GitHub Actions builds
- Reduced long-running performance risk from calendar sync token persistence by avoiding full runtime settings side-effects during background sync writes
Expand Down
6 changes: 5 additions & 1 deletion src/bases/CalendarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export class CalendarView extends BasesViewBase {

// Flag to indicate config changed and calendar needs recreation
private _configChangedNeedsRecreate = false;
// Preserve visible date when calendar is re-created.
private _recreateTargetDate: Date | null = null;

private viewOptions: {
// Events
Expand Down Expand Up @@ -617,6 +619,7 @@ export class CalendarView extends BasesViewBase {
this._configChangedNeedsRecreate = false;
this.readViewOptions();
if (this.calendar) {
this._recreateTargetDate = this.calendar.getDate();
this.calendar.destroy();
this.calendar = null;
}
Expand Down Expand Up @@ -675,7 +678,7 @@ export class CalendarView extends BasesViewBase {
if (!this.calendarEl) return;

// Determine initial date
const initialDate = this.determineInitialDate(taskNotes);
const initialDate = this._recreateTargetDate ?? this.determineInitialDate(taskNotes);

// Build calendar options
const calendarOptions: CalendarOptions = {
Expand Down Expand Up @@ -822,6 +825,7 @@ export class CalendarView extends BasesViewBase {
// Create calendar
this.calendar = new Calendar(this.calendarEl, calendarOptions);
this.calendar.render();
this._recreateTargetDate = null;

// Apply showTodayHighlight option via CSS
this.applyTodayHighlightStyling();
Expand Down
Loading