Skip to content

Commit e8c5134

Browse files
committed
deps and notes POC work for filter panel
1 parent e517fde commit e8c5134

3 files changed

Lines changed: 95 additions & 18 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@cfpb/cfpb-design-system": "^5.8.1",
15-
"@cfpb/design-system-react": "^2.0.1",
14+
"@cfpb/cfpb-design-system": "^5.10",
15+
"@cfpb/design-system-react": "^2.0.3",
1616
"lit": "^3.3.3",
1717
"react": "^19.2.8",
1818
"react-dom": "^19.2.8",
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# explorer filter panel notes
2+
3+
trying to get Explorer's sidebar to look like CCDB. not extracting anything into DSR yet — everybody keeps copy/pasting this thing and we might share it later, but not this round.
4+
5+
CCDB is public: https://github.com/cfpb/ccdb5-ui
6+
look under `src/components/filters/`
7+
8+
don't grab the redux, the aggregations, or the complaint field names. explorer can keep its own state. just the chrome.
9+
10+
also this is NOT the ds "filterable list control panel" (the one at the top of the page with apply/clear and the 3 columns). that's `o-filterable-list-controls`. different animal. ccdb is the sidebar well with checkboxes and counts.
11+
12+
## files i kept looking at
13+
14+
`filter-panel/filter-panel.js` + scss
15+
- `.filter-panel.o-well`
16+
- "Filter results by..."
17+
- hrs between sections
18+
- close button on small screens
19+
- scss has the well border hacks and the padding against the hrs. worth a look.
20+
21+
`filter-panel/filter-panel-toggle.js`
22+
- "Filter results" / "Close filters" when it's skinny. we probably want something like this if explorer doesn't have it.
23+
24+
`collapsible-filter/collapsible-filter.tsx`
25+
- expandable without the box around it
26+
- starts OPEN
27+
- plus/minus round icons
28+
- aria-label is like "Collapse Product filter"
29+
30+
don't use DSR Expandable for these. it slaps on background + border unless you pass inAccordion, and it calls `CFPB_Expandable.init()` which is a pain with react. ccdb rolled their own on purpose.
31+
32+
`aggregation/aggregation-item/aggregation-item.js`
33+
- leaf row: DSR Checkbox + label + the count on the right
34+
- we just switched this over from a raw input. dsr 2.0.3.
35+
36+
`aggregation/aggregation-branch/aggregation-branch.js`
37+
- parent checkbox + a SEPARATE button for the name/count/caret
38+
- clicking the checkbox should not open the kids
39+
- `isIndeterminate` when only some children are on
40+
41+
`aggregation/aggregation.scss`
42+
- gray lines between rows
43+
- count parked on the right
44+
- nested list is `ul.children` with a bit of indent
45+
46+
`more-or-less/more-or-less.js`
47+
- shows 5 then "+ Show N more". skip if explorer doesn't truncate.
48+
49+
dates / zip / company typeahead = app stuff. only steal the layout if explorer actually has the same control.
50+
51+
## checkboxes
52+
53+
dsr 2.0.3 has `isIndeterminate` on Checkbox now. use that.
54+
55+
how ccdb does parent/child:
56+
- all kids on → parent checked
57+
- some kids on → mixed / indeterminate
58+
- none → off
59+
- check parent → select parent key, drop the child keys
60+
- uncheck → wipe parent and kids
61+
62+
leaf rows: accessible name should be whatever's on screen. we used to aria-label the raw key and it was dumb ("TX" instead of "Texas (TX)").
63+
64+
parents: hide the checkbox label text (`u-visually-hidden`) since the button next to it already says the name. still needs a name for at.
65+
66+
## visually
67+
68+
sidebar is a well. heading. hrs between chunks (margin 0 on the hr, padding lives on the sections). expandables open. plus/minus. counts gray, right aligned. nested ones have the caret. rule lines. maybe show more after 5. mobile toggle.
69+
70+
## before i start ripping explorer apart
71+
72+
- where's their filter sidebar vs the files above
73+
- what's actually different (well? hrs? default open? counts? caret vs checkbox? more/less? mobile?)
74+
- what's just markup vs wired to their api
75+
- anything explorer has that ccdb doesn't (apply button etc) — don't delete that without thinking
76+
77+
no shared FilterPanel component. not yet.

