fix(ui): handle pools with unlimited (-1) slots in UI components#62831
Conversation
When a pool has slots set to -1 (unlimited), the UI now properly handles this case instead of showing broken bars or negative values. Changes: - PoolBar: render infinity symbol and proportional bar for unlimited pools - PoolBarCard: display ∞ instead of -1 in pool header - PoolSummary: correctly aggregate slots when any pool is unlimited - PoolForm: set min to -1 and add helper text explaining the convention Closes: apache#61115
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks @pierrejeambrun — both points addressed:
No logic changes — just cleaner data flow. |
|
static checks are failing |
|
@eladkal The static check failure ( Happy to rebase if needed once main is green again. |
There was a problem hiding this comment.
@antonio-mello-ai It's not flaky it's failing because of (in PoolBar component)
const usedSlots = displayedSlots
.filter((s) => s.slotType !== "open")
.reduce((sum, s) => sum + s.slotValue, 0);
Identifier "s" is too small and not descriptive enough.
Do you mind fixing this so we can merge it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@pierrejeambrun Fixed in 1e07bb4 — renamed |
pierrejeambrun
left a comment
There was a problem hiding this comment.
There are a few more linting / typing error.
You can run the static check locally. I recommend you install prek and setup the pre-commit hooks so that you will have those checks run locally before pushing your code. More information in our doc airflow/contributing-docs/08_static_code_checks.rst
- Fix indentation in PoolBar.tsx map callback (formatting) - Fix JSX line break in PoolBarCard.tsx (formatting) - Widen slotType cast to TaskInstanceState | "open" since open_slots produces "open" which is not a TaskInstanceState - Add explicit cast for StateIcon prop where "open" is already filtered out by infoSlots Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@pierrejeambrun Thanks for the guidance — installed Fixed in 6ae58d3:
All checks passing locally via |
choo121600
left a comment
There was a problem hiding this comment.
Overall looks good to me :)
Backport failed to create: v3-1-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker b63857e v3-1-testThis should apply the commit to the v3-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
…che#62831) * fix(ui): handle pools with unlimited (-1) slots in UI components When a pool has slots set to -1 (unlimited), the UI now properly handles this case instead of showing broken bars or negative values. Changes: - PoolBar: render infinity symbol and proportional bar for unlimited pools - PoolBarCard: display ∞ instead of -1 in pool header - PoolSummary: correctly aggregate slots when any pool is unlimited - PoolForm: set min to -1 and add helper text explaining the convention Closes: apache#61115 * fix(ui): simplify PoolBar unlimited slots computation per review Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): rename short identifier in PoolBar filter/reduce Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): resolve linting and typing errors caught by prek - Fix indentation in PoolBar.tsx map callback (formatting) - Fix JSX line break in PoolBarCard.tsx (formatting) - Widen slotType cast to TaskInstanceState | "open" since open_slots produces "open" which is not a TaskInstanceState - Add explicit cast for StateIcon prop where "open" is already filtered out by infoSlots Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
@choo121600 I believe this needs a manual backport. (To ease release managers pain I think we agreed that this should be done by the people merging the PR) |
…che#62831) * fix(ui): handle pools with unlimited (-1) slots in UI components When a pool has slots set to -1 (unlimited), the UI now properly handles this case instead of showing broken bars or negative values. Changes: - PoolBar: render infinity symbol and proportional bar for unlimited pools - PoolBarCard: display ∞ instead of -1 in pool header - PoolSummary: correctly aggregate slots when any pool is unlimited - PoolForm: set min to -1 and add helper text explaining the convention Closes: apache#61115 * fix(ui): simplify PoolBar unlimited slots computation per review Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): rename short identifier in PoolBar filter/reduce Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ui): resolve linting and typing errors caught by prek - Fix indentation in PoolBar.tsx map callback (formatting) - Fix JSX line break in PoolBarCard.tsx (formatting) - Widen slotType cast to TaskInstanceState | "open" since open_slots produces "open" which is not a TaskInstanceState - Add explicit cast for StateIcon prop where "open" is already filtered out by infoSlots Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Got it, thanks for the heads up! |
) (#63872) * fix(ui): handle pools with unlimited (-1) slots in UI components When a pool has slots set to -1 (unlimited), the UI now properly handles this case instead of showing broken bars or negative values. Changes: - PoolBar: render infinity symbol and proportional bar for unlimited pools - PoolBarCard: display ∞ instead of -1 in pool header - PoolSummary: correctly aggregate slots when any pool is unlimited - PoolForm: set min to -1 and add helper text explaining the convention Closes: #61115 * fix(ui): simplify PoolBar unlimited slots computation per review * fix(ui): rename short identifier in PoolBar filter/reduce * fix(ui): resolve linting and typing errors caught by prek - Fix indentation in PoolBar.tsx map callback (formatting) - Fix JSX line break in PoolBarCard.tsx (formatting) - Widen slotType cast to TaskInstanceState | "open" since open_slots produces "open" which is not a TaskInstanceState - Add explicit cast for StateIcon prop where "open" is already filtered out by infoSlots --------- Co-authored-by: Antonio Mello <ajgcvm@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
) (#63872) * fix(ui): handle pools with unlimited (-1) slots in UI components When a pool has slots set to -1 (unlimited), the UI now properly handles this case instead of showing broken bars or negative values. Changes: - PoolBar: render infinity symbol and proportional bar for unlimited pools - PoolBarCard: display ∞ instead of -1 in pool header - PoolSummary: correctly aggregate slots when any pool is unlimited - PoolForm: set min to -1 and add helper text explaining the convention Closes: #61115 * fix(ui): simplify PoolBar unlimited slots computation per review * fix(ui): rename short identifier in PoolBar filter/reduce * fix(ui): resolve linting and typing errors caught by prek - Fix indentation in PoolBar.tsx map callback (formatting) - Fix JSX line break in PoolBarCard.tsx (formatting) - Widen slotType cast to TaskInstanceState | "open" since open_slots produces "open" which is not a TaskInstanceState - Add explicit cast for StateIcon prop where "open" is already filtered out by infoSlots --------- Co-authored-by: Antonio Mello <ajgcvm@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
closes: #61115
Fixes the remaining UI portion of #61115. The backend fix was already merged in #61140.
When a pool has
slotsset to-1(unlimited), the UI components now properly handle this case:∞symbol instead of computing broken flex ratios from dividing by-1∞instead of-1in the pool card header (e.g.,my_pool (∞ Slots))-1min={-1}on the slots input and adds a helper text ("Use -1 for unlimited slots.") so users understand the conventionslotsHelperTexti18n keyTesting
-1slots via the API∞ Slotswith a properly rendered bar-1with helper textCloses #61115