fix(collections): all saved reads its lists four at a time and reloads once per burst of updates

The "All saved" view read every list in full at the same time, and every
collections:* websocket event started that again right away. An agent saving
places one by one over MCP sends one event per place, so an open collections
tab stacked up full reads of every list on the server.

The union now goes through the same batched loader the trip's saved-places
picker uses (four lists at a time), reloads asked for while it runs fold into
one more pass, and a list or union read that lands after the user switched to
something else is dropped instead of painting its places over the new view.
The page waits for a run of events to settle before it reloads and keeps the
selection on "All saved" like it already did on a single list. Desktop and
phone share useCollections, so both get it.

Refs #2559
This commit is contained in:
Maurice
2026-10-12 12:59:44 +02:00
parent 2f0b867685
commit 8acc035efa
7 changed files with 264 additions and 49 deletions
+2 -2
View File
@@ -5,7 +5,7 @@
"no-console": 88,
"complexity": 231,
"@typescript-eslint/no-explicit-any": 148,
"trek/no-swallowed-catch": 135,
"trek/no-swallowed-catch": 134,
"max-params": 35,
"trek/store-without-selector": 69,
"react-hooks/refs": 561,
@@ -22,7 +22,7 @@
"trek/no-window-globals": 42,
"react-refresh/only-export-components": 46,
"unused-disable-directive": 6,
"max-depth": 22,
"max-depth": 21,
"react-hooks/void-use-memo": 1,
"@typescript-eslint/no-unused-expressions": 2,
"react-hooks/purity": 2,