basantjamwal opened a new pull request, #73762: URL: https://github.com/apache/airflow/pull/73762
closes: #73237 ## Description The calendar view's granularity (daily/hourly), run-status filter (total/failed), and selected timeframe were previously stored in `localStorage` only, so the view's state was never reflected in the URL — meaning links to a specific calendar view couldn't be shared. This PR moves that state entirely to URL search params (`calendar-granularity`, `calendar-view-mode`, `calendar-date`), removing the `localStorage` persistence. This follows the approach agreed on in the issue discussion: URL params for shareable view state, keeping `localStorage` reserved for genuinely personal settings (timezone, theme), which are unaffected by this change. ### Changes - `Calendar.tsx`: replaced `useState`/`useLocalStorage` with `useSearchParams` - `searchParams.ts`: added `CALENDAR_GRANULARITY`, `CALENDAR_VIEW_MODE`, `CALENDAR_DATE` keys - `localStorage.ts`: removed the now-unused `CALENDAR_GRANULARITY_KEY` / `CALENDAR_VIEW_MODE_KEY` ### Testing - Verified toggling granularity/run-status/date updates the URL correctly - Verified reloading the page preserves the exact view - Verified pasting the URL in an incognito window (fresh session) restores the same view - Verified visiting the bare `/calendar` URL with no params falls back cleanly to defaults **Shared link preserves view state** — opening a URL with `calendar-granularity=hourly&calendar-view-mode=failed&calendar-date=2026-07-26` in a fresh incognito session immediately shows that exact view: <img width="1920" height="1080" alt="Shared link preserves view state" src="https://github.com/user-attachments/assets/7ce1b999-b1f8-488d-b938-4683c081a067" /> **Default view when no params are present** — visiting the bare `/calendar` URL falls back cleanly to Daily / Total Runs / current month: <img width="1920" height="1080" alt="Default view with no params" src="https://github.com/user-attachments/assets/af8a106c-7edd-4a5c-a777-ac480866de60" /> --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: Claude (Anthropic) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
