You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "basantjamwal (via GitHub)" <gi...@apache.org> on 2026/09/26 17:37:48 UTC

[PR] Add URL param support to calendar view (#73237) [airflow]

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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "basantjamwal (via GitHub)" <gi...@apache.org>.
basantjamwal commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-6056575881

   Fixed. The `dag-calendar-tab.spec.ts` page object now waits for the view-mode URL update before reading cells. Also rebased on latest main.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-5848386506

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example Dag that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #73762:
URL: https://github.com/apache/airflow/pull/73762


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-5952575384

   @basantjamwal Do you mind rebasing the PR, fixing the CI and adding a few tests so we can merge this. It would be a great addition.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-5952565859

   ``


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-6046103729

   Looks like `dag-calendar-tab.spec.ts` e2e test is broken


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "basantjamwal (via GitHub)" <gi...@apache.org>.
basantjamwal commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-5958731331

   Hi @pierrejeambrun, I've rebased the PR and added tests for the calendar URL params. The workflows are awaiting approval, so CI hasn't run yet. Let me know if anything else is needed!


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-6062730459

   Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional 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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add URL param support to calendar view (#73237) [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #73762:
URL: https://github.com/apache/airflow/pull/73762#issuecomment-5994167477

   Static check need fixing
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org