Skip to content

Fix None child state rendering in UI#67552

Open
Codingaditya17 wants to merge 5 commits into
apache:mainfrom
Codingaditya17:fix-none-child-state-rendering
Open

Fix None child state rendering in UI#67552
Codingaditya17 wants to merge 5 commits into
apache:mainfrom
Codingaditya17:fix-none-child-state-rendering

Conversation

@Codingaditya17
Copy link
Copy Markdown
Contributor

Summary

This PR fixes rendering for serialized None child state keys in the UI.

The grid API can return child states like {"None": 2, "success": 1}. Before this change, the UI used the raw None key directly for Chakra color tokens and translations, producing None.solid and common:states.None.

This change adds small state normalization helpers and applies them to the two direct child_states render sites:

  • SegmentedStateBar.tsx
  • TaskInstanceTooltip.tsx

Scope

This PR intentionally only fixes the direct child state breakdown/rendering issue described in #67541. It does not change the dominant state logic handled separately in #67543.

Tests

pnpm vitest run src/utils/stateUtils.test.ts src/components/TaskInstanceTooltip.test.tsx



Test Files  2 passed (2)
Tests       21 passed (21)

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.

It would be better to fix this on the API level. Renaming None to none, and making sure that no_status & none share the same color in theme.ts and the same translation in common.json

@Codingaditya17
Copy link
Copy Markdown
Contributor Author

Thanks for the review. I updated the PR to move the normalization to the API layer as suggested.

What changed:

  • The grid API now serializes None child state keys as "none" instead of emitting "None".
  • Updated the grid API response model to allow "none" as a child state key.
  • Updated the existing grid API test expectations from "None" to "none".
  • Removed the frontend-only "None" normalization helpers and restored the UI render sites to use the API-provided state key directly.
  • Added no_status in theme.ts with the same gray semantic tokens as none.

Tests run locally:

  • uv run pytest airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_grid.py -k "mapped"
    Result: 1 passed, 59 deselected
  • cd airflow-core/src/airflow/ui && pnpm vitest run src/utils/stateUtils.test.ts src/components/TaskInstanceTooltip.test.tsx
    Result: Test Files 2 passed, Tests 17 passed
  • uv run prek run ts-compile-lint-ui --all-files
    Result: Compile / format / lint UI Passed

Comment thread uv.lock
@bbovenzi bbovenzi added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 26, 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. backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants