You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "anshuksi282-ksolves (via GitHub)" <gi...@apache.org> on 2025/12/10 11:07:38 UTC
[PR] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
anshuksi282-ksolves opened a new pull request, #59270:
URL: https://github.com/apache/airflow/pull/59270
## Description
This PR addresses issue #53826.
Currently, the Pool Bar visually includes `Scheduled` and `Deferred` states inside the progress bar. This can be misleading as these states do not typically consume open pool slots, making the pool look "fuller" than it actually is.
**Changes introduced:**
1. **PoolBar.tsx:** Updated the filter logic to only display active slots (`Running`, `Queued`, `Open`) inside the visual bar.
2. **PoolBarCard.tsx:** Added logic to display `Scheduled` and `Deferred` counts as text/icons below the bar on the Pools administration page.
3. **PoolSummary.tsx:** Applied the same text display logic to the Dashboard "Pool Slots" widget for consistency.
## Screenshots
**Before:**
<img width="1826" height="399" alt="Screenshot from 2025-12-10 16-18-34" src="https://github.com/user-attachments/assets/01ce2a5c-6ef1-47ed-80f7-5d2711ec59d5" />
<img width="1826" height="399" alt="Screenshot from 2025-12-10 16-18-42" src="https://github.com/user-attachments/assets/8ce968ed-b764-4f20-b780-06b6879690b7" />
**After:**
<img width="1826" height="399" alt="Screenshot from 2025-12-10 16-21-51" src="https://github.com/user-attachments/assets/3a2a2fba-fffc-4c5a-a3b1-6f9128653fb7" />
<img width="1826" height="380" alt="Screenshot from 2025-12-10 16-22-32" src="https://github.com/user-attachments/assets/65b06ca5-86e6-492d-9b5e-1b1c043994bf" />
<img width="1826" height="380" alt="Screenshot from 2025-12-10 16-22-12" src="https://github.com/user-attachments/assets/df9a3879-47aa-4003-9300-fb9e62a0798c" />
## Related Issue
Closes #53826
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ 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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #59270:
URL: https://github.com/apache/airflow/pull/59270#issuecomment-3750659662
### Backport successfully created: v3-1-test
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>✅</td>
<td>v3-1-test</td>
<td><a href="https://github.com/apache/airflow/pull/60538"><img src="https://img.shields.io/badge/PR-60538-blue" alt="PR Link"></a></td>
</tr>
</table>
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #59270:
URL: https://github.com/apache/airflow/pull/59270#issuecomment-3661235213
Also the deferred slot doesn't seem to be working.
<img width="1917" height="720" alt="Screenshot 2025-12-16 at 16 52 03" src="https://github.com/user-attachments/assets/c536c426-8433-4aa8-8747-0ff197fff2ae" />
<img width="1632" height="456" alt="Screenshot 2025-12-16 at 16 51 37" src="https://github.com/user-attachments/assets/c5902b45-e2a8-42d4-8944-bc9a8494b8a7" />
<img width="1873" height="645" alt="Screenshot 2025-12-16 at 16 51 43" src="https://github.com/user-attachments/assets/646ca02d-8ab2-4960-a31f-880197aad4ea" />
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "anshuksi282-ksolves (via GitHub)" <gi...@apache.org>.
anshuksi282-ksolves commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2677086250
##########
airflow-core/src/airflow/ui/public/i18n/locales/en/common.json:
##########
@@ -161,12 +161,14 @@
},
"pools": {
"deferred": "Deferred",
+ "includeDeferred": "Include Deferred",
"open": "Open",
"pools_one": "pool",
"pools_other": "pools",
"queued": "Queued",
"running": "Running",
- "scheduled": "Scheduled"
+ "scheduled": "Scheduled",
+ "totalPools": "Total Pools"
Review Comment:
I have verified with grep and you are correct—those keys were indeed unused or redundant. I have removed the entire pools object from common.json and ensured the PoolBar component correctly uses the existing states translations. Thanks for the catch!
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2676926272
##########
airflow-core/src/airflow/ui/public/i18n/locales/en/common.json:
##########
@@ -161,12 +161,14 @@
},
"pools": {
"deferred": "Deferred",
+ "includeDeferred": "Include Deferred",
"open": "Open",
"pools_one": "pool",
"pools_other": "pools",
"queued": "Queued",
"running": "Running",
- "scheduled": "Scheduled"
+ "scheduled": "Scheduled",
+ "totalPools": "Total Pools"
Review Comment:
It's not just about removing the redundant state translations. It also appears that we don't even use `includeDeferred` or `totalPools`
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "anshuksi282-ksolves (via GitHub)" <gi...@apache.org>.
anshuksi282-ksolves commented on PR #59270:
URL: https://github.com/apache/airflow/pull/59270#issuecomment-3727451927
Hi @bbovenzi updated based on your feedback:
- **Tooltips**: Reverted to standard style and default colors.
- **i18n**: Cleaned up duplicate keys; now using existing `common:states.*`.
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #59270:
URL: https://github.com/apache/airflow/pull/59270#issuecomment-3725785877
Please don't try to change the colors of the tooltips. Let's just use the standard tooltip with the default text color
<img width="345" height="160" alt="Screenshot 2026-01-08 at 3 59 20 PM" src="https://github.com/user-attachments/assets/6ad8b979-6555-49fc-8ebf-b3820a894490" />
The scheduled slots are still taking up space in the poolbar. It's just empty space now.
<img width="1412" height="419" alt="Screenshot 2026-01-08 at 3 59 51 PM" src="https://github.com/user-attachments/assets/c6750501-4c3f-49af-8ee1-435337b639f4" />
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2673951205
##########
airflow-core/src/airflow/ui/public/i18n/locales/en/common.json:
##########
@@ -161,12 +161,14 @@
},
"pools": {
"deferred": "Deferred",
+ "includeDeferred": "Include Deferred",
"open": "Open",
"pools_one": "pool",
"pools_other": "pools",
"queued": "Queued",
"running": "Running",
- "scheduled": "Scheduled"
+ "scheduled": "Scheduled",
+ "totalPools": "Total Pools"
Review Comment:
We don't use this anymore
##########
airflow-core/src/airflow/ui/public/i18n/locales/en/common.json:
##########
@@ -161,12 +161,14 @@
},
"pools": {
"deferred": "Deferred",
+ "includeDeferred": "Include Deferred",
"open": "Open",
"pools_one": "pool",
"pools_other": "pools",
"queued": "Queued",
"running": "Running",
- "scheduled": "Scheduled"
+ "scheduled": "Scheduled",
+ "totalPools": "Total Pools"
Review Comment:
We don't use this anymore
```suggestion
```
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2691199350
##########
airflow-core/src/airflow/ui/src/components/PoolBar.tsx:
##########
@@ -36,52 +37,87 @@ export const PoolBar = ({
}) => {
const { t: translate } = useTranslation("common");
+ const isDashboard = Boolean(poolsWithSlotType);
+ const includeDeferredInBar = "include_deferred" in pool && pool.include_deferred;
+ const barSlots = ["running", "queued", "open"];
+
+ if (isDashboard || includeDeferredInBar) {
+ barSlots.push("deferred");
+ }
+ const infoSlots = ["scheduled"];
+
+ if (!isDashboard && !includeDeferredInBar) {
+ infoSlots.push("deferred");
+ }
+
+ const preparedSlots = slotConfigs.map((config) => {
+ const slotType = config.key.replace("_slots", "") as TaskInstanceState;
+
+ return {
+ ...config,
+ label: translate(`common:states.${slotType}`),
+ slotType,
+ slotValue: (pool[config.key] as number | undefined) ?? 0,
+ };
+ });
+
return (
- <>
- {slotConfigs.map(({ color, icon, key }) => {
- const slotValue = pool[key];
- const flexValue = slotValue / totalSlots || 0;
+ <VStack align="stretch" gap={1} w="100%">
+ <Flex bg="bg.muted" borderRadius="md" h="20px" overflow="hidden" w="100%">
+ {preparedSlots
+ .filter((slot) => barSlots.includes(slot.slotType) && slot.slotValue > 0)
+ .map((slot) => {
+ const flexValue = slot.slotValue / totalSlots || 0;
- if (flexValue === 0) {
- return undefined;
- }
+ const poolContent = (
+ <Tooltip content={slot.label} key={slot.key} showArrow={true}>
+ <Flex
+ alignItems="center"
+ bg={`${slot.color}.solid`}
+ color={`${slot.color}.contrast`}
+ gap={1}
+ h="100%"
+ justifyContent="center"
+ overflow="hidden"
+ px={1}
+ w="100%"
+ >
+ {slot.icon}
+ <Text fontSize="xs" fontWeight="bold" truncate>
+ {slot.slotValue}
+ </Text>
+ </Flex>
+ </Tooltip>
+ );
- const slotType = key.replace("_slots", "");
- const poolCount = poolsWithSlotType ? poolsWithSlotType[key] : 0;
- const tooltipContent = `${translate(`pools.${slotType}`)}: ${slotValue} (${poolCount} ${translate("pools.pools", { count: poolCount })})`;
- const poolContent = (
- <Tooltip content={tooltipContent} key={key}>
- <Flex
- alignItems="center"
- bg={`${color}.solid`}
- color={`${color}.contrast`}
- gap={1}
- h="100%"
- justifyContent="center"
- px={1}
- textAlign="center"
- w="100%"
- >
- {icon}
- {slotValue}
- </Flex>
- </Tooltip>
- );
+ return slot.color !== "success" && "name" in pool ? (
+ <Link asChild flex={flexValue} key={slot.key}>
+ <RouterLink
+ to={`/task_instances?${SearchParamsKeys.STATE}=${slot.color}&${SearchParamsKeys.POOL}=${pool.name}`}
+ >
+ {poolContent}
+ </RouterLink>
+ </Link>
+ ) : (
+ <Box flex={flexValue} key={slot.key}>
+ {poolContent}
+ </Box>
+ );
+ })}
+ </Flex>
- return color !== "success" && "name" in pool ? (
- <Link asChild display="flex" flex={flexValue} key={key}>
- <RouterLink
- to={`/task_instances?${SearchParamsKeys.STATE}=${color}&${SearchParamsKeys.POOL}=${pool.name}`}
- >
- {poolContent}
- </RouterLink>
- </Link>
- ) : (
- <Box display="flex" flex={flexValue} key={key}>
- {poolContent}
- </Box>
- );
- })}
- </>
+ <HStack gap={4} wrap="wrap">
+ {preparedSlots
+ .filter((slot) => infoSlots.includes(slot.slotType) && slot.slotValue > 0)
+ .map((slot) => (
+ <HStack gap={1} key={slot.key}>
+ <StateIcon size={12} state={slot.slotType} />
+ <Text color="fg.muted" fontSize="xs" fontWeight="medium">
Review Comment:
We should probably have a link here too. Similarly to above non 'success' state. But that can be a follow up item.
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "anshuksi282-ksolves (via GitHub)" <gi...@apache.org>.
anshuksi282-ksolves commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2677086250
##########
airflow-core/src/airflow/ui/public/i18n/locales/en/common.json:
##########
@@ -161,12 +161,14 @@
},
"pools": {
"deferred": "Deferred",
+ "includeDeferred": "Include Deferred",
"open": "Open",
"pools_one": "pool",
"pools_other": "pools",
"queued": "Queued",
"running": "Running",
- "scheduled": "Scheduled"
+ "scheduled": "Scheduled",
+ "totalPools": "Total Pools"
Review Comment:
I have verified with grep and you are correct—those keys were indeed unused or redundant. I have removed the entire pools object from `common.json` and ensured the `PoolBar` component correctly uses the existing states translations.
Thanks for the catch!
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2673951205
##########
airflow-core/src/airflow/ui/public/i18n/locales/en/common.json:
##########
@@ -161,12 +161,14 @@
},
"pools": {
"deferred": "Deferred",
+ "includeDeferred": "Include Deferred",
"open": "Open",
"pools_one": "pool",
"pools_other": "pools",
"queued": "Queued",
"running": "Running",
- "scheduled": "Scheduled"
+ "scheduled": "Scheduled",
+ "totalPools": "Total Pools"
Review Comment:
We don't use this anymore
```suggestion
```
##########
airflow-core/src/airflow/ui/public/i18n/locales/en/common.json:
##########
@@ -161,12 +161,14 @@
},
"pools": {
"deferred": "Deferred",
+ "includeDeferred": "Include Deferred",
"open": "Open",
"pools_one": "pool",
"pools_other": "pools",
"queued": "Queued",
"running": "Running",
- "scheduled": "Scheduled"
+ "scheduled": "Scheduled",
+ "totalPools": "Total Pools"
Review Comment:
Are we using these new translations anymore?
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "anshuksi282-ksolves (via GitHub)" <gi...@apache.org>.
anshuksi282-ksolves commented on PR #59270:
URL: https://github.com/apache/airflow/pull/59270#issuecomment-3664801025
Thanks @pierrejeambrun for the detailed feedback! I have updated the implementation to fully address the UI styling and logic concerns.
**Changes included:**
* **Theme-Aware Tooltips:** The tooltip now adapts to the theme—White in Light Mode and Dark Grey in Dark Mode for better readability.
* **State Colors:** The text inside the tooltip (Open, Running, Deferred) now matches its corresponding state color (Green, Skyblue, Purple).
* **Clean UI:** Removed the tooltip arrow because the global/root styling was causing color mismatches
* **Logic Verified:** Verified that Deferred slots appear in the bar only if include_deferred is True (or on the Dashboard).
<img width="1852" height="180" alt="Screenshot from 2025-12-17 16-16-34" src="https://github.com/user-attachments/assets/5ed03e69-76be-4435-9809-12a14294e2b4" />
<img width="1920" height="601" alt="Screenshot from 2025-12-17 16-15-50" src="https://github.com/user-attachments/assets/bf518902-1507-49be-8fa4-c8653eec9326" />
<img width="1920" height="601" alt="Screenshot from 2025-12-17 16-14-39" src="https://github.com/user-attachments/assets/07cb4215-dd79-42e3-8b59-014a199f1290" />
<img width="1852" height="246" alt="Screenshot from 2025-12-17 16-16-51" src="https://github.com/user-attachments/assets/9112d8ff-73eb-4b80-8c50-0a66537aedb3" />
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2623754124
##########
airflow-core/src/airflow/ui/src/components/PoolBar.tsx:
##########
@@ -35,53 +36,101 @@ export const PoolBar = ({
readonly totalSlots: number;
}) => {
const { t: translate } = useTranslation("common");
+ const activeSlots = ["running", "queued", "open"];
+
+ if ("include_deferred" in pool && pool.include_deferred) {
+ activeSlots.push("deferred");
+ }
return (
- <>
- {slotConfigs.map(({ color, icon, key }) => {
- const slotValue = pool[key];
- const flexValue = slotValue / totalSlots || 0;
+ <Tooltip
+ content={
+ <VStack align="start" gap={1} p={1}>
+ {slotConfigs.map(({ key }) => {
+ const slotValue = pool[key];
+ const slotType = key.replace("_slots", "");
+
+ if (slotValue === 0) {
+ return undefined;
+ }
+
+ return (
+ <Flex align="center" gap={2} key={key}>
+ <StateIcon size={12} state={slotType as TaskInstanceState} />
+ <Text fontSize="xs">
+ {translate(`common:state.${slotType}`)}: {slotValue}
+ </Text>
+ </Flex>
+ );
+ })}
+ {"include_deferred" in pool && (
+ <Text color="fg.muted" fontSize="xs" mt={1}>
+ {translate("pools.includeDeferred")}: {pool.include_deferred ? "True" : "False"}
+ </Text>
+ )}
+ {poolsWithSlotType ? (
+ <Text color="fg.muted" fontSize="xs" mt={1}>
+ {translate("pools.totalPools")}:{" "}
+ {Object.values(poolsWithSlotType).reduce((total, count) => total + count, 0)}
+ </Text>
+ ) : undefined}
+ </VStack>
+ }
+ >
+ <Flex bg="bg.muted" borderRadius="md" h="100%" overflow="hidden" w="100%">
+ {slotConfigs
+ .filter((config) => {
+ const slotType = config.key.replace("_slots", "");
+
+ return activeSlots.includes(slotType);
+ })
+ .map(({ color, icon, key }) => {
+ const slotValue = pool[key];
+ const flexValue = totalSlots > 0 ? (slotValue / totalSlots) * 100 : 0;
Review Comment:
Why did we change how we compute the flex value? It doesn't seem related to this PR. (*100, total slots check etc.)
##########
airflow-core/src/airflow/ui/src/components/PoolBar.tsx:
##########
@@ -35,53 +36,101 @@ export const PoolBar = ({
readonly totalSlots: number;
}) => {
const { t: translate } = useTranslation("common");
+ const activeSlots = ["running", "queued", "open"];
+
+ if ("include_deferred" in pool && pool.include_deferred) {
+ activeSlots.push("deferred");
+ }
return (
- <>
- {slotConfigs.map(({ color, icon, key }) => {
- const slotValue = pool[key];
- const flexValue = slotValue / totalSlots || 0;
+ <Tooltip
+ content={
+ <VStack align="start" gap={1} p={1}>
+ {slotConfigs.map(({ key }) => {
+ const slotValue = pool[key];
+ const slotType = key.replace("_slots", "");
+
+ if (slotValue === 0) {
+ return undefined;
+ }
+
+ return (
+ <Flex align="center" gap={2} key={key}>
+ <StateIcon size={12} state={slotType as TaskInstanceState} />
+ <Text fontSize="xs">
+ {translate(`common:state.${slotType}`)}: {slotValue}
+ </Text>
+ </Flex>
+ );
+ })}
+ {"include_deferred" in pool && (
+ <Text color="fg.muted" fontSize="xs" mt={1}>
+ {translate("pools.includeDeferred")}: {pool.include_deferred ? "True" : "False"}
+ </Text>
+ )}
+ {poolsWithSlotType ? (
+ <Text color="fg.muted" fontSize="xs" mt={1}>
+ {translate("pools.totalPools")}:{" "}
+ {Object.values(poolsWithSlotType).reduce((total, count) => total + count, 0)}
+ </Text>
+ ) : undefined}
+ </VStack>
+ }
+ >
+ <Flex bg="bg.muted" borderRadius="md" h="100%" overflow="hidden" w="100%">
+ {slotConfigs
+ .filter((config) => {
+ const slotType = config.key.replace("_slots", "");
+
+ return activeSlots.includes(slotType);
+ })
+ .map(({ color, icon, key }) => {
+ const slotValue = pool[key];
+ const flexValue = totalSlots > 0 ? (slotValue / totalSlots) * 100 : 0;
+
+ if (flexValue === 0) {
+ return undefined;
+ }
- if (flexValue === 0) {
- return undefined;
- }
+ const slotType = key.replace("_slots", "");
- const slotType = key.replace("_slots", "");
- const poolCount = poolsWithSlotType ? poolsWithSlotType[key] : 0;
- const tooltipContent = `${translate(`pools.${slotType}`)}: ${slotValue} (${poolCount} ${translate("pools.pools", { count: poolCount })})`;
- const poolContent = (
- <Tooltip content={tooltipContent} key={key}>
- <Flex
- alignItems="center"
- bg={`${color}.solid`}
- color={`${color}.contrast`}
- gap={1}
- h="100%"
- justifyContent="center"
- px={1}
- textAlign="center"
- w="100%"
- >
- {icon}
- {slotValue}
- </Flex>
- </Tooltip>
- );
+ const poolContent = (
+ <Flex
+ alignItems="center"
+ bg={`${color}.solid`}
+ color={`${color}.contrast`}
+ gap={1}
+ h="100%"
+ justifyContent="center"
+ px={1}
+ textAlign="center"
+ title={`${slotType}: ${slotValue}`}
+ w="100%"
+ >
+ {icon}
+ {flexValue > 5 && (
+ <Text fontSize="xs" fontWeight="bold">
+ {slotValue}
+ </Text>
Review Comment:
Now we can have really 'thin' segment, and we have no icon etc... I think we shouldn't change that part. (or at least not in this PR).
<img width="1381" height="194" alt="Image" src="https://github.com/user-attachments/assets/b5bbb848-fbe3-42e0-a703-351834460074" />
##########
airflow-core/src/airflow/ui/src/components/PoolBar.tsx:
##########
@@ -35,53 +36,101 @@ export const PoolBar = ({
readonly totalSlots: number;
}) => {
const { t: translate } = useTranslation("common");
+ const activeSlots = ["running", "queued", "open"];
+
+ if ("include_deferred" in pool && pool.include_deferred) {
Review Comment:
The computation for PoolBar summary won't be accurate I think. Because `influce_deferred` is not in `pool` and it won't be counted for pools with 'include_deferred=True'
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #59270:
URL: https://github.com/apache/airflow/pull/59270
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "anshuksi282-ksolves (via GitHub)" <gi...@apache.org>.
anshuksi282-ksolves commented on PR #59270:
URL: https://github.com/apache/airflow/pull/59270#issuecomment-3686362893
Hi @pierrejeambrun and @bbovenzi,
I have squashed the commits and updated the logic based on your latest feedback:
* **Reverted to "Under the Bar" Design:** Informational stats (Scheduled, Deferred) are now displayed below the bar for better visibility.
* **No Code Duplication:** Handled the "Under the Bar" rendering directly inside PoolBar.tsx to keep parent components clean.
* **Tooltips: Removed the large tooltip;** restored individual tooltips with dynamic state colors.
Fixes: Resolved parent container clipping issues and corrected i18n keys.
Ready for final review!
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "anshuksi282-ksolves (via GitHub)" <gi...@apache.org>.
anshuksi282-ksolves commented on PR #59270:
URL: https://github.com/apache/airflow/pull/59270#issuecomment-3645188031
Thank you @bbovenzi and @pierrejeambrun for the detailed review!
I have updated the implementation based on your feedback:
1. **UI Clean-up & Tooltip:**
- Removed the text stats below the pool bar in both `PoolBarCard` and `PoolSummary` to avoid code duplication and reduce UI clutter.
- Moved all detailed statistics (Scheduled, Deferred, Total Pools) inside the **Tooltip**.
- Updated the i18n keys to use `common:state.*` as suggested.
2. **Logic Update (`include_deferred`):**
- Updated `PoolBar.tsx` to conditionally render "Deferred" slots in the visual bar **only if** `include_deferred` is set to `True` for that pool.
- Added the "Include Deferred" status inside the tooltip to help users understand the bar's composition.
I have verified the logic locally:
- **Default Pools:** Deferred slots are excluded from the bar (clean UI).
- **Configured Pools:** If `include_deferred` is enabled, the visual bar correctly includes the deferred slots.
Ready for another look!
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2610962474
##########
airflow-core/src/airflow/ui/src/pages/Dashboard/PoolSummary/PoolSummary.tsx:
##########
@@ -103,6 +104,24 @@ export const PoolSummary = () => {
<PoolBar pool={aggregatePool} poolsWithSlotType={poolsWithSlotType} totalSlots={totalSlots} />
</Flex>
)}
+ <HStack gap={4} mt={2}>
+ {aggregatePool.scheduled_slots > 0 && (
+ <HStack>
+ <StateIcon size={12} state="scheduled" />
+ <Text color="fg.muted" fontSize="sm">
+ {translate("dashboard.scheduled")}: {aggregatePool.scheduled_slots}
+ </Text>
+ </HStack>
+ )}
+ {aggregatePool.deferred_slots > 0 && (
+ <HStack>
+ <StateIcon size={12} state="deferred" />
+ <Text color="fg.muted" fontSize="sm">
+ {translate("dashboard.deferred")}: {aggregatePool.deferred_slots}
+ </Text>
+ </HStack>
+ )}
+ </HStack>
Review Comment:
What if we show this in the tooltip instead?
Also, let's make sure that we're using the correct i18n keys. In your screenshot it is showing "dashboard.deferred". We should have something like `common:state.deferred` that already exists
--
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] UI: Update PoolBar to separate Scheduled and Deferred slots [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #59270:
URL: https://github.com/apache/airflow/pull/59270#discussion_r2610964735
##########
airflow-core/src/airflow/ui/src/pages/Dashboard/PoolSummary/PoolSummary.tsx:
##########
@@ -103,6 +104,24 @@ export const PoolSummary = () => {
<PoolBar pool={aggregatePool} poolsWithSlotType={poolsWithSlotType} totalSlots={totalSlots} />
</Flex>
)}
+ <HStack gap={4} mt={2}>
+ {aggregatePool.scheduled_slots > 0 && (
+ <HStack>
+ <StateIcon size={12} state="scheduled" />
+ <Text color="fg.muted" fontSize="sm">
+ {translate("dashboard.scheduled")}: {aggregatePool.scheduled_slots}
+ </Text>
+ </HStack>
+ )}
+ {aggregatePool.deferred_slots > 0 && (
+ <HStack>
+ <StateIcon size={12} state="deferred" />
+ <Text color="fg.muted" fontSize="sm">
+ {translate("dashboard.deferred")}: {aggregatePool.deferred_slots}
+ </Text>
+ </HStack>
+ )}
+ </HStack>
Review Comment:
If its on the tooltip, then we only need to change PoolBar.tsx instead of repeating coding for here and in the card component
--
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