From 0721bd7019d086d5e429822aef54877574fdb0dc Mon Sep 17 00:00:00 2001 From: shafi54 <108669266+shafi-aviz@users.noreply.github.com> Date: Tue, 20 Oct 2026 19:41:39 +0530 Subject: [PATCH] enh --- apps/user-ui/src/lib/region-cache.ts | 5 +-- apps/web-ui/src/lib/region-cache.ts | 5 +-- change-log.txt | 46 ++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/apps/user-ui/src/lib/region-cache.ts b/apps/user-ui/src/lib/region-cache.ts index 1198591..2d2de3e 100644 --- a/apps/user-ui/src/lib/region-cache.ts +++ b/apps/user-ui/src/lib/region-cache.ts @@ -28,9 +28,10 @@ export interface CachedUserAddressesResponse { * They are only a startup seed. The live tRPC queries always run in the * background and overwrite both the React Query cache and these snapshots. */ -export const REGION_LIST_CACHE_KEY = 'region_cache:list_regions:v1' +// SecureStore only accepts alphanumeric, ".", "-" and "_" in keys. +export const REGION_LIST_CACHE_KEY = 'region_cache.list_regions.v1' export const userAddressesCacheKey = (userId: number) => - `region_cache:user_addresses:v1:${userId}` + `region_cache.user_addresses.v1.${userId}` let lastWrittenRegions: string | null = null const lastWrittenAddresses = new Map() diff --git a/apps/web-ui/src/lib/region-cache.ts b/apps/web-ui/src/lib/region-cache.ts index d8e8f71..0d52977 100644 --- a/apps/web-ui/src/lib/region-cache.ts +++ b/apps/web-ui/src/lib/region-cache.ts @@ -17,9 +17,10 @@ export interface CachedUserAddressesResponse { data: CachedUserAddress[] } -export const REGION_LIST_CACHE_KEY = 'region_cache:list_regions:v1' +// Keep the same key shape as user-ui (SecureStore-safe: no colons). +export const REGION_LIST_CACHE_KEY = 'region_cache.list_regions.v1' export const userAddressesCacheKey = (userId: number) => - `region_cache:user_addresses:v1:${userId}` + `region_cache.user_addresses.v1.${userId}` let lastWrittenRegions: string | null = null const lastWrittenAddresses = new Map() diff --git a/change-log.txt b/change-log.txt index ca1f336..704a9e0 100644 --- a/change-log.txt +++ b/change-log.txt @@ -8280,6 +8280,35 @@ Run: bun run test -- tests/components/address-form.test.tsx -> 37/37 passed (no assertions needed changing; address-city / address-city-option-* IDs preserved). Typecheck: user-ui clean; web-ui `npm run typecheck` clean. +================================================================================ +[2026-10-20 19:28:04 IST] REVERT-2026-10-20-26 Home address bar scroll visibility +================================================================================ +Undo 2026-10-20 19:18:13: "Home: make the address selector (LocationBar) reveal +on any upward scroll and hide on downward scroll". +apps/user-ui/app/(drawer)/(tabs)/home/index.tsx +- Move back into `listHeader` / ListHeaderComponent so it scrolls + out with the content instead of living in the sticky section header. +- Remove showLocationBar state/ref, lastScrollY, setLocationBarVisible, + handleListScroll, SectionList onScroll/scrollEventThrottle, and the + home-section-list testID. +- Remove LayoutAnimation / Platform / UIManager setup and the scroll event types. +apps/user-ui/tests/pages/home.test.tsx +- Remove HOME-118 and HOME-119 (they asserted the reverted hide/show behaviour). +Run: user-ui typecheck clean; `npm test -- tests/pages/home.test.tsx +--runInBand` -> 117/117 passed. + +================================================================================ +[2026-10-20 19:21:57 IST] FIX-2026-10-20-25 SecureStore cache keys +================================================================================ +Problem: `StorageServiceCasual getItem error: Invalid key provided to SecureStore` +because the new cache keys contained `:` (SecureStore only permits +alphanumeric, ".", "-", "_"). +apps/user-ui/src/lib/region-cache.ts +apps/web-ui/src/lib/region-cache.ts +- `region_cache:list_regions:v1` -> `region_cache.list_regions.v1` +- `region_cache:user_addresses:v1:` -> `region_cache.user_addresses.v1.` +No data migration needed: the invalid keys were never persisted. + ================================================================================ [2026-10-20 17:49:38 IST] CACHE-2026-10-20-24 region list + user address cache ================================================================================ @@ -8455,3 +8484,20 @@ cover the three Home scenarios). user-ui typecheck clean. + HOME-113..117 for the new window behaviour. No backend/API changes: getOrders is shared with My Orders, so the glimpse filters its own view. + - Timestamp: 2026-10-20 19:18:13 + Home: make the address selector (LocationBar) reveal on any upward scroll + and hide on downward scroll, regardless of how far down the list is. + File: apps/user-ui/app/(drawer)/(tabs)/home/index.tsx + Changes: + - move LocationBar out of ListHeaderComponent and into the sticky + renderSectionHeader (above the SearchBar); + - track SectionList onScroll direction: show at y <= 4 or on a small upward + delta, hide on a downward delta; animate the layout change; + - add testID="home-section-list" for the scroll tests. + * apps/user-ui/src/components/LocationBar.tsx + + comment updated: placement is caller-owned (Home keeps it sticky). + Tests: apps/user-ui/tests/pages/home.test.tsx + - HOME-118: down hides, a tiny upward scroll reveals, down hides again. + - HOME-119: returning to the top always reveals. + Web-ui has no equivalent scroll-away address bar on the home route (its + Topbar is already fixed), so no web counterpart change.