refactor: bump up dependencies and improve calendar month navigation - #96
Merged
Conversation
Updated dependencies for React, React-DOM, and NextJS to their latest versions. This resolves compatibility issues across the project and ensures stability with updated packages.
Updated `onNextMonth` and `onPrevMonth` to accept a date parameter for precise control over month transitions. Improved scroll detection logic in `MonthObserver` for smoother navigation and added a debug overlay to assist during development.
Introduced a debug mode toggle using Jotai state management. This adds a switch to enable or disable the month observer overlay, enhancing development flexibility and debugging capabilities.
Refined the `MonthObserver` logic to track scrolling direction using a new `prevTopRef`. Improved conditions for triggering `onNextMonth` and `onPrevMonth` to ensure more accurate month navigation.
Replaced all occurrences of `isSecondRowOfMonth` with `isMonthBoundaryRow` for better clarity and alignment with its purpose. This makes the code easier to understand and improves maintainability.
Introduced the `isMonthBoundaryRow` function to identify rows containing the last day of a month. This helps optimize the IntersectionObserver logic by limiting observation to key rows, improving performance and ensuring accurate month label synchronization during scrolling.
Improved variable naming in `MonthObserver` to enhance code clarity and maintainability. This aligns with the project's established naming conventions and reduces ambiguity.
Updated `react-intersection-observer` to version 10.1.0 and adjusted peer dependencies for compatibility with React 19. Added the `initialInView` option in `MonthObserver` to improve rendering control. Updated related `pnpm-lock.yaml` entries to reflect these changes.
Renamed `onVisibleWhenScrollUp` to `loadPastMonths` and `onVisibleWhenScrollDown` to `loadFutureMonths`. Updated references in the calendar context and tasks calendar list to reflect the new names. Added comments to clarify the purpose of these functions, improving code readability and maintainability.
Replaced the deprecated `languages` key with the new `language_servers` key in `.serena/project.yml`. Enhanced configuration readability by reorganizing and updating documentation for ignored paths and language server options. This aligns with the latest `serena` configuration standards and improves maintainability.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Visit the 📚 Storybook 📚 for this PR (updated for commit 523c2a7): Build URL: https://www.chromatic.com/build?appId=63894befbaf58840c037c246&number=196 |
Added validation in `onNextMonth` and `onPrevMonth` to handle invalid date strings and prevent errors. Refined scroll detection logic in `MonthObserver` by removing unnecessary debug logs and optimizing conditions for triggering month transitions. Enhanced inline comments to improve code clarity and maintainability.
|
Visit the 📚 Storybook 📚 for this PR (updated for commit d9a9c94): Build URL: https://www.chromatic.com/build?appId=63894befbaf58840c037c246&number=197 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates project dependencies to their latest versions and refactors the calendar month navigation logic for improved clarity, performance, and maintainability.
Dependency Updates
react-intersection-observerto 10.1.0 with React 19 compatibilityCalendar Navigation Improvements
onVisibleWhenScrollUp→loadPastMonthsonVisibleWhenScrollDown→loadFutureMonthsisMonthBoundaryRowhelper function to identify rows containing the last day of a month, optimizing IntersectionObserver logicMonthObserverusingprevTopReffor accurate direction trackingonNextMonthandonPrevMonthto accept a date parameter for precise month transitionsCode Quality
isFirsttoisFirstRenderingReffor improved variable naming clarityRelated Issues
N/A
Testing