Commit 2729ce2
authored
VideoPress: Replace custom Checkbox with CheckboxControl, fix invisible filter/privacy checkboxes (#48175)
* VideoPress: Swap site-settings privacy toggle to CheckboxControl
The Video Privacy toggle at the bottom of the VideoPress dashboard was using the local CheckboxCheckmark wrapper around a custom-styled checkbox that relied on a ::before pseudo-element for its visible box but never defined background/border, leaving the control blank on top of any cascade that didn't paint a default. Replace it with WP's @wordpress/components CheckboxControl for native rendering and accessibility, and move the component-local layout rule (margin-top for spacing under the Settings heading) into its own style.module.scss alongside the consumer.
Also routes the existing disabledReason copy through CheckboxControl's `help` prop.
* VideoPress: Remove unused custom Checkbox component and dead selection UI
Now that the site-settings privacy toggle uses @wordpress/components CheckboxControl directly, the local Checkbox component is only used by:
- video-filter's CheckboxCheckmark (filter panel on the library page)
- video-list / video-row "select all" + per-row selection checkboxes, both permanently gated behind a hardcoded `showCheckbox = false` with a `// TODO: implement bulk actions` note — never rendered in the current UI
Migrate CheckboxCheckmark to CheckboxControl and delete the list/row selection plumbing entirely, then remove the components/checkbox/ directory (component, styles, stories, tests, types).
video-filter:
- CheckboxCheckmark now renders CheckboxControl with a .filter-checkbox class that adds `padding-top: var(--spacing-base)` for vertical rhythm between filter options.
- Drop the `for` and `disabledReason` props plus the internal DisabledReasonTooltip — neither was actually used by any call site.
- Remove now-dead `.filters-section .checkbox-container:last-child` and `.title-adornment` rules.
video-list:
- Remove `selected` / `setSelected` state, `allSelected`, `handleAll`, and the `showCheckbox = false` constant from both VideoList and LocalVideoList.
- Drop the select-all header checkbox and stop passing `checked` / `onSelect` / `showCheckbox` through to the row components.
video-row:
- Drop the CheckboxControl render block + wrapper div.
- Drop `checked`, `onSelect`, `showCheckbox` props from the signature and the VideoRowProps type.
- Drop the row-level keyboard/click handling that only existed to toggle the (never-rendered) checkbox: `role=button`, `tabIndex`, `aria-label`, `onKeyDown`, `onKeyUp`, `keyPressed` state, `handleKeyDown`/`handleKeyUp`/`handleClick`/`isSpaceOrEnter`.
- Simplify `handleInfoWrapperClick` to only toggle mobile expansion.
- Remove the orphan `.checkbox-wrapper-small` SCSS rule (`.pressed` stays — still used by video-row/error.tsx).
Net: ~377 lines of dead code gone, no visible UI change.
* changelog: Add entries for VideoPress checkbox cleanup1 parent 2ddb7d5 commit 2729ce2
15 files changed
Lines changed: 26 additions & 392 deletions
File tree
- projects/packages/videopress
- changelog
- src/client/admin/components
- checkbox
- stories
- test
- site-settings-section
- video-filter
- video-list
- video-row
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 0 additions & 93 deletions
This file was deleted.
Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 6 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| |||
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 55 | | |
68 | 56 | | |
69 | | - | |
70 | 57 | | |
71 | 58 | | |
72 | | - | |
73 | 59 | | |
74 | 60 | | |
75 | 61 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
81 | 65 | | |
82 | 66 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 67 | + | |
| 68 | + | |
87 | 69 | | |
88 | 70 | | |
89 | 71 | | |
| |||
117 | 99 | | |
118 | 100 | | |
119 | 101 | | |
120 | | - | |
121 | 102 | | |
122 | 103 | | |
123 | 104 | | |
| |||
131 | 112 | | |
132 | 113 | | |
133 | 114 | | |
134 | | - | |
135 | 115 | | |
136 | 116 | | |
137 | 117 | | |
| |||
146 | 126 | | |
147 | 127 | | |
148 | 128 | | |
149 | | - | |
150 | 129 | | |
151 | 130 | | |
152 | 131 | | |
| |||
167 | 146 | | |
168 | 147 | | |
169 | 148 | | |
170 | | - | |
171 | 149 | | |
172 | 150 | | |
173 | 151 | | |
174 | 152 | | |
175 | 153 | | |
176 | | - | |
177 | 154 | | |
178 | 155 | | |
179 | 156 | | |
180 | 157 | | |
181 | 158 | | |
182 | 159 | | |
183 | 160 | | |
184 | | - | |
185 | 161 | | |
186 | 162 | | |
187 | 163 | | |
| |||
0 commit comments