388 lines
22 KiB
Text
388 lines
22 KiB
Text
|
|
[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.
|
|
|
|
[2026-11-01 12:51:23 IST] Flash delivery: tag tabs instead of the store drawer, 3-up hero grid.
|
|
|
|
--- apps/user-ui/components/ProductCard.tsx
|
|
+ cartType?: 'regular' | 'flash' (default regular). Flash reads/writes the flash
|
|
cart, prices flashPrice ?? price, adds with slotId 0 and the 1hr alert, and
|
|
skips scheduled-slot out-of-stock/delivery badges. Regular call sites unchanged.
|
|
--- apps/user-ui/components/SlotSpecificView.tsx
|
|
+ FlashTagStrip: horizontal, fixed strip copied from home's TagTabStrip mechanics.
|
|
~ SlotLayout: isForFlashDelivery renders selector + strip + <Slot/>; the
|
|
scheduled view keeps its Drawer untouched.
|
|
~ FlashDeliveryProducts: tags from useAllProducts (first tag default), filter by
|
|
tag.productIds then search, numColumns 3, width (sw-48)/3, columnGap 8,
|
|
rowGap 12, ProductCard hero cards. Store filtering/loading gates removed.
|
|
--- apps/user-ui/app/(drawer)/(tabs)/flash-delivery/(products)/index.tsx
|
|
--- apps/user-ui/app/(drawer)/(tabs)/flash-delivery/(products)/_layout.tsx
|
|
~ storeId param no longer read or written; route shape unchanged.
|
|
--- apps/web-ui/src/routes/flash.tsx
|
|
~ Store tabs -> tag tabs (same order, first default); store filtering removed;
|
|
cart storeId still taken from the product.
|
|
--- tests
|
|
~ flash-products store cases rewritten for tags; slot-view flash asserts no
|
|
drawer; JEST-TEST-CASES rows updated.
|
|
|
|
[2026-11-01 12:56:02 IST] Flash delivery: page the tag feed 9 at a time with Show More.
|
|
|
|
--- apps/user-ui/components/SlotSpecificView.tsx
|
|
+ FLASH_PAGE_SIZE = 9; visibleCount state, reset on tag/search change; grid renders
|
|
the first 9, footer Show More adds 9 (home's pattern). testID flash-products-show-more.
|
|
--- apps/web-ui/src/routes/flash.tsx
|
|
~ Same 9-at-a-time paging with a Show More button; reset on tag change.
|
|
--- apps/user-ui/tests/pages/flash-products.test.tsx
|
|
+ FLASH-19: nine products render, Show More reveals the rest.
|
|
--- apps/user-ui/JEST-TEST-CASES.md
|
|
+ FLASH-19 row.
|
|
|
|
[2026-11-01 12:59:05 IST] Flash delivery: scroll-away tabs + a "Shop by Store" tab section.
|
|
|
|
--- apps/user-ui/components/SlotSpecificView.tsx
|
|
~ FlashTagStrip generalised to FlashTabStrip (items + testID prefix); reused for
|
|
tags and stores.
|
|
~ FlashDeliveryProducts becomes a ScrollView: search, tag strip, tag grid (9 +
|
|
Show More), then "Shop by Store" heading, store strip, store grid (9 + Show
|
|
More). Both strips scroll with the page; paging resets per section on
|
|
tab/search change. Search filters both grids. Every store gets a tab.
|
|
--- apps/web-ui/src/routes/flash.tsx
|
|
~ Same two sections, store tabs below the tag grid, independent 9-item paging.
|
|
--- tests
|
|
~ Product assertions scoped to the tag grid; new store-section cases.
|
|
|
|
[2026-11-01 14:06:51 IST] Flash delivery: the pull-to-refresh spinner no longer reports background fetches.
|
|
|
|
Diagnosed with a throwaway cache-subscription test (25s, real timers): the flash
|
|
screen itself starts no background fetches (only the 7 initial ones), and the
|
|
catalogue URL is built from assetsDomain/apiCacheKey/region/version — stable, so
|
|
the products query key does not churn. There is no 10s timer anywhere in
|
|
user-ui. What is wrong is the wiring: `refreshing` was bound to
|
|
`productsQuery.isFetching`, so *any* fetch (mount-after-stale, invalidation,
|
|
version bump, pull) drove the pull-to-refresh control, and the control element
|
|
was rebuilt on every render (re-attaching the platform control).
|
|
|
|
--- apps/user-ui/components/SlotSpecificView.tsx
|
|
~ FlashDeliveryProducts: `isRefreshing` local state + handleRefresh
|
|
(refetch products + stores, clear in finally), RefreshControl element
|
|
memoised. Mirrors home's handleRefresh. Background fetches are invisible.
|
|
--- apps/user-ui/src/hooks/useHideTabNav.ts
|
|
~ Focus callback memoised (was recreated every render, so useFocusEffect
|
|
unsubscribed/resubscribed per render and wrote false->true into the store,
|
|
flickering the tab bar on every render of every screen using it).
|
|
--- apps/user-ui/src/store/appStore.ts
|
|
~ setHideTabsNavKey no longer allocates when the key already has that value,
|
|
so it cannot notify subscribers spuriously.
|
|
--- tests
|
|
+ FLASH-24: a background refetch leaves the spinner idle.
|
|
+ FLASH-25: a pull keeps the spinner up until the refresh settles.
|
|
+ HIDE-04: re-render does not rewrite the store.
|
|
+ STORE-20: same-value write keeps the map identity.
|
|
|
|
[2026-11-01 14:24:07 IST] user-ui: arm64-only Android profile for personal device builds.
|
|
|
|
--- apps/user-ui/eas.json
|
|
+ "shafi-dev-arm64": internal distribution, channel shafi-dev, buildType apk,
|
|
gradleCommand ":app:assembleRelease -PreactNativeArchitectures=arm64-v8a".
|
|
Same JS/OTA channel as shafi-dev; the APK simply carries only arm64-v8a native
|
|
libs instead of all four ABIs (that is most of the 80 MB universal APK).
|
|
~ shafi-dev left untouched (universal APK for emulators / 32-bit testers).
|
|
|
|
[2026-11-01 14:31:37 IST] user-ui: shafi-dev now builds arm64-only + R8 (was universal APK).
|
|
|
|
Measured on the device (Play install, v1.2.0): base.apk 38.4 MB (dex 29.6 MB,
|
|
assets 3.9, res 2.7) + split arm64 libs 19.0 MB + density/langs 0.4 => 57.8 MB
|
|
installed. The local universal APK carries the same bytes plus three unused ABI
|
|
sets (x86, x86_64, armeabi-v7a), which is the 80 MB.
|
|
|
|
--- apps/user-ui/eas.json
|
|
~ shafi-dev: explicit buildType apk; gradleCommand
|
|
":app:assembleRelease -PreactNativeArchitectures=arm64-v8a
|
|
-Pandroid.enableProguardInReleaseBuilds=true".
|
|
-PreactNativeArchitectures drops the three unused ABIs, and the ProGuard
|
|
property turns on R8 + resource shrinking for this profile only (the template
|
|
reads it via findProperty, so production is untouched).
|
|
- shafi-dev-arm64 removed: redundant now that shafi-dev is arm64-only.
|
|
|
|
[2026-11-01 14:53:35 IST] Home: catalogue memo is the single source for products, tags and products-by-tag.
|
|
|
|
--- apps/user-ui/app/(drawer)/(tabs)/home/index.tsx
|
|
~ Removed `products = productsData?.products || []`, `dashboardTags =
|
|
productsData?.tags || []` and the separate `productsByTagId` memo. One memo
|
|
now returns { dashboardTags, products, productsByTagId } and all three are
|
|
read from it.
|
|
~ productById Map hoisted out of the per-tag loop (it was rebuilt once per tag).
|
|
~ Duplicate ids in tag.productIds are skipped (first occurrence wins), so a
|
|
repeated id renders one card instead of two.
|
|
~ displayedProducts effect deps use the memo's `products`.
|
|
--- apps/user-ui/hooks/useProductSlotIdentifier.ts
|
|
~ getQuickestSlot wrapped in useCallback with [slots, productSlotsMap]. It was
|
|
a new function every render, which made the catalogue memo recompute on every
|
|
render (and defeated its useMemo).
|
|
--- apps/web-ui/src/routes/home.index.tsx
|
|
~ Same restructure: one memo returns { dashboardTags, allProducts,
|
|
productsByTagId }, dedupe + hoisted productById, and the dead `extra` branch
|
|
removed (its filter can never match: orderedIds is built from productIds).
|
|
--- apps/user-ui/tests/pages/home.test.tsx
|
|
~ HOME-16 rewritten: duplicate ids in a tag now render once (was pinning the
|
|
bug).
|
|
--- apps/user-ui/JEST-TEST-CASES.md
|
|
~ HOME-16 catalogue row updated.
|
|
|
|
[2026-11-01 15:10:50 IST] Home tag selection/expansion moved to a zustand store so a tap stops re-rendering the whole page.
|
|
|
|
Selecting a tag used to set Dashboard state, which re-rendered Dashboard, rebuilt
|
|
ListHeader and rebuilt the SectionList `sections` literal, re-rendering every
|
|
visible main-list ProductCard as well. The selection now lives outside React
|
|
state; only the tab strip and the active tag scene subscribe.
|
|
|
|
--- apps/user-ui/src/store/homeTagStore.ts (new)
|
|
+ selectedTagId + expandedByTagId + selectTag/expandTag/resetHomeTags.
|
|
+ Writes are no-ops when unchanged (same guard as appStore.setHideTabsNavKey)
|
|
so re-selecting the active tag does not wake subscribers.
|
|
--- apps/user-ui/app/(drawer)/(tabs)/home/index.tsx
|
|
~ Removed Dashboard's selectedTagId/expandedByTagId state, activeTagId,
|
|
handleToggleExpand and the dead pageTint (both styles hardcoded #FFFFFF, so
|
|
getTagColor/TAG_COLORS had no visible effect).
|
|
~ TagTabStrip and TagScene subscribe to useHomeTagStore directly; their
|
|
activeTagId/onSelectTag/expandedByTagId/onToggleExpand props are gone.
|
|
~ ListHeader no longer receives or forwards selection props.
|
|
~ listHeader memo deps drop activeTagId/expandedByTagId/handleToggleExpand, so
|
|
Dashboard no longer produces a new header element on a tag tap.
|
|
--- apps/user-ui/src/lib/region-switch.ts
|
|
+ resetHomeTags() on region switch: tag ids are region-scoped.
|
|
--- apps/user-ui/tests/helpers/reset.ts
|
|
+ reset the home tag store between cases.
|
|
--- apps/user-ui/tests/lib/stores.test.ts
|
|
+ STORE-21: selecting the active tag again keeps store identity.
|
|
+ STORE-22: resetHomeTags clears selection and expansion.
|
|
--- apps/user-ui/JEST-TEST-CASES.md
|
|
~ rows for STORE-21/22.
|
|
--- apps/web-ui/src/lib/stores/home-tag-store.ts (new)
|
|
+ Same store, mirrored.
|
|
--- apps/web-ui/src/routes/home.index.tsx
|
|
~ selection/expansion read from the store (the web page is one component, so it
|
|
still subscribes; behaviour matches user-ui).
|
|
--- apps/web-ui/src/lib/region-switch.ts
|
|
+ resetHomeTags() on region switch.
|
|
|
|
[2026-11-01 17:53:16 IST] user-ui: ProductCard images move from RN Image (Fresco) to expo-image.
|
|
|
|
Diagnosed from the device onError payload:
|
|
"Pool hard cap violation? Hard cap = 301989888 Used size = 301156264 Free
|
|
size = 0 Request size = 4259840" — Fresco's bitmap pool (288 MiB) was full, so
|
|
valid images failed to decode. Live catalogue check: 148/149 image URLs return
|
|
200 image/*; the one 404 is product 84's ref missing the product-images/ prefix.
|
|
Source images are 1024-1600px, i.e. 4-10 MB decoded at source vs ~0.35 MB at
|
|
card size.
|
|
|
|
--- apps/user-ui/components/ProductCard.tsx
|
|
~ <RnImage> replaced with expo-image <Image> (already imported, used by every
|
|
other image surface in the app): contentFit="cover", cachePolicy="memory-disk",
|
|
recyclingKey=item.id, transition={0}. Glide downsamples to the view size and
|
|
bounds its caches instead of holding full-size bitmaps in Fresco's pool.
|
|
~ resizeMode moved out of the style object into contentFit (style resizeMode is
|
|
not a valid RN style).
|
|
~ onError now surfaces event.error (was discarded, always "Image failed to
|
|
load"). Remove the now-unused `Image as RnImage` import.
|
|
--- apps/user-ui/tests/pages/home.test.tsx
|
|
~ HOME-38 fires the error on the expo-image mock (testID "expo-image") instead
|
|
of an RN Image instance.
|
|
|
|
[2026-11-01 18:07:16 IST] product-images: generated 1000px copies of the 147 oversized catalogue images (nothing uploaded).
|
|
|
|
--- product-images/resized/ (new, untracked)
|
|
+ one resized copy per row of needs-edit.csv; max side 1000, aspect preserved,
|
|
JPEG re-encoded at quality 70, PNG kept as PNG. Originals untouched.
|
|
--- product-images/resized-report.csv (new, untracked)
|
|
+ per file: old/new dimensions, old/new bytes, old/new decoded MB, delta.
|
|
- R2 bucket, products.json and DB were not modified.
|
|
|
|
[2026-11-01 18:26:30 IST] product-images: 800px pass generated and uploaded over the live keys (prod bucket).
|
|
|
|
--- product-images/resized-800/ (new, untracked)
|
|
+ every referenced catalogue image with max side > 800 resized to 800px
|
|
(JPEG q70, PNG kept as PNG). Originals left untouched in product-images/.
|
|
--- product-images/resized-800-report.csv (new, untracked)
|
|
+ per file: old/new dimensions, bytes and decoded MB.
|
|
--- R2 (bucket meatfarmer, prefix product-images/)
|
|
~ the same keys were overwritten with the 800px files; Content-Type preserved
|
|
per output format. Cloudflare cache purged for every replaced URL.
|
|
- No DB rows, products.json or version numbers changed.
|
|
|
|
[2026-11-01 18:37:42 IST] products.json: append a static cache-busting query to image URLs.
|
|
|
|
Client image caches are keyed by URL and the R2 object keys never change, so
|
|
replaced files were invisible to phones that had cached the old bytes. The
|
|
generated catalogue now appends ?random=1 to every product image URL and tag
|
|
imageUrl. Static by design: a per-request value would defeat caching.
|
|
|
|
--- apps/backend/src/lib/product-image-cache.ts (new)
|
|
+ PRODUCT_IMAGE_CACHE_BUST = 'random=1', withImageCacheBust(url) (handles a URL
|
|
that already has a query) and applyImageCacheBust(catalogue), which rewrites
|
|
product images and tag imageUrl only.
|
|
--- apps/backend/src/lib/cloud_cache.ts
|
|
~ createProductsFileInternal applies applyImageCacheBust before serialising, so
|
|
only the published products.json carries the query; the admin summary endpoint
|
|
and the test snapshot controller keep raw URLs.
|
|
--- apps/backend/tests/unit/product-image-cache.test.ts (new)
|
|
+ unit coverage for plain URLs, URLs with a query, empty values, the
|
|
product/tag mapping and input immutability.
|
|
--- docs/jobs-to-be-added.txt
|
|
+ job to roll the same asset version out to the remaining image surfaces.
|
|
|
|
[2026-11-01 19:03:33 IST] user-ui: enforce a 3-day TTL on the expo-image disk cache.
|
|
|
|
expo-image has no per-entry TTL (cachePolicy is only none/disk/memory/memory-disk;
|
|
the underlying Glide/SDWebImage caches are LRU, no expiry). It does expose
|
|
Image.clearDiskCache(), so the cache is cleared when the stored timestamp is
|
|
older than 3 days, checked on mount and whenever the app returns to the
|
|
foreground. Results in a maximum age of 3 days for any cached image.
|
|
|
|
--- apps/user-ui/src/lib/image-cache-ttl.ts (new)
|
|
+ IMAGE_CACHE_TTL_MS (3 days), IMAGE_CACHE_CLEARED_AT_KEY and
|
|
shouldClearImageCache(lastClearedAt, now) (null/invalid/future timestamps
|
|
clear).
|
|
--- apps/user-ui/src/lib/image-cache-meta.ts (new)
|
|
+ timestamp persisted in a plain file under expo-file-system's documentDirectory
|
|
(expo-file-system is a dependency of expo). No SecureStore / StorageService.
|
|
--- apps/user-ui/src/components/ImageCacheTtl.tsx (new)
|
|
+ one-shot guard, reads the file timestamp, calls Image.clearDiskCache() only
|
|
when expired, writes the new timestamp when the clear reports success. Errors
|
|
never block startup.
|
|
--- apps/user-ui/app/_layout.tsx
|
|
+ mount <ImageCacheTtl /> inside CentralStoreInitializer.
|
|
--- apps/user-ui/tests/mocks/native/common.tsx + tests/jest.config.js
|
|
+ expo-image mock gains clearDiskCache/clearMemoryCache/prefetch jest.fn
|
|
statics; expo-file-system is mapped to the same shim.
|
|
--- apps/user-ui/tests/lib/image-cache-ttl.test.tsx (new)
|
|
+ IMGCACHE-01..07: helper boundaries, component clear/skip and failed-clear.
|
|
--- apps/user-ui/tests/lib/image-cache-meta.test.ts (new)
|
|
+ IMGCACHE-08..10: missing/corrupt file and the write path.
|
|
--- apps/user-ui/JEST-TEST-CASES.md
|
|
+ rows for IMGCACHE-01..10.
|
|
|
|
[2026-11-01 19:19:30 IST] home: split the monolithic list header into separate virtualized items and tighten the render window.
|
|
|
|
The whole top block (glimpse + tag strip + tag grid + stores + slots + "All
|
|
Available Products" title) was a single SectionList item, and the first
|
|
`initialNumToRender` items are pinned by VirtualizedList. With
|
|
initialNumToRender=10 and windowSize=5, the header plus ~27 cards stayed mounted
|
|
forever, growing worse as Show More appended rows.
|
|
|
|
--- apps/user-ui/app/(drawer)/(tabs)/home/index.tsx
|
|
~ Removed the ListHeader component/wrapper. The list data is now a list of
|
|
typed items: glimpse, tagStrip, tagScene, stores, slots, allProductsTitle,
|
|
empty and row (3 products). Each renders independently, so the top sections
|
|
unmount as they scroll out of the window.
|
|
~ Per-item white/px-4 wrappers replace the old rounded-t-3xl wrapper (page
|
|
background is white, so the rounded edge was not visible).
|
|
~ Extracted HomeGlimpse, TagSceneBlock, StoresSection, SlotsSection and
|
|
AllProductsTitle (all memoized); SlotsSection keeps its own renderSlotItem.
|
|
~ sections, keyExtractor, renderItem, renderSectionHeader and the footer are
|
|
memoized/callback-stable so unrelated Dashboard renders no longer rebuild
|
|
the list props.
|
|
--- apps/user-ui/src/lib/home-list-tuning.ts (new)
|
|
+ HOME_INITIAL_RENDER_COUNT=2, HOME_WINDOW_SIZE=3, HOME_MAX_RENDER_BATCH=6.
|
|
VirtualizedList pins the first initialNumToRender cells forever, so it must
|
|
stay small for the split top sections to unmount.
|
|
~ Virtualization props now read those constants (was windowSize 5,
|
|
initialNumToRender 10, maxToRenderPerBatch 10). removeClippedSubviews stays
|
|
off (nested horizontal scrollers).
|
|
- ProductCard's 5s interval left untouched, as requested.
|
|
--- apps/user-ui/tests/pages/home.test.tsx
|
|
~ mainListIds reads the row items from sections[0].data (kind === 'row').
|
|
~ Mocks home-list-tuning with initialNumToRender 20 so interaction assertions
|
|
have product rows mounted (jsdom never scrolls a virtualized list).
|