perf: virtualize the notification list - #3319
fmguerreiro wants to merge 1 commit into
Conversation
|
I've faced this freezing issue this week too; it might have been a recently introduced bug. |
|
In fact, the freezing was probably what you fixed in |
Shall we pull this out to a separate PR |
One repository can hold hundreds of notifications, so accounts, repository groups and rows are flattened into a single item sequence and windowed across group boundaries. Headers no longer own their rows, so collapse and exit-animation state moves up to the list and survives rows unmounting on scroll.
3586fe1 to
8a4f5bc
Compare
|
pulled the cache write fix out to #3320, that one is the mark-as-read freeze. for trying out LegendList, benched both on the same 1274-notification list: happy to swap, one catch: legend measures nothing in happy-dom, no layout and its ResizeObserver never fires, so the list renders zero rows there. the windowing tests would have to move to a real browser. ok with that? |
|
Thanks @fmguerreiro. I'd be leaning to keeping within the tanstack family for "simplicity". It's a positive improvement from current state |
Every row in the inbox mounts, so a large inbox paints tens of thousands of DOM nodes and re-renders all of them on each poll.
Virtualizes the list. Accounts, groups and rows flatten into one sequence, so one virtualizer windows across group boundaries. Rows unmount on scroll, so collapse and exit-animation state moved up to
NotificationList; headers split out asAccountHeaderandRepositoryHeader.Row heights are estimated, then corrected by measurement, so the scrollbar settles while scrolling.
The cache write fix that was the first commit here is now #3320.