Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bdd53a0
Move CreatedBoxes component into CreatedBoxesFilterContainer
pylipp Jun 15, 2026
9752174
Remove StockOverview from Dashboard
pylipp Jun 15, 2026
e59def1
Update section titles
pylipp Jun 15, 2026
dfd81d6
Remove unneeded components
pylipp Jun 15, 2026
227d28c
Remove StockOverview
pylipp Jun 22, 2026
379dc26
Merge remote-tracking branch 'origin/master' into dashboard-redesign
pylipp Jun 22, 2026
86fb76e
Rework statviz filtering: per-section local state, staged Apply, URL …
Copilot Jun 22, 2026
1488a2f
refactor: use FilterPanel + *Filters pattern in statviz, move control…
Copilot Jun 22, 2026
ceef657
Avoid extra code by using FilterPanel directly
pylipp Jun 22, 2026
f47e86e
align
pylipp Jun 22, 2026
0099520
feat: add StockOverviewRing pie chart and fix react-icons dependency
Copilot Jun 22, 2026
409ca8b
feat: add user-controlled grouping dimension to StockOverviewRing
Copilot Jun 23, 2026
4e57ff0
time-select-size
pylipp Jun 22, 2026
a55591c
pie-visuals
pylipp Jun 23, 2026
6f1b938
Align multiple graphs
pylipp Jun 23, 2026
f6df2ac
show-share-link-action
pylipp Jun 23, 2026
00a6ca8
Replace StockDataFilter with StockOverviewRingFilterContainer in shar…
Copilot Jun 23, 2026
586d493
Infer appliedFilters from URL params in shared-front/App.tsx
Copilot Jun 23, 2026
4835556
no-spinner
pylipp Jun 23, 2026
86864db
Remove unused code
pylipp Jun 25, 2026
ed04a19
format
pylipp Jun 25, 2026
538559e
import
pylipp Jun 25, 2026
60f1a7e
filterpanel
pylipp Jun 25, 2026
db3429e
appliedFilters-deps
pylipp Jun 25, 2026
84d7fbc
remove-more
pylipp Jun 25, 2026
2d272dd
reactive-vars
pylipp Jun 25, 2026
8a717cd
Merge remote-tracking branch 'origin/master' into dashboard-redesign
pylipp Jun 25, 2026
688c938
Remove FilterPanel
pylipp Jun 25, 2026
656c747
deduplicate
pylipp Jun 25, 2026
e00689c
move-stock-query
pylipp Jun 25, 2026
8016331
format
pylipp Jun 25, 2026
bbeb221
correct-url-param
pylipp Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"jotai": "^2.20.0",
"react-big-calendar": "^1.20.0",
"react-csv": "^2.2.2",
"react-icons": "^5.6.0",
"react-joyride": "^3.1.0",
"react-table": "^7.8.0",
"regenerator-runtime": "^0.14.1",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"react": "^18.3.1",
"react-dom": "^18.2.0",
"react-hook-form": "^7.62.0",
"react-icons": "^5.6.0",
"react-router-dom": "^6.30.4",
"zod": "^4.4.3"
},
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions shared-components/statviz/components/filter/DemographicsFilters.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import { useCallback, useEffect, useState } from "react";
import {
VStack,
Button,
SimpleGrid,
Box,
CheckboxGroup,
Checkbox,
HStack,
FormLabel,
} from "@chakra-ui/react";
import TabbedTagDropdown from "./TabbedTagDropdown";
import type { ITagOption, DemographicsAppliedFilters } from "../../utils/dashboardFilters";
import { AGE_RANGES } from "../../utils/dashboardFilters";

const HUMAN_GENDERS = ["Male", "Female", "Diverse"] as const;

interface DemographicsFiltersProps {
isOpen: boolean;
onClose: () => void;
appliedFilters: DemographicsAppliedFilters;
tags: ITagOption[];
onApply: (filters: DemographicsAppliedFilters) => void;
}

export function DemographicsFilters({
isOpen,
onClose,
appliedFilters,
tags,
onApply,
}: DemographicsFiltersProps) {
const [staged, setStaged] = useState<DemographicsAppliedFilters>(appliedFilters);

useEffect(() => {
if (isOpen) {
setStaged(appliedFilters);
}
}, [isOpen, appliedFilters]);

const handleApply = useCallback(() => {
onApply(staged);
onClose();
}, [staged, onApply, onClose]);

const handleClear = useCallback(() => {
setStaged({ ageRanges: [], genders: [], includedTags: [], excludedTags: [] });
}, []);

return (
<VStack spacing={4} align="stretch">
<SimpleGrid columns={1} spacing={4}>
<Box>
<FormLabel mb={2}>Age</FormLabel>
<CheckboxGroup
value={staged.ageRanges}
onChange={(values) => setStaged((prev) => ({ ...prev, ageRanges: values as string[] }))}
>
<HStack spacing={4} flexWrap="wrap">
{AGE_RANGES.map((range) => (
<Checkbox key={range.label} value={range.label}>
{range.label}
</Checkbox>
))}
</HStack>
</CheckboxGroup>
</Box>
<Box>
<FormLabel mb={2}>Gender</FormLabel>
<CheckboxGroup
value={staged.genders}
onChange={(values) => setStaged((prev) => ({ ...prev, genders: values as string[] }))}
>
<HStack spacing={4}>
{HUMAN_GENDERS.map((gender) => (
<Checkbox key={gender} value={gender}>
{gender}
</Checkbox>
))}
</HStack>
</CheckboxGroup>
</Box>
<Box>
<FormLabel mb={2}>Tags</FormLabel>
<TabbedTagDropdown
availableTags={tags}
includedTags={staged.includedTags}
excludedTags={staged.excludedTags}
onIncludedChange={(newTags) =>
setStaged((prev) => ({ ...prev, includedTags: newTags }))
}
onExcludedChange={(newTags) =>
setStaged((prev) => ({ ...prev, excludedTags: newTags }))
}
onClearAll={() =>
setStaged((prev) => ({ ...prev, includedTags: [], excludedTags: [] }))
}
placeholder="Select tags"
/>
</Box>
</SimpleGrid>
<Box pt={4}>
<VStack spacing={3}>
<Button
colorScheme="blue"
onClick={handleApply}
width="100%"
data-testid="demographics-filter-apply"
>
Apply
</Button>
<Button
variant="outline"
onClick={handleClear}
width="100%"
data-testid="demographics-filter-clear"
>
Clear filters
</Button>
</VStack>
</Box>
</VStack>
);
}
52 changes: 52 additions & 0 deletions shared-components/statviz/components/filter/FilterPanel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { ReactNode } from "react";
import {
Drawer,
DrawerBody,
DrawerCloseButton,
DrawerContent,
DrawerHeader,
DrawerOverlay,
IconButton,
useBreakpointValue,
} from "@chakra-ui/react";
import { MdFilterList } from "react-icons/md";

interface FilterPanelProps {
label?: string;
isOpen: boolean;
onOpen: () => void;
onClose: () => void;
children: ReactNode;
}

export function FilterPanel({
label = "Filters",
isOpen,
onOpen,
onClose,
children,
}: FilterPanelProps) {
const placement = useBreakpointValue({ base: "left" as const, md: "right" as const }) ?? "right";
const size = useBreakpointValue({ base: undefined, md: "md" });
const maxW = useBreakpointValue({ base: "90vw", md: undefined });

return (
<>
<IconButton
icon={<MdFilterList color={"black"} size={25} />}
aria-label="Open ${label}"
size="md"
data-testid="${label.replaceAll(' ', '').lower()}-drawer-button"
onClick={onOpen}
Comment thread
pylipp marked this conversation as resolved.
Outdated
/>
<Drawer isOpen={isOpen} onClose={onClose} placement={placement} size={size}>
<DrawerOverlay />
<DrawerContent maxW={maxW}>
<DrawerHeader>{label}</DrawerHeader>
<DrawerCloseButton />
<DrawerBody>{children}</DrawerBody>
</DrawerContent>
</Drawer>
</>
);
}
Loading
Loading