WFDASHDRIVER-APP/lib
SJCoetz 105f169e45 feat: popover stays above footer, partial collections must be justified
Two improvements to the collection flow:

1. Popover clipping under BottomNav (last item in list)
   - Root cause: popovers were z-[60] *inside* a parent stacking
     context at z-30, so their effective page z-index was 30 — below
     BottomNav's z-50. Even if the z-index were right, the popover
     extends below the trigger button and could fall below the
     viewport on the last item in a long list.
   - Add lib/hooks.ts with usePopoverPlacement: measures the
     trigger's bottom edge and flips popover direction to "up" when
     there isn't ~240px of room below (reserving 80px for BottomNav
     + safe-area inset).
   - Bump the article/section/li stacking context from z-30 to z-[80]
     when a popover is open so the popover paints above BottomNav
     (z-50). Covers both compact-mode SupplierGroup rows and
     detailed-mode CollectionItemCard via the existing
     onPopoverChange callback.
   - For SupplierGroup: hooks live at the top level (record keyed by
     item.id) to avoid the Rules of Hooks trap of declaring hooks
     inside items.map().

2. Partial collections must be justified
   - In CollectModal, when received qty < expected, require EITHER a
     reason (dropdown: out of stock / wrong item / quality issue /
     damaged / wrong qty packed / other) OR a photo before Confirm
     is enabled. Prevents silent partial submissions with no audit
     trail.
   - The picked reason flows into the auto-generated problem note
     so the operator sees "[Reason] driver note" in PB.

Co-Authored-By: Claude <noreply@anthropic.com>

Co-authored-by: Orca <help@stably.ai>
2026-08-02 22:58:08 +02:00
..
hooks.ts feat: popover stays above footer, partial collections must be justified 2026-08-02 22:58:08 +02:00
itemsCache.ts feat: add pickup proof photos, improve performance and UX 2026-07-07 20:43:17 +02:00
pocketbase.ts feat: add PO/Notes popovers, supplier color sidebar, fix popover clipping 2026-08-02 21:38:38 +02:00
pwa.ts Add PWA support and UI redesign 2026-05-27 00:34:50 +02:00
theme.ts feat: add complete dark mode support with settings toggle 2026-07-07 18:28:19 +02:00
types.ts feat: add PO/Notes popovers, supplier color sidebar, fix popover clipping 2026-08-02 21:38:38 +02:00
utils.ts feat(grouping): add area grouping, refine UI and cleanup 2026-07-10 02:01:57 +02:00