yarn.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,28 +114,28 @@ __metadata:
114114
languageName: node
115115
linkType: hard
116116

117-
"@cfpb/cfpb-design-system@npm:^5.8.1":
118-
version: 5.8.1
119-
resolution: "@cfpb/cfpb-design-system@npm:5.8.1"
117+
"@cfpb/cfpb-design-system@npm:^5.10":
118+
version: 5.10.0
119+
resolution: "@cfpb/cfpb-design-system@npm:5.10.0"
120120
dependencies:
121-
"@fontsource-variable/source-sans-3": "npm:5.2.9"
121+
"@fontsource-variable/source-sans-3": "npm:5.3.0"
122122
lit: "npm:3.3.3"
123123
tippy.js: "npm:6.3.7"
124-
checksum: 10/1bef5d53c3140ceaf28994c38ddc3a70f5c230cdb3922d91d147627639eb85b0e82cb109ae54e6ae49b2cf8b4be0febb06c643fe1388458c911863305e272cad
124+
checksum: 10/7f2d76ef1ba0d910595e92efd9e9a8f263e9fa45278152d24e2671d906dd1a9ed05dc8e64cbee614ebbd5a728948ec1d21f4556fe9129bb920642e7dbe726c84
125125
languageName: node
126126
linkType: hard
127127

128-
"@cfpb/design-system-react@npm:^2.0.1":
129-
version: 2.0.1
130-
resolution: "@cfpb/design-system-react@npm:2.0.1"
128+
"@cfpb/design-system-react@npm:^2.0.3":
129+
version: 2.0.3
130+
resolution: "@cfpb/design-system-react@npm:2.0.3"
131131
dependencies:
132132
react-select: "npm:^5.10.2"
133133
peerDependencies:
134-
"@cfpb/cfpb-design-system": 5.8.1
134+
"@cfpb/cfpb-design-system": 5.10.0
135135
lit: ^3.3.3
136136
react: ^19.2.8
137137
react-dom: ^19.2.8
138-
checksum: 10/f376e122c60509d26b328bde75e4ee6a61e851ec1652daa925ac07cf80973cbef71295ab5868f67b6317f9d34e4ada0e99ec8e70dca57149b1c2359f37cd6ad2
138+
checksum: 10/17a8145e805e218805fba7de097890225cd29192f569024386296d6f8024fa634176934dbd30d62fe4df9382084a40dcfeb69597caa179b6a7b095c01deadae7
139139
languageName: node
140140
linkType: hard
141141

@@ -310,10 +310,10 @@ __metadata:
310310
languageName: node
311311
linkType: hard
312312

313-
"@fontsource-variable/source-sans-3@npm:5.2.9":
314-
version: 5.2.9
315-
resolution: "@fontsource-variable/source-sans-3@npm:5.2.9"
316-
checksum: 10/fa48c295cc37cda0ab9bcf08b5e37d156c39fa09cd3caac41bd1cbec6b6b134858ec779ce40aa9be3af8c7970142498896404f4e5a188b3dc17b670fcd8c34c8
313+
"@fontsource-variable/source-sans-3@npm:5.3.0":
314+
version: 5.3.0
315+
resolution: "@fontsource-variable/source-sans-3@npm:5.3.0"
316+
checksum: 10/0b5194594af68be1e9519fbbfa5646a7b825e5ea24e730e8704fab13771fd76181a74fe800383cc3c34d8283cfb0e43b285437eb9297c2113b287ad14fadbd0a
317317
languageName: node
318318
linkType: hard
319319

@@ -827,8 +827,8 @@ __metadata:
827827
version: 0.0.0-use.local
828828
resolution: "dsr-test@workspace:."
829829
dependencies:
830-
"@cfpb/cfpb-design-system": "npm:^5.8.1"
831-
"@cfpb/design-system-react": "npm:^2.0.1"
830+
"@cfpb/cfpb-design-system": "npm:^5.10"
831+
"@cfpb/design-system-react": "npm:^2.0.3"
832832
"@types/node": "npm:^24.13.2"
833833
"@types/react": "npm:^19.2.17"
834834
"@types/react-dom": "npm:^19.2.3"

0 commit comments

Comments
 (0)