Skip to content

UI: prefer active state over queued when colouring collapsed groups#67543

Open
nathadfield wants to merge 2 commits into
apache:mainfrom
king:ui-dominant-state-coloring
Open

UI: prefer active state over queued when colouring collapsed groups#67543
nathadfield wants to merge 2 commits into
apache:mainfrom
king:ui-dominant-state-coloring

Conversation

@nathadfield
Copy link
Copy Markdown
Contributor

@nathadfield nathadfield commented May 26, 2026

Collapsed task groups and mapped tasks in the graph and grid views took their badge / border / icon colour from the backend's agg_state(), which ranks queued/scheduled ahead of running/deferred. A group with one queued task and five running tasks rendered queued-coloured even though most of its children were actively executing. The segmented state bar from #61854 already showed the proportional mix correctly, but the surrounding visual elements stayed on agg_state.

This PR reorders state_priority in airflow-core/src/airflow/api_fastapi/common/parameters.py to put RUNNING/RESTARTING/DEFERRED ahead of QUEUED/SCHEDULED. The single backend list is agg_state's only consumer, so the change flows through to taskInstance.state on the grid API response and every UI surface that reads it (graph node, grid cell, MiniMap, tooltip, detail-page headers) now reflects the most-active state without needing per-surface frontend logic. The frontend STATE_PRIORITY constant used by sortStateEntries is now back in sync with the backend.

The graph state filter (useGraphFilteredNodes.ts) is also updated to a "matches any contained child state" predicate rather than taskInstance.state. An operator filtering for "running" expects to find running work even when it's buried inside a fail-dominant collapsed group; the previous filter would have hidden those nodes. Leaf tasks still match by single state.

Two pre-existing rendering bugs for the "None" key in the segmented-bar slice and tooltip per-state breakdown are tracked at #67541 with in-code pointers at each affected site.

related: #67541


Was generative AI tooling used to co-author this PR?
  • Yes

Generated-by: Claude Code (Opus 4.7) following the guidelines

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label May 26, 2026
@nathadfield nathadfield force-pushed the ui-dominant-state-coloring branch 2 times, most recently from 12bf938 to b6090b8 Compare May 26, 2026 11:30
@nathadfield nathadfield marked this pull request as ready for review May 26, 2026 11:32
@nathadfield nathadfield force-pushed the ui-dominant-state-coloring branch from a5cca5a to 950e087 Compare May 26, 2026 13:12
Copy link
Copy Markdown
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the order inSTATE_PRIORITY in parameters.py

@nathadfield
Copy link
Copy Markdown
Contributor Author

We should update the order inSTATE_PRIORITY in parameters.py

Good call @bbovenzi. A backend fix is much cleaner.

@nathadfield nathadfield requested a review from bbovenzi May 27, 2026 09:51
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants