Groups: show filter-aware count and percentage on group rows#2095
Open
filipvnencak wants to merge 2 commits into
Open
Groups: show filter-aware count and percentage on group rows#2095filipvnencak wants to merge 2 commits into
filipvnencak wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
useGroupCountshook that requests a single distribution target for the active group-by field and derives per-group counts/percentages. - Plumbs
groupCountsthroughProjectTableProviderand overlays stats onto group rows inuseBuildGroupByTableData;GroupHeaderWidgetrenderscount (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], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
useGroupCountshook: one distribution stats call for the grouped field, reusing the footer cache (no duplicate fetch, no license).useBuildGroupByTableData;GroupHeaderWidgetrenderscount (pct%); Ungrouped usesvalueNotFilledCountwith remainder %.Additional context
Closes #2083