Skip to content

Groups: show filter-aware count and percentage on group rows#2095

Open
filipvnencak wants to merge 2 commits into
developfrom
2083-Groups-Show-summaries-counts-on-groups
Open

Groups: show filter-aware count and percentage on group rows#2095
filipvnencak wants to merge 2 commits into
developfrom
2083-Groups-Show-summaries-counts-on-groups

Conversation

@filipvnencak

Copy link
Copy Markdown
Collaborator

Description of changes

Group rows now show a filter-aware count and percentage of total when grouping by status, type, assignees, tags, or an enum attribute. No PowerPack license required.

Technical details

  • New useGroupCounts hook: one distribution stats call for the grouped field, reusing the footer cache (no duplicate fetch, no license).
  • Counts overlaid in useBuildGroupByTableData; GroupHeaderWidget renders count (pct%); Ungrouped uses valueNotFilledCount with remainder %.
  • Wired on Overview + Versions/Products. Free-text fields (no distribution) show count only; folder/hierarchy out of scope.

Additional context

Closes #2083

@filipvnencak filipvnencak requested a review from Copilot June 24, 2026 12:59
@filipvnencak filipvnencak self-assigned this Jun 24, 2026
@filipvnencak filipvnencak added the type: enhancement Improvement of existing functionality or minor addition label Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds filter-aware per-group counts (and percentages of the filtered total) to grouped table rows, using the existing column-stats distribution data so the UI can show correct summaries under active filters without requiring a PowerPack license.

Changes:

  • Introduces a useGroupCounts hook that requests a single distribution target for the active group-by field and derives per-group counts/percentages.
  • Plumbs groupCounts through ProjectTableProvider and overlays stats onto group rows in useBuildGroupByTableData; GroupHeaderWidget renders count (pct%).
  • Wires the feature into Project Overview (tasks) and Versions/Products (versions) table providers; adds API helpers to map group-by to stats targets and select counts from fieldStats.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/pages/VersionsProductsPage/providers/VPProjectTableProvider.tsx Fetches version group counts for the active grouping and passes them into ProjectTableProvider.
src/pages/ProjectOverviewPage/providers/ProjectOverviewTableProvider.tsx Fetches task group counts under current filters/selection and passes them into ProjectTableProvider.
shared/src/containers/ProjectTreeTable/widgets/GroupHeaderWidget.tsx Displays group count and optional percentage on group header rows.
shared/src/containers/ProjectTreeTable/hooks/useGroupCounts.ts New hook to query column stats for the grouped field and expose a GroupCountsMap.
shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.ts Overlays filter-aware counts/percentages onto group row metadata (including Ungrouped).
shared/src/containers/ProjectTreeTable/hooks/index.ts Re-exports the new useGroupCounts hook.
shared/src/containers/ProjectTreeTable/context/ProjectTableProvider.tsx Accepts/passes groupCounts into grouping builder and adds it to memo dependencies.
shared/src/containers/ProjectTreeTable/buildTreeTableColumns.tsx Passes the new percentage field into GroupHeaderWidget.
shared/src/api/queries/columnStats/index.ts Re-exports new group-count helper utilities.
shared/src/api/queries/columnStats/groupCounts.ts Adds groupByToStatsTarget + selectGroupCounts helpers for deriving per-group counts/percentages.

Comment on lines 249 to 252
const groupedTableData = useMemo(
() => !!effectiveGroupBy && buildGroupByTableData(effectiveGroupBy),
[effectiveGroupBy, entitiesMap, groups],
[effectiveGroupBy, entitiesMap, groups, groupCounts],
)
Comment thread shared/src/api/queries/columnStats/groupCounts.ts
@filipvnencak filipvnencak requested a review from Innders June 24, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Groups: Show summaries counts on groups

2 participants