Skip to content

Add task Group stripes on the Gantt chart - #72435

Closed
Kunal8954 wants to merge 9 commits into
apache:mainfrom
Kunal8954:feat/gantt-hide-taskgroup-durations
Closed

Kunal8954 wants to merge 9 commits into
apache:mainfrom
Kunal8954:feat/gantt-hide-taskgroup-durations

Conversation

@Kunal8954

Copy link
Copy Markdown
Contributor

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.

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.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh

TaskGroups render on the Gantt chart as a single aggregate bar spanning
from the earliest child start to the latest child end. When the actual
task work inside the group is short, that envelope still reads as one
very long-running task, making the chart hard to interpret.

Add a "Hide Task Group Durations" switch (Gantt view -> Options) that
drops the aggregate bar for TaskGroup rows while keeping the row itself
in place, so grouping is still visible for organizing the chart. The
setting persists via localStorage, matching the existing
"All Dag Dependencies" toggle.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh
Kunal8954 and others added 3 commits September 2, 2026 19:32
xcoms.spec.ts's filter tests locate the active filter pill's input via
page.locator("div").filter({ hasText: `${filterName}:` }), which
matches any ancestor whose descendant text contains that string.
apache#71554 restructured the filter bar's DOM so more than one ancestor now
matches, and .first() no longer reliably picks the actual pill -
getByRole("textbox") on it resolves to every textbox inside whichever
div wins, throwing "resolved to 12 elements instead of 1".

Give the actively-editing pill's input a stable data-testid
(filter-pill-input) instead of relying on ancestor text matching, and
scope XComsPage.applyFilter() to it directly. Only one pill is ever in
edit mode at a time, so the testid alone is enough - no per-filter key
plumbing needed.

Added a FilterBar test that fails without the fix (verified locally by
reverting the testid and confirming the new test - and only that
test - breaks).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015kAvbZ6SeKgp6jbGcvpXSh
@bbovenzi

bbovenzi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Thanks! Could you provide a screenshot of the change?

@Kunal8954

Copy link
Copy Markdown
Contributor Author

Thanks! Could you provide a screenshot of the change?

Sure! Here's before (default, durations shown) and after (toggle enabled, durations hidden):
Screenshot 2026-09-03 at 12 52 17 AM
Screenshot 2026-09-03 at 12 52 06 AM

@jroachgolf84

Copy link
Copy Markdown
Collaborator

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.

@Kunal8954

Copy link
Copy Markdown
Contributor Author

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.

@jroachgolf84 pointed out that dropping the Task Group's aggregate bar
entirely made it look like a chunk of time was missing. Overlay a
diagonal hatch pattern on the bar instead, so the full envelope span
stays visible while still reading as an aggregate rather than a real,
individual task's runtime.
@Kunal8954

Copy link
Copy Markdown
Contributor Author

@jroachgolf84 Good call — pushed a follow-up commit (6062249) 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.

Screenshot 2026-09-03 at 2 54 04 AM Screenshot 2026-09-03 at 2 53 44 AM

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

@jroachgolf84

Copy link
Copy Markdown
Collaborator

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

@Kunal8954

Copy link
Copy Markdown
Contributor Author

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

Sure — here's what it looks like expanded:

Screenshot 2026-09-03 at 7 26 17 AM

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.

- Anchor the Task Group hatch pattern to the row's left edge instead
  of each segment's own local origin, so a group bar split across
  multiple state segments tiles into one continuous diagonal pattern
  instead of the stripes breaking at each segment boundary.
- Treat segments as touching based on real time-adjacency, not only
  a matching try number, so a queued segment immediately followed by
  its execution segment renders with a flat merged edge instead of a
  rounded bump at the seam.

@pierrejeambrun pierrejeambrun left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the pull request.

Since task group are now displayed with stripes, can you remove the code relative to the toggle please or rename the toggle to something like "Mark task groups duration as Aggregates".

Please keep the change limited to the issue you are trying to fix. Extract unrelated code change (bug fixes) to another PR.

Kunal8954 and others added 2 commits September 7, 2026 18:54
Remove the redundant Task Group duration toggle now that aggregate bars use hatching, and keep unrelated XCom test changes out of this pull request.\n\nCo-authored-by: Copilot <[email protected]>
Keep the UI static checks clean so the pull request can pass validation.

Co-authored-by: Copilot <[email protected]>
@pierrejeambrun pierrejeambrun changed the title Add toggle to hide Task Group durations on the Gantt chart Add task Group stripes on the Gantt chart Sep 10, 2026
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.2 milestone Sep 10, 2026
@Kunal8954

Copy link
Copy Markdown
Contributor Author

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.

@pierrejeambrun pierrejeambrun left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few comments. I'm opening an alternative #72894 that should supersede.

But you can recycle this one to fixing the other issues mentioned in this PR.

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.

I didn't observe this on my PR, but you can rebase this one of top of mine and see if this piece is still needed.

@@ -0,0 +1 @@
Add a toggle to hide Task Group durations on the Gantt chart.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To remove

`version_indicator_display_mode`,
VersionIndicatorOptions.ALL,
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

?

Unrelated remove please.

)}
</Badge>
{node.isGroup === true ? (
<Box

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why an extra box?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

The newsfragment no longer describes what the PR does after the approach
switched from a hide-duration toggle to stripe overlays, so it is removed
rather than rewritten. The whitespace-only change to DetailsLayout is
unrelated to the Gantt feature and is reverted to keep the diff focused.
@Kunal8954

Copy link
Copy Markdown
Contributor Author

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

@pierrejeambrun pierrejeambrun left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks,

Closing in favor of #72894 which was merged.

Feel free to open another PR if you feel like a follow up on the gantt chart is needed to fixed other unrelated issues you mentioned earlier in the PR.

While putting this screenshot together I also caught and fixed two small rendering seams in the segment/stripe code:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:translations area:UI Related to UI/UX. For Frontend Developers. translation:default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DAG Gantt chart taskgroup toggle

6 participants