DEAD_CODE_CLEAN #6
5 changed files with 49 additions and 14 deletions
|
|
@ -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
|
- 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
|
- 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
|
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
|
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
|
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
|
||||||
|
|
|
||||||
|
|
@ -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.
|
// Same backend as admin-ui (BASE_API_URL from common-ui); overridable via env.
|
||||||
export const BASE_API_URL =
|
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<AppRouter>()
|
export const trpc = createTRPCReact<AppRouter>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ function FlashDeliveryPage() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mx-auto w-full max-w-7xl px-4 py-6 md:px-8">
|
<div className="mx-auto w-full max-w-7xl px-4 py-6 pb-32 md:px-8 md:pb-16">
|
||||||
{/* Info Banner */}
|
{/* Info Banner */}
|
||||||
<div className="mb-4 rounded-xl border border-yellow-200 bg-yellow-50 p-3">
|
<div className="mb-4 rounded-xl border border-yellow-200 bg-yellow-50 p-3">
|
||||||
<p className="text-sm text-yellow-800">
|
<p className="text-sm text-yellow-800">
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,23 @@ function HomePage() {
|
||||||
})
|
})
|
||||||
}, [productsData, productSlotsMap])
|
}, [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
|
// Sort slots by delivery time
|
||||||
const sortedSlots = useMemo(() => {
|
const sortedSlots = useMemo(() => {
|
||||||
const now = dayjs()
|
const now = dayjs()
|
||||||
|
|
@ -419,18 +436,30 @@ function HomePage() {
|
||||||
{productsLoading ? (
|
{productsLoading ? (
|
||||||
<SectionSpinner label="Loading products..." />
|
<SectionSpinner label="Loading products..." />
|
||||||
) : (
|
) : (
|
||||||
<div className="grid grid-cols-3 gap-3 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
|
<>
|
||||||
{sortedProducts.map((product) => (
|
<div className="grid grid-cols-3 gap-3 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
|
||||||
<ProductCard
|
{sortedProducts.slice(0, visibleCount).map((product) => (
|
||||||
key={product.id}
|
<ProductCard
|
||||||
item={product}
|
key={product.id}
|
||||||
onPress={() => handleProductPress(product.id)}
|
item={product}
|
||||||
showDeliveryInfo={true}
|
onPress={() => handleProductPress(product.id)}
|
||||||
miniView={true}
|
showDeliveryInfo={true}
|
||||||
useAddToCartDialog={true}
|
miniView={true}
|
||||||
/>
|
useAddToCartDialog={true}
|
||||||
))}
|
/>
|
||||||
</div>
|
))}
|
||||||
|
</div>
|
||||||
|
{hasMore && (
|
||||||
|
<div className="flex justify-center py-6">
|
||||||
|
<button
|
||||||
|
onClick={handleShowMore}
|
||||||
|
className="rounded-full bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-brand-600"
|
||||||
|
>
|
||||||
|
Show More
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -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.
|
- 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.
|
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.
|
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.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue