Skip to content

Fix calendar dropdown search paging and persist last used calendar#2262

Open
AbhishekPAnil wants to merge 5 commits into
mainfrom
develop
Open

Fix calendar dropdown search paging and persist last used calendar#2262
AbhishekPAnil wants to merge 5 commits into
mainfrom
develop

Conversation

@AbhishekPAnil

Copy link
Copy Markdown
Contributor

This pull request introduces persistent storage for each user's most recently used calendar, improving how the app remembers and restores the user's context across sessions and devices. It adds a new utility for managing per-user recent calendar IDs in localStorage, updates the Dashboard and Calendar components to use this mechanism, and cleans up legacy logic around session storage and navigation.

The most important changes are:

Persistent Recent Calendar Storage:

  • Added src/utils/recentCalendarStorage.js with functions to get, set, and clear a user's most recently used calendar using localStorage, keyed by user ID. This is now the source of truth for restoring calendar context.

Dashboard Initialization and Navigation:

  • Refactored src/pages/Dashboard/Dashboard.jsx to:
    • Use the new recent calendar utility to restore the last active calendar on load.
    • Fallback to session storage or the first available calendar if no recent calendar is found.
    • Centralized calendar selection logic in a new persistActiveCalendar callback. [1] [2] [3] [4] [5]

Calendar Dropdown Behavior:

  • Updated src/components/Dropdown/Calendar/Calendar.jsx to:
    • Set the recent calendar for the user on calendar selection.
    • Improve state handling for search and paging, including resetting and synchronizing search terms and results. [1] [2] [3] [4] [5] [6]

Login Flow Simplification:

  • Simplified login navigation in src/pages/Login/Login.jsx by removing checks for calendarId in session storage, since calendar selection is now managed in the Dashboard using the new persistent mechanism.

General Refactoring:

  • Cleaned up redundant or obsolete code related to calendar selection and session storage, improving maintainability and reliability. [1] [2]

These changes ensure that each user is returned to their most recently used calendar, even across devices, and streamline calendar selection and navigation throughout the app.

AbhishekPAnil and others added 5 commits July 20, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants