enh
This commit is contained in:
parent
a83430eb75
commit
0721bd7019
3 changed files with 52 additions and 4 deletions
|
|
@ -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<number, string>()
|
||||
|
|
|
|||
|
|
@ -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<number, string>()
|
||||
|
|
|
|||
|
|
@ -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 <LocationBar /> 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:<id>` -> `region_cache.user_addresses.v1.<id>`
|
||||
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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue