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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
