From 86792d1ba39033656340a8dd11ee44b9ced7ace6 Mon Sep 17 00:00:00 2001 From: shafi54 <108669266+shafi-aviz@users.noreply.github.com> Date: Tue, 8 Sep 2026 13:55:59 +0530 Subject: [PATCH] enhh --- .commandcode/taste/taste/taste.md | 2 + apps/admin-web/src/lib/trpc-client.ts | 2 +- apps/web-ui/src/routes/flash.tsx | 2 +- apps/web-ui/src/routes/home.index.tsx | 53 +++++++++++++++++++++------ change-log.txt | 4 ++ 5 files changed, 49 insertions(+), 14 deletions(-) diff --git a/.commandcode/taste/taste/taste.md b/.commandcode/taste/taste/taste.md index f9fec00..580481b 100644 --- a/.commandcode/taste/taste/taste.md +++ b/.commandcode/taste/taste/taste.md @@ -104,6 +104,8 @@ er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the - The dedup directive is general, not limited to DB helpers: for types that are "exactly same but repeated" anywhere in the monorepo, move them into a shared package (@packages/shared), organize them there with proper comments, and export/reuse them from that one source — "Do this for all the types which are same and repeated" (stated when asking to address the duplicate-type spread repo-wide). Confidence: 0.9 - When organizing a shared type package, prefers to keep similar types together — all types that have identical properties should stay grouped/collocated so exact duplicates live side by side (e.g., clustering same-shaped types together in the shared files rather than scattering them). Confidence: 0.75 +- Scrollable content (e.g., a product grid) must never be buried beneath a persistent floating UI element like the floating cart bar: pages that scroll above such a bar need sufficient bottom padding on the content container so the last row of items can scroll fully clear of the bar ("There should be enough padding in bottom. I see the last row of products buried beneath the floating cart bar. They should be scrollable"). Errs toward GENEROUS bottom spacing and iterates for more if it still feels tight — after the initial fix (matching siblings' mobile `pb-24`) he asked to bump it again ("it's improved but add some more padding"), landing at mobile `pb-32` / desktop `md:pb-16`. Expects the fix to follow the sibling pages' bottom-padding pattern but lean roomier rather than matching the minimum. Confidence: 0.85 +- Prefers an incremental "load more"/"Show More" reveal model over rendering the entire product list at once on listing/dashboard pages: show a fixed batch at a time (the user-ui dashboard's All Products list shows 21 items and adds another 21 per click, hiding the button once all are visible) and expects the same model replicated in the sibling web-ui app ("we aren't showing all the items at once. We have a load more model. Implement the same on the @apps/web-ui too"), matching the reference's batch size and button behavior. Confidence: 0.8 e changes. Confidence: 0.95 er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9 als) rather than introducing new brand palettes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95 diff --git a/apps/admin-web/src/lib/trpc-client.ts b/apps/admin-web/src/lib/trpc-client.ts index 5ad6025..8796d58 100644 --- a/apps/admin-web/src/lib/trpc-client.ts +++ b/apps/admin-web/src/lib/trpc-client.ts @@ -6,7 +6,7 @@ import { EventBus, FORCE_LOGOUT_EVENT } from './event-bus' // Same backend as admin-ui (BASE_API_URL from common-ui); overridable via env. export const BASE_API_URL = - (import.meta.env?.VITE_API_URL as string | undefined) || 'https://devapi.freshyo.in' + (import.meta.env?.VITE_API_URL as string | undefined) || 'https://worker.freshyo.in' export const trpc = createTRPCReact() diff --git a/apps/web-ui/src/routes/flash.tsx b/apps/web-ui/src/routes/flash.tsx index e3d50db..1f70bea 100644 --- a/apps/web-ui/src/routes/flash.tsx +++ b/apps/web-ui/src/routes/flash.tsx @@ -107,7 +107,7 @@ function FlashDeliveryPage() { -
+
{/* Info Banner */}

diff --git a/apps/web-ui/src/routes/home.index.tsx b/apps/web-ui/src/routes/home.index.tsx index b6dce6f..6391ac6 100644 --- a/apps/web-ui/src/routes/home.index.tsx +++ b/apps/web-ui/src/routes/home.index.tsx @@ -186,6 +186,23 @@ function HomePage() { }) }, [productsData, productSlotsMap]) + // Load-more model for All Products (matches user-ui: 21 at a time) + const [visibleCount, setVisibleCount] = useState(21) + const [hasMore, setHasMore] = useState(true) + + useEffect(() => { + setVisibleCount(21) + setHasMore(sortedProducts.length > 21) + }, [sortedProducts]) + + const handleShowMore = () => { + setVisibleCount((prev) => { + const next = prev + 21 + setHasMore(next < sortedProducts.length) + return next + }) + } + // Sort slots by delivery time const sortedSlots = useMemo(() => { const now = dayjs() @@ -419,18 +436,30 @@ function HomePage() { {productsLoading ? ( ) : ( -

- {sortedProducts.map((product) => ( - handleProductPress(product.id)} - showDeliveryInfo={true} - miniView={true} - useAddToCartDialog={true} - /> - ))} -
+ <> +
+ {sortedProducts.slice(0, visibleCount).map((product) => ( + handleProductPress(product.id)} + showDeliveryInfo={true} + miniView={true} + useAddToCartDialog={true} + /> + ))} +
+ {hasMore && ( +
+ +
+ )} + )}
diff --git a/change-log.txt b/change-log.txt index edeab65..c4b85be 100644 --- a/change-log.txt +++ b/change-log.txt @@ -1483,3 +1483,7 @@ REWRITES (route → RN parity): - me.terms.tsx — replaced invented stub with verbatim FRESHYO legal content (sections A–E) from apps/user-ui/components/TermsAndConditions.tsx inside a white card + mobile header. NO LONGER LINKED: /me/about (hub About entry removed; RN has no About screen). Route file me.about.tsx left in place but no nav entry points to it. NOTES: no backend/migration changes; colors/tokens reused from web-ui theme. + +[2026-09-06 09:40:00] web-ui flash page bottom padding fix: apps/web-ui/src/routes/flash.tsx content wrapper gained `pb-24 md:pb-12` (was `py-6 md:px-8` only) so the last product row clears the floating 1-Hr cart bar on mobile and is scrollable — matches sibling product-grid pages (offers.tsx, stores.tsx, home.index.tsx). +[2026-09-06 09:45:00] Increased flash page bottom padding further per user: `pb-24 md:pb-12` → `pb-32 md:pb-16` in apps/web-ui/src/routes/flash.tsx. +[2026-09-06 10:00:00] web-ui home "All Available Products" load-more model (parity with user-ui dashboard): apps/web-ui/src/routes/home.index.tsx now keeps visibleCount (starts 21, +21 per click) + hasMore state; effect resets to 21 on productsData/productSlotsMap change (deps = sortedProducts recompute); grid renders sortedProducts.slice(0, visibleCount); centered rounded-full brand "Show More" button shown while hasMore. Explore-tag section already had its own 6→all Show More; untouched.