Commit 1a80ed7
feat(component): [worksheet] add row virtualisation via @tanstack/react-virtual (#1843)
* feat(component): [worksheet] add row virtualisation via @tanstack/react-virtual
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: restore original pnpm-lock.yaml format, keep only @TanStack additions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): use named imports for useMemo and useState in worksheet example
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(component): [worksheet] add coverage tests for virtualisation branches
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(component): [worksheet] remove unreachable null guard, fix lint in tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(component): [worksheet] type manyItems as Partial<Product> to satisfy typecheck
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(docs): [worksheet] pass useMemo and useState into CodePreview scope
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(component): [worksheet] address PR review feedback on virtualization
- Make virtualization opt-in: only active when `height` prop is set
- Move `selectedCells` subscription to `VirtualScrollSync` child component
to avoid re-rendering InternalWorksheet on every cell selection
- Convert `hiddenRows` array lookup to `Set` for O(1) performance
- Return no-op cleanup when ResizeObserver is unavailable
- Use numeric `height` as JSDOM fallback; default to 0 for string heights
- Drop `useMemo` from `renderedRows` (virtualItems changes every render)
- Add DOM assertion that virtualized row count < total item count
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(component): [worksheet] add coverage for VirtualScrollSync scroll effect
Cover the VirtualScrollSync useEffect and scrollToIndex callback by
rendering with a height prop and clicking a cell.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(component): [worksheet] fix prettier formatting in spec
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(component): [worksheet] fix formatting for non-numeric values when copying
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: add changeset for worksheet virtualization minor bump
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 26eb631 commit 1a80ed7
File tree
10 files changed
+602
-253
lines changed- .changeset
- packages
- big-design
- src/components/Worksheet
- Cell
- __snapshots__
- docs/pages
10 files changed
+602
-253
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
Lines changed: 140 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
36 | 66 | | |
37 | 67 | | |
38 | 68 | | |
| |||
65 | 95 | | |
66 | 96 | | |
67 | 97 | | |
| 98 | + | |
68 | 99 | | |
69 | 100 | | |
70 | 101 | | |
71 | 102 | | |
72 | 103 | | |
73 | 104 | | |
| 105 | + | |
74 | 106 | | |
75 | 107 | | |
76 | 108 | | |
| |||
112 | 144 | | |
113 | 145 | | |
114 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
115 | 151 | | |
116 | 152 | | |
117 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
118 | 157 | | |
119 | 158 | | |
120 | 159 | | |
121 | 160 | | |
122 | 161 | | |
123 | 162 | | |
124 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
125 | 224 | | |
126 | 225 | | |
127 | 226 | | |
| |||
201 | 300 | | |
202 | 301 | | |
203 | 302 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
208 | 337 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
213 | 341 | | |
214 | 342 | | |
215 | 343 | | |
| |||
222 | 350 | | |
223 | 351 | | |
224 | 352 | | |
225 | | - | |
| 353 | + | |
226 | 354 | | |
227 | 355 | | |
228 | 356 | | |
| |||
235 | 363 | | |
236 | 364 | | |
237 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
238 | 369 | | |
239 | 370 | | |
240 | 371 | | |
| |||
0 commit comments