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

[PR] Make Dag pause toggle update immediately on click [airflow]

pierrejeambrun opened a new pull request, #69134:
URL: https://github.com/apache/airflow/pull/69134

   The pause/unpause switch on the Dags list page waited for the dags-list refetch to settle before flipping. Under fast interaction this looked like the first clicks were dropped — clicking once on several rows left them all visually unchanged until enough subsequent clicks accumulated and the list eventually refetched. With a filter on `paused=true/false`, the same delay meant a toggled row stayed in the visible list for a beat after the user changed its state instead of leaving the filtered view right away.
   
   Apply React Query's optimistic update pattern to `useTogglePause`:
   
   - `onMutate` writes the new `is_paused` into the dag detail, dag, and all dags-list caches so the Switch reflects the new state on click instead of after the server round-trip.
   - `onError` rolls each of those caches back to the pre-mutation snapshot if the server rejects, then surfaces the existing toaster.
   - `onSettled` invalidates the same query keys the previous `onSuccess` did, so filtered list queries refetch and may move the row in or out of the visible page.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.7)
   
   Generated-by: Claude Code (Opus 4.7) 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] Make Dag pause toggle update immediately on click [airflow]

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

   ## Before
   
   https://github.com/user-attachments/assets/6769bf1f-f19c-42ca-8ae2-1815885f00ec
   
   
   
   ## After
   
   https://github.com/user-attachments/assets/b14571f2-2499-4e91-aa2f-82bc25d38920
   
   


-- 
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