Repository navigation
Commit 46ce320
fix(website): resolve the hero's selection summary against the drawn grid
#298 moved the cockpit's selection summary onto the engine's drawn order and
explained at length why nothing else can be correct. #321 migrated the hero to
the `model` prop, dropped `onGridReady` with it, and put the prop-derived
version back. The invariant is now live-broken again, and the guard #298 added
does not catch it.
Filter the hero to Consumer, drag across two adjacent rows and three columns,
and the sidebar reads `9 × 3 selected`. The columns are right; the rows are the
distance between those two holdings in the UNFILTERED book, because the row
order came from this component's locally sorted array while the drawn set is the
filtered one. Rows the user cannot see were counted inside a rectangle they can.
Both orders come off the engine again, via the post-#321 API: `columnLayout` for
the drawn columns (the pre-#321 `getColumns()`/`getSnapshot().visibleRows` pair
is gone) and `range(0, visibleRowCount)` for the drawn rows, mapping group
headers by `groupId` since they sit inside the copied rectangle too.
Why the existing guard stayed green: grouping.spec.ts groups the hero, hits ⌘A
and checks the totals — but grouping swaps the grouped column for the derived
one, so the column total lands on the right number read against either order,
and ⌘A spans everything, so the row total does too. Counts that coincide are not
a test of which order was used. A filter makes the drawn set a strict subset,
which no coincidence covers, so that is what the new smoke test pins.
The local sort path existed only to feed this call site, so it goes: `userSort`,
its model subscription, `sortedRows` and `sortedRowsRef`. `heroGrid/sort.ts` is
left on disk, now unreferenced by the app, pending the separate ranking decision
below.
Verified: website e2e at --workers=1 in both engines against a production build,
99 passed. The one failure, webkit `showcase: scale grid virtualizes`, is
pre-existing — reproduced on this branch's base with these two files reverted.
Not fixed here, found while verifying: #321 also dropped the hero's default
weight-desc ranking. The grid draws arrival order and never re-ranks — measured
live, the visible weights read 16.4, 9.7, 8.2, 5, 4.3, 7, 4.5 (four inversions).
Restoring it means giving the engine the sort, which makes rows re-rank on every
tick, and how much the homepage should churn is a product call, not a drive-by.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 7536e83 commit 46ce320
2 files changed
Lines changed: 78 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | | - | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | | - | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 78 | | |
99 | 79 | | |
100 | 80 | | |
| |||
286 | 266 | | |
287 | 267 | | |
288 | 268 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
298 | 296 | | |
299 | 297 | | |
300 | 298 | | |
| |||
339 | 337 | | |
340 | 338 | | |
341 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
329 | 369 | | |
330 | 370 | | |
331 | 371 | | |
| |||
0 commit comments