Dashboard updates with filter chips#2807
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2807 +/- ##
==========================================
+ Coverage 76.36% 76.42% +0.06%
==========================================
Files 326 326
Lines 23500 23508 +8
Branches 2330 2328 -2
==========================================
+ Hits 17945 17967 +22
+ Misses 5507 5493 -14
Partials 48 48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Statviz dashboard layout and chart sizing to be more responsive (moving several visualizations from fixed pixel widths to fluid "100%" widths), and adjusts default movement date filtering to show a longer time range.
Changes:
- Expanded default movement date range from the last ~3 months to the last 1 year.
- Reworked dashboard/chart layouts to use
SimpleGridand fluid widths ("100%") instead of fixed pixel sizing andWrap. - Simplified
VisHeaderby removingmaxWidthPxhandling and updated visualization components accordingly.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| shared-components/statviz/utils/dashboardFilters.ts | Updates default movement filter start date to 1 year ago. |
| shared-components/statviz/dashboard/Demographics.tsx | Switches demographics dashboard layout from Wrap to SimpleGrid. |
| shared-components/statviz/components/visualizations/stock/StockOverviewRingFilterContainer.tsx | Makes ring chart container fluid by removing wrapper and using width="100%". |
| shared-components/statviz/components/visualizations/stock/StockOverviewRing.tsx | Removes VisHeader max-width constraint usage. |
| shared-components/statviz/components/visualizations/stock/StockOverviewBarsFilterContainer.tsx | Passes fluid width into stock overview bars visualization. |
| shared-components/statviz/components/visualizations/stock/StockOverviewBars.tsx | Removes VisHeader max-width constraint usage. |
| shared-components/statviz/components/visualizations/movedBoxes/ShipmentsPieChart.tsx | Converts pie chart width to fluid and removes VisHeader max-width constraint usage. |
| shared-components/statviz/components/visualizations/movedBoxes/ShipmentsOverTimeChart.tsx | Converts line chart to fluid width and adjusts height; removes VisHeader max-width constraint usage. |
| shared-components/statviz/components/visualizations/movedBoxes/MovedBoxesCharts.tsx | Replaces Wrap layout with SimpleGrid and makes Sankey fluid width. |
| shared-components/statviz/components/visualizations/movedBoxes/BoxFlowSankey.tsx | Removes VisHeader max-width constraint usage. |
| shared-components/statviz/components/visualizations/demographic/DemographicPyramid.tsx | Updates pyramid chart sizing types and removes extra container styling. |
| shared-components/statviz/components/visualizations/demographic/DemographicCharts.tsx | Updates pyramid chart props to pass fluid width. |
| shared-components/statviz/components/visualizations/demographic/BeneficiaryReachChart.tsx | Converts reach bar chart width to fluid and tweaks filter control alignment. |
| shared-components/statviz/components/visualizations/demographic/BeneficiaryFiguresCards.tsx | Adjusts grid columns for beneficiary insight cards. |
| shared-components/statviz/components/visualizations/createdBoxes/BoxCreationCalendarFilterContainer.tsx | Makes calendar chart fluid width and increases height. |
| shared-components/statviz/components/visualizations/createdBoxes/BoxCreationCalendar.tsx | Removes VisHeader max-width constraint usage. |
| shared-components/statviz/components/VisHeader.tsx | Removes maxWidthPx prop and max-width logic from header. |
| shared-components/statviz/components/nivo/SankeyChart.tsx | Adds handling for percent widths by using a fallback width for scaling. |
| shared-components/statviz/components/nivo/PieChart.tsx | Adds handling for percent widths and adjusts center label rendering. |
| shared-components/statviz/components/nivo/LineChart.tsx | Adds handling for percent widths by using a fallback width for scaling. |
| shared-components/statviz/components/nivo/BarChart.tsx | Adjusts margins for percent widths (but still parses "100%" as 100 for theme scaling). |
| shared-components/statviz/components/custom-graphs/BarChartCenterAxis.tsx | Adds fluid width support via ParentSize and updates sizing calculations. |
| if (chart.centerData) { | ||
| const y = (height - margin.top - margin.bottom) / 1.8; | ||
| const x = (width - margin.right - margin.left) / 2; | ||
| const x = width - margin.right - margin.left; |
|
@copilot I need you to add one FilterChips element to each of the three sections (StockOverview, MovedBoxes, BeneOverview) of the Dashboard, corresponding to the filters applied via StockFilters/MovementFilters/BeneficiaryFilters. Use the approach as in front/src/views/*FilterChips.tsx. The filter chips should be placed in the same row as the resp. filter action, aligned to the left. |
Co-authored-by: pylipp <10617122+pylipp@users.noreply.github.com>
Implemented in commit 0530836. Added filter chips to StockOverview, Movement History, and Beneficiary Overview, wired to the applied filters from StockFilters/MovementFilters/BeneficiaryFilters, and placed the chips in the same action row aligned to the left. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 33 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (1)
shared-components/statviz/components/filter/BeneficiaryFilters.tsx:29
- The component was renamed to
BeneficiaryFilters, but the props interface is still namedDemographicsFiltersProps. Renaming the interface as well keeps naming consistent and avoids confusion when importing/reading this file.
| if (chart.centerData) { | ||
| const y = (height - margin.top - margin.bottom) / 1.8; | ||
| const x = (width - margin.right - margin.left) / 2; | ||
| const x = width - margin.right - margin.left; |
pylipp
left a comment
There was a problem hiding this comment.
For a bit of refactoring
| import type { ITagOption, BeneficiaryAppliedFilters } from "../../utils/dashboardFilters"; | ||
| import { AGE_RANGES } from "../../utils/dashboardFilters"; | ||
|
|
||
| const HUMAN_GENDERS = ["Male", "Female", "Diverse"] as const; |
| >; | ||
| import { BeneficiaryReachData } from "../../../../../graphql/types"; | ||
|
|
||
| const AGE_GROUP_COLORS: Record<string, string> = { |
https://trello.com/c/Hd8yfFuD
This PR updates the Statviz dashboard responsiveness and filtering UX. In addition to the layout/chart sizing updates and default movement date range change, it now adds filter chips to the three dashboard sections (Stock Overview, Movement History, Beneficiary Overview), aligned left in the same row as each section’s filter action. The chips reflect applied filters, support per-chip removal, and include a clear-all action.