WFDASHDRIVER-APP/app
Dave 85a40a76bf fix(collections): keep stop expanded while working through its items
When a driver collects or reports a problem on an item, the supplier
group they were working through used to collapse — forcing them to
re-expand it for every single item in the stop.

Root cause was a useCallback dep cycle:

- loadItems had items.length in its dep array
- handleCollect / handleProblem filter the processed item out of state
- items.length decreasing rebuilt loadItems (new identity)
- the consuming useEffect([loadItems]) re-fired loadItems
- loadItems's setExpandedSuppliers(new Set()) wiped every group

Fix: mirror items.length into a useRef so loadItems can read the
current count for the loading-skeleton decision without subscribing
to it. loadItems now only rebuilds when statusFilter changes (mount,
filter chip tap, refresh), so processing an item no longer resets
the expansion state. Drivers can work through every item in a stop
without re-expanding.

Behavior preserved on real refreshes / tab switches / filter changes
— those still reset to collapsed, which matches the new 'flat list
of stops on open' UX.
2026-09-08 22:15:31 +02:00
..
login refactor(ui): rebrand app, fix supplier naming 2026-07-05 22:32:20 +02:00
map feat(pocketbase): merge stock_purchase_items into Assigned list 2026-08-17 22:33:10 +02:00
settings feat: add complete dark mode support with settings toggle 2026-07-07 18:28:19 +02:00
.DS_Store Refactor collections to order items 2026-05-25 00:47:47 +02:00
globals.css feat: add complete dark mode support with settings toggle 2026-07-07 18:28:19 +02:00
layout.tsx feat: add pickup proof photos, improve performance and UX 2026-07-07 20:43:17 +02:00
page.tsx fix(collections): keep stop expanded while working through its items 2026-09-08 22:15:31 +02:00