
[2026-10-29 22:54:34 IST] Admin app: open the order from an order-placed push, including cold start.

--- apps/admin-ui/services/notif-service/pending-order.ts (new)
+ Module-level pending order id: setPendingOrderId / takePendingOrderId / clearPendingOrderId.
--- apps/admin-ui/services/notif-service/notif-context.tsx
~ Extract openFromNotification(response): numeric-validates data.orderId, dedupes by
  request.identifier, pushes order details when signed in, stashes the id when signed out.
~ Call it from the response listener AND from Notifications.getLastNotificationResponseAsync()
  (terminated-app tap), then clearLastNotificationResponseAsync().
~ Wait for StaffAuthProvider hydration (isLoading === false) before handling the launch response.
--- apps/admin-ui/components/context/staff-auth-context.tsx
~ On login success, route to a pending order notification target instead of always the dashboard.
--- apps/admin-ui/tests/mocks/expo-notifications-mock.ts
+ clearLastNotificationResponseAsync mock; __setLastResponse() to seed the cold-start response.
--- apps/admin-ui/tests/app/root-layout.test.tsx
+ AROOT-06 cold-start tap, AROOT-07 duplicate response opened once, AROOT-08 signed-out deferral.
--- apps/admin-ui/tests/pages/login.test.tsx
+ ALOGIN-15 pending order target wins over the dashboard after login.
--- apps/admin-ui/JEST-TEST-CASES.md
+ Catalogue rows for AROOT-06..08 and ALOGIN-15.

[2026-10-29 22:57:48 IST] Admin push notifications for order cancellation and new complaints.

--- apps/backend/src/lib/admin-notif.ts
~ notifyAllAdmins payload gains optional complaintId; forwarded in jobData.
--- apps/backend/src/lib/notif-job.ts
~ sendAdminNotification accepts complaintId and includes it in the push data.
--- apps/backend/src/lib/queue-consumer.ts
~ forwards jobData.complaintId (null fallback) to sendAdminNotification.
--- apps/backend/src/lib/post-order-handler.ts
~ handleOrderCancelled pushes "Order Cancelled" to every admin device with data.orderId.
--- packages/db_helper_sqlite/src/user-apis/complaint.ts
~ createComplaint returns the inserted complaint id (was void).
--- apps/backend/src/trpc/apis/user-apis/apis/complaint.ts
~ complaint.raise pushes "New Complaint" to admin devices with data.complaintId;
  notification failures are logged and never fail the complaint.
--- apps/admin-ui/services/notif-service/pending-navigation.ts (renames pending-order.ts)
~ Holds a pending href instead of an order id, so a signed-out tap on either
  notification type resumes after login.
--- apps/admin-ui/services/notif-service/notif-context.tsx
~ Routes data.complaintId to the complaints list (orderId still wins).
--- apps/admin-ui/components/context/staff-auth-context.tsx
~ login consumes the pending href.
--- tests
~ queue-consumer expectation gains complaintId; admin-ui root-layout/login tests
  updated for the href-based pending target; AROOT-09 complaint tap added.

[2026-10-29 23:02:23 IST] Scope admin order/complaint push notifications to the event's region.

--- packages/db_helper_sqlite/src/admin-apis/staff-user.ts
+ getStaffNotifTokensForRegion(regionId): staff_notif_creds inner-joined to
  staff_users where staff_users.region_id = regionId.
--- packages/db_helper_sqlite/index.ts
+ export the new helper.
--- packages/db_helper_sqlite/src/user-apis/order.ts
~ OrderWithFullData gains regionId (already selected at runtime).
--- packages/db_helper_sqlite/src/user-apis/complaint.ts
~ createComplaint returns { id, regionId } instead of a bare id.
--- apps/backend/src/lib/admin-notif.ts
+ notifyRegionAdmins(regionId, payload) — refuses null region, otherwise batches
  the region's tokens. notifyAllAdmins kept for manual broadcasts only.
--- apps/backend/src/lib/post-order-handler.ts
~ Order placed and order cancelled use notifyRegionAdmins(order.regionId, ...).
--- apps/backend/src/trpc/apis/user-apis/apis/complaint.ts
~ complaint.raise uses notifyRegionAdmins(complaint.regionId, ...).
--- apps/backend/tests/unit/admin-notif.test.ts
~ Rewritten for region scoping + manual broadcast; asserts null region is a no-op.

[2026-11-01 12:32:24 IST] user-ui home: match the All Available Products grid spacing to the tag grid.

--- apps/user-ui/app/(drawer)/(tabs)/home/index.tsx
~ staticStyles.columnWrapper.paddingHorizontal 16 -> 28. Cards keep
  heroItemWidth, so the horizontal gap becomes 8px, identical to the tag grid
  (mx-4 + px-3 = 28px inset, same 8px gaps).
~ All Available Products heading row px-1 -> px-3 so the title sits on the same
  28px gutter as the rows.
No data, paging, or card changes.

[2026-11-01 12:34:02 IST] user-ui home: give the catalog grid the extra space as card width.

--- apps/user-ui/app/(drawer)/(tabs)/home/index.tsx
~ Reverts the 28px row gutter: columnWrapper.paddingHorizontal back to 16 so the
  grid keeps the page's 16px margin (and the heading returns to px-1).
+ catalogItemWidth = (screenWidth - 48) / 3; ProductItem (catalog rows only)
  uses it instead of heroItemWidth, so three cards fill the row with 8px gaps.
  Tag grid keeps heroItemWidth inside its 28px inset card.

[2026-11-01 12:37:54 IST] user-ui Offers/Combos: same compact 3-up grid as the home catalog.

--- apps/user-ui/app/(drawer)/(tabs)/order-again/index.tsx
~ heroItemWidth -> catalogItemWidth = (screenWidth - 48) / 3.
~ Grid gap-5 (20px) -> gap-2 (8px); px-4 page margin unchanged.
  Three cards now fill the row, matching the All Available Products grid.
Web offers page already uses a 12px grid gap (gap-3), so no web change.
