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

   The backfill banner was not auto-refreshing when backfills completed, 
requiring manual refresh (F5) to remove the banner. This change adds the same 
auto-refresh pattern used by other components.
   
   Import useAutoRefresh from src/utils
   Add refetchInterval to useBackfillServiceListBackfillsUi query
   Only refresh when there are active backfills (completed_at === null)
   This ensures the banner automatically disappears when all backfills are 
completed, providing consistent UX with other UI components.
   
   What changes were proposed in this pull request?
   This PR adds auto-refresh functionality to the backfill banner component to 
ensure it automatically disappears when backfills complete, providing 
consistent user experience with other UI components in Airflow.
   
   Changes made:
   
   Import useAutoRefresh utility from src/utils
   Add refetchInterval configuration to the useBackfillServiceListBackfillsUi 
query
   Implement conditional refresh logic that only triggers when there are active 
backfills (completed_at === null)
   Why are the changes needed?
   The backfill banner was not automatically updating its state when backfills 
completed, causing it to remain visible even after all backfill operations 
finished. Users had to manually refresh (F5) or navigate away and back to make 
the banner disappear.
   
   Issue reproduction:
   
   Start a backfill on any DAG - banner appears correctly
   Wait for backfill to complete
   Navigate around the UI - banner remains visible
   Manual refresh (F5) was required to remove the completed banner
   This created an inconsistent user experience compared to other 
auto-refreshing components in the Airflow UI.
   
   Does this PR introduce any user-facing change?
   Yes - The backfill banner will now automatically disappear when all 
backfills complete, without requiring manual page refresh. The banner will 
refresh at the configured interval (auto_refresh_interval setting) only when 
there are active backfills running.
   
   How was this patch tested?
   Code pattern validation: The implementation follows the exact same pattern 
used by other auto-refreshing components in the Airflow UI (DAGs list, HITL 
components, etc.)
   Logic verification: The conditional refresh logic (completed_at === null) 
ensures the banner only refreshes when there are actually active backfills to 
avoid unnecessary API calls
   TypeScript compliance: Proper typing added for query parameters to maintain 
code quality
   Testing approach:
   The fix leverages the existing useAutoRefresh utility which is already 
proven to work across the Airflow UI. The implementation is identical to other 
successful auto-refresh implementations, ensuring reliability and consistency.
   
   ^ Add meaningful description above
   Read the [Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)
 for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party 
License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a 
newsfragment file, named {pr_number}.significant.rst or 
{issue_number}.significant.rst, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).


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

Reply via email to