This commit introduces the UTC Anchor principle to eliminate timezone-related bugs
and provide consistent date handling across all user timezones.
## Key Changes:
### Core Implementation
- Add `parseDateToUTC()` function that creates UTC anchors for date-only strings
- Add `parseDateToLocal` alias for existing `parseDate` function
- Deprecate direct `parseDate` usage with clear migration path
- Update date comparison functions to use UTC anchors
### Updated Components
- **dateUtils.ts**: New UTC parsing functions and updated comparisons
- **main.ts**: Use UTC anchor for selectedDate initialization
- **MiniCalendarView**: Navigate using UTC anchors
- **TimeblockCreationModal**: Fix timezone handling
- **Multiple test files**: Fix timezone assumptions in tests
### Refactored parseDate Usage
- **UnscheduledTasksSelectorModal**: Use parseDateToLocal for UI display
- **AdvancedCalendarView**: Use parseDateToLocal for calendar events
- **helpers.ts**: Use parseDateToUTC for internal date logic
- **FilterService**: Already using updated utilities
### Documentation
- Add comprehensive UTC Anchor implementation docs
- Update development guidelines with date handling best practices
- Add migration guide for existing code
- Include quick reference for date functions
## Benefits:
- Eliminates "off-by-one day" errors across timezones
- Provides consistent sorting and filtering behavior
- Simplifies date comparison logic
- Future-proofs against timezone-related bugs
## Testing:
- All 798 tests passing
- New UTC anchor test suite (11 tests)
- No regression in existing functionality
Fixes#327, #322, #314 and other timezone-related issues
Enhance documentation to reflect the new view options feature that allows
saved views to preserve view-specific display preferences alongside filters.
- Update filtering-and-views.md to explain view options preservation in saved views
- Enhance agenda-view.md with documentation for view-specific options and persistence
- Document Advanced Calendar View options and their persistence in calendar-views.md
- Add comprehensive developer guidelines for implementing view options in saved views
- Update releases.md to reference version 3.15.0
These documentation updates complement the code implementation committed in 1fb02e8
and provide complete user and developer guidance for the view options feature.
• Remove the legacy “MinimalistTaskModal” base class and its derivatives (MinimalistTaskCreationModal and MinimalistTaskEditModal) by renaming and consolidating them into new classes:
– Rename MinimalistTaskModal to TaskModal
– Rename MinimalistTaskCreationModal → TaskCreationModal
– Rename MinimalistTaskEditModal → TaskEditModal
• Update all references and imports across the project (including AdvancedCalendarView) to use the new TaskModal, TaskCreationModal, and TaskEditModal classes instead of the old minimalist versions.
• Extract and expose a new TaskConversionOptions type (in src/types/taskConversion.ts) to provide a consistent interface for passing conversion-related options.
• Adjust the modal logic:
– In TaskCreationModal, update natural language parsing, pre-populated values, and form handling using the new base TaskModal APIs.
– In TaskEditModal, change the constructor signature to accept an options object (including “task” and an optional “onTaskUpdated” callback) and update recurrence handling to convert legacy recurrence objects into display strings.
• Update CSS:
– Rename styles/minimalist-modal.css to styles/task-modal.css and update class comments (e.g. “MINIMALIST TASK MODAL” → “TASK MODAL – Google Keep/Todoist Inspired”).
– Modify selectors in modal-bem.css by removing references to “.task-creation-modal” and “.task-edit-modal” in some cases, as these are now included under the unified “tasknotes-plugin” context.
• Remove the tests for BaseTaskModal (tests/unit/modals/BaseTaskModal.test.ts) since that base class is no longer used, and update test references for the new TaskCreationModal class.
• Overall, this commit streamlines the modal codebase and unifies the naming and styling of task-related modals while updating the type definitions and downstream usage in views and tests.
These changes are backward‐compatible with previous plugin settings (aside from renamed classes/interfaces) but may require updates in any custom integrations relying on the old MinimalistTask* modals.
Summary:
• Added a new bullet under key architectural principles for "Obsidian Optimization Compliance" to indicate that the plugin follows Obsidian's load time optimization and deferred view compatibility best practices.
• Introduced a comprehensive "Performance Optimization & Obsidian Best Practices" section outlining strategies for keeping onload() lightweight, deferring heavy services until layout readiness, and dynamically importing heavy modules.
• Added detailed guidance on deferred view compatibility, including proper view initialization patterns and safe workspace iteration practices.
• Included a "File System Event Handling" subsection with patterns for registering vault events post-layout readiness, using debouncing, and ensuring event handlers do not interfere with startup performance.
• Added a new "External Data Integration" section describing the architecture for ICS calendar integration (both remote and local), file watcher patterns, and recommendations for integrating new external data sources with caching and UI configuration.
• Expanded error handling and data validation guidance to include safe date parsing with examples, optional property handling in interfaces, and developer best practices for type safety.
• Added a new "Testing & Quality Assurance" section with manual testing checklists and performance metrics to ensure robust plugin operation across different startup conditions and usage scenarios.
This update enhances the development guidelines by clearly documenting advanced performance strategies, integration patterns for external data sources, and comprehensive best practices for ensuring the plugin’s maintainability and compatibility with the latest Obsidian versions.