You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Kunal8954 (via GitHub)" <gi...@apache.org> on 2026/09/02 14:00:19 UTC

[PR] Add toggle to hide Task Group durations on the Gantt chart [airflow]

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

   closes: #72434
   
   ### What's the problem
   
   TaskGroups show up on the Gantt chart as a single bar spanning from the earliest child task's start to the latest child task's end (the "envelope" of everything inside). When the tasks inside actually run quickly, that envelope bar still reads as one very long-running task, which makes the chart hard to interpret at a glance — exactly what the issue describes. Removing TaskGroups from the Gantt entirely was considered and rejected in the issue itself, since they're still useful there for organizing the chart.
   
   ### The fix
   
   Add a "Hide Task Group Durations" switch under Gantt view -> Options (next to the existing Dag Runs / Version Indicator settings). When it's on:
   
   - TaskGroup rows keep their place in the Gantt (so they still line up with the Grid/sidebar for organization).
   - Their aggregate duration bar is simply not rendered.
   - Regular task bars are unaffected.
   
   The setting is a boolean stored in localStorage (`gantt_hide_group_durations`), following the same pattern as the existing "All Dag Dependencies" toggle, so it persists across sessions and applies globally (not scoped to one Dag).
   
   ### Tests
   
   Added two tests to `GanttTimeline.test.tsx`:
   - a Task Group's bar disappears when the toggle is on, and reappears when it's off (the row itself is never dropped).
   - a regular task's bar is unaffected by the toggle.
   
   ### Verification
   
   - `vitest run` on `GanttTimeline.test.tsx` + `Gantt/utils.test.ts`: all passing (8/8 in the touched file, including the 2 new tests).
   - `eslint --quiet` on every touched file: clean.
   - `tsc -p tsconfig.app.json`: clean.
   - `prettier --check`: clean.
   - Branch rebased onto current `main` before running all of the above.
   
   ---
   
   <sub>Disclosure: this PR was prepared with the assistance of Claude Code (the commit carries a `Co-Authored-By` trailer). I reviewed the change and take responsibility for it.</sub>
   
   🤖 Generated with [[Claude Code](https://claude.com/claude-code)](https://claude.com/claude-code)
   
   https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh


-- 
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] Add task Group stripes on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on code in PR #72435:
URL: https://github.com/apache/airflow/pull/72435#discussion_r3981585626


##########
airflow-core/src/airflow/ui/src/layouts/Details/Gantt/GanttTimeline.tsx:
##########
@@ -387,6 +399,26 @@ export const GanttTimeline = ({
                                 <StateIcon size={GANTT_STATE_ICON_SIZE_PX} state={state} />
                               )}
                             </Badge>
+                            {node.isGroup === true ? (
+                              <Box

Review Comment:
   The extra Box is required for the hatch-pattern overlay on the Task Group aggregate bar. It needs to sit above the Badge so the pattern also overlays the badge fill/icon, while pointerEvents="none" keeps it purely decorative. I’ve also removed the stale newsfragment and restored the unrelated whitespace change.



-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on code in PR #72435:
URL: https://github.com/apache/airflow/pull/72435#discussion_r3950068761


##########
airflow-core/newsfragments/72435.feature.rst:
##########


Review Comment:
   Addressed in 509098d7e9: removed the redundant toggle and kept Task Group aggregate bars always hatched. Also removed unrelated changes from this PR.
   
   



-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5516422644

   TBH, I'm not so sure I love this. Now, it looks like there is a significant chunk of "missing" time. I would rather do something like add hatches to the Task Group bar, or something like that.


-- 
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] Add task Group stripes on the Gantt chart [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #72435:
URL: https://github.com/apache/airflow/pull/72435#discussion_r3980331501


##########
airflow-core/newsfragments/72435.feature.rst:
##########
@@ -0,0 +1 @@
+Add a toggle to hide Task Group durations on the Gantt chart.

Review Comment:
   To remove



##########
airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx:
##########
@@ -112,7 +112,6 @@ export const DetailsLayout = ({ children, error, isLoading, outletContext, tabs
     `version_indicator_display_mode`,
     VersionIndicatorOptions.ALL,
   );
-

Review Comment:
   ?
   
   Unrelated remove please.



##########
airflow-core/src/airflow/ui/src/layouts/Details/Gantt/GanttTimeline.tsx:
##########
@@ -387,6 +399,26 @@ export const GanttTimeline = ({
                                 <StateIcon size={GANTT_STATE_ICON_SIZE_PX} state={state} />
                               )}
                             </Badge>
+                            {node.isGroup === true ? (
+                              <Box

Review Comment:
   Why an extra box?



-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on code in PR #72435:
URL: https://github.com/apache/airflow/pull/72435#discussion_r3950068761


##########
airflow-core/newsfragments/72435.feature.rst:
##########


Review Comment:
   Thanks for the review! That makes sense. I'll remove the unrelated changes and keep this PR focused on the issue. I'll also reconsider the toggle naming and update the implementation accordingly. Thanks!



-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5519278614

   > What does it look like when you expand the TaskGroup? Can you share a snip?
   
   Sure — here's what it looks like expanded:
   
   <img width="1194" height="722" alt="Screenshot 2026-09-03 at 7 26 17 AM" src="https://github.com/user-attachments/assets/e011e0b4-d646-439d-8cc9-d2f0f3c2aff7" />
   
   
   When a TaskGroup is expanded, each child task renders as its own bar with its own duration. The hatched bar only shows for the group's own aggregate row, or for a nested TaskGroup that's still collapsed — like inner_section_2 above, which stays hatched until it's expanded too.
   
   While putting this screenshot together I also caught and fixed two small rendering seams in the segment/stripe code:
   
   The hatch pattern was restarting from each segment's own local origin, so a group bar split across multiple state segments could show a visible break in the diagonal lines.
   Touching segments (e.g. a queued segment immediately followed by the run) weren't always getting their shared corner squared off, so you'd occasionally see a rounded bump instead of a flat boundary between them.
   
   Both fixes are in the latest push.


-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5516926541

   @jroachgolf84 Good call — pushed a follow-up commit ([6062249](https://github.com/apache/airflow/pull/72435/commits/6062249149)) that drops the "hide entirely" approach in favor of what you suggested: Task Group bars now render with a diagonal hatch overlay instead of disappearing, so the full time span stays visible (no more "missing" chunk) while still being visually distinct from a real, solid task bar.
   
   <img width="1185" height="696" alt="Screenshot 2026-09-03 at 2 54 04 AM" src="https://github.com/user-attachments/assets/785e7625-ecc4-4978-95e3-b18c403fbb43" />
   <img width="1196" height="745" alt="Screenshot 2026-09-03 at 2 53 44 AM" src="https://github.com/user-attachments/assets/0b7b0f3f-b524-4c17-958f-ef4f538238c9" />
   
   Let me know if the stripe angle/spacing/opacity should be tuned, or if you'd rather see it applied without the toggle at all (always-on for Task Group bars).


-- 
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] Add task Group stripes on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5621169088

   Thanks for taking this forward, @pierrejeambrun! Since the diagonal-stripe approach is being implemented fresh in #72894, closing this one out in favor of that. Happy to help review/test #72894 if useful.


-- 
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] Add task Group stripes on the Gantt chart [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed pull request #72435: Add task Group stripes on the Gantt chart
URL: https://github.com/apache/airflow/pull/72435


-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5516570883

   > TBH, I'm not so sure I love this. Now, it looks like there is a significant chunk of "missing" time. I would rather do something like add hatches to the Task Group bar, or something like that.
   
   Thanks for the feedback! That's a fair point — hiding the bar entirely does read as "missing" time. I've reworked it to keep the Task Group bar visible at all times, but render it with a diagonal hatch overlay when the toggle is on, so it's visually distinct as an aggregate rather than an individual task's runtime. Pushing an update now — will share a screenshot shortly. Let me know if that direction works, or if you had something more specific in mind for the hatching.


-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5518386237

   What does it look like when you expand the TaskGroup? Can you share a snip?


-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5515121982

   > Thanks! Could you provide a screenshot of the change?
   
      Sure! Here's before (default, durations shown) and after (toggle enabled, durations hidden):
   <img width="1183" height="728" alt="Screenshot 2026-09-03 at 12 52 17 AM" src="https://github.com/user-attachments/assets/937b6298-99a0-4436-ad14-8d7f431386ee" />
   <img width="1187" height="724" alt="Screenshot 2026-09-03 at 12 52 06 AM" src="https://github.com/user-attachments/assets/69817808-d9d1-4193-82b6-5deb987a7b93" />
   
   


-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #72435:
URL: https://github.com/apache/airflow/pull/72435#discussion_r3949991764


##########
airflow-core/newsfragments/72435.feature.rst:
##########


Review Comment:
   To remove
   



-- 
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] Add task Group stripes on the Gantt chart [airflow]

Posted by "Kunal8954 (via GitHub)" <gi...@apache.org>.
Kunal8954 commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5622691989

   @pierrejeambrun
   Addressed the requested changes in 437e545e0a: removed the newsfragment and restored the unrelated whitespace change. The additional Box is intentionally retained as documented in the reply above.
   


-- 
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] Add toggle to hide Task Group durations on the Gantt chart [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #72435:
URL: https://github.com/apache/airflow/pull/72435#issuecomment-5514269679

   Thanks! Could you provide a screenshot of the change?


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