From cc62975dd079b6868c1249bbfa9af50ce26ca7be Mon Sep 17 00:00:00 2001 From: "s.esmaeili" Date: Tue, 15 Sep 2026 01:01:03 +0330 Subject: [PATCH] user-app: extend the redesign across the purchase path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applies the home/product-detail design language (LESS colour tokens, BEM class names, hairline-bordered cards, SectionHead, dashed empty states) to the screens a shopper actually walks through: search, collection, newest, cart and favorites. Two shared pieces are extracted so the language stays consistent rather than re-typed per screen: - components/ui/PageBar.vue — the sticky translucent bar with blur and a hairline, lifted from the home screen's own header so every other screen gets identical chrome instead of the old dark AppHeader. - components/product/ProductCard.vue — the catalogue workhorse card. It is deliberately a sibling of home/ShowcaseCard (which keeps its editorial "wide" variant and badge) and additionally surfaces stock, which the catalogue needs and the home screen does not. Deleted as orphaned once nothing imported them: ProductList, ProductVerticalFull, ProductVertical, ProductHorizontal, CollectionCard — all Tailwind utility soup carried over from the legacy PWA. Behaviour is preserved throughout; only chrome and cards change. The cart still posts to the real POST /orders with wagePercent from each item's pinned variant, still gates on a real session, and still keeps the note drawer and success step. Search keeps its client-side filtering, the Filters sheet, category chips and collection tiles. No rial price is printed anywhere, for the same reason as the rest of the redesign: a finished piece's price is the live gold rate x weight plus wage, computed at order time and never stored on the product. FIXED a regression this redesign introduced before it shipped: dropping ScrollFetchSearch from the search grid meant all 205 catalogue products mounted at once (205 cards, 205 images). Both search and newest now render a 20-item window that grows as the user reaches the end. Verified in a real browser against the running API and native database, not just a green build: home 13 cards, search 20 -> 40 -> 60 -> 80 on scroll, newest 20 -> 40 -> 60, cart empty state, favorites 3 cards behind a seeded session. All images loaded (0 broken), no horizontal overflow, no console errors beyond pre-existing vue3-lazyload noise that predates this work. vue-tsc and vite build both clean. Co-Authored-By: Claude Opus 5 --- .../src/components/product/CartItem.vue | 245 ++++++++--- .../src/components/product/CollectionCard.vue | 15 - .../src/components/product/ProductCard.vue | 199 +++++++++ .../components/product/ProductHorizontal.vue | 65 --- .../src/components/product/ProductList.vue | 44 -- .../components/product/ProductVertical.vue | 75 ---- .../product/ProductVerticalFull.vue | 66 --- apps/user-app/src/components/ui/PageBar.vue | 115 +++++ apps/user-app/src/composables/useProduct.ts | 8 +- apps/user-app/src/views/CartView.vue | 408 +++++++++++++----- apps/user-app/src/views/NewestView.vue | 92 +++- .../src/views/search/CollectionView.vue | 113 +++-- apps/user-app/src/views/search/SearchView.vue | 302 +++++++++++-- .../user-app/src/views/user/FavoritesView.vue | 92 +++- 14 files changed, 1302 insertions(+), 537 deletions(-) delete mode 100644 apps/user-app/src/components/product/CollectionCard.vue create mode 100644 apps/user-app/src/components/product/ProductCard.vue delete mode 100644 apps/user-app/src/components/product/ProductHorizontal.vue delete mode 100644 apps/user-app/src/components/product/ProductList.vue delete mode 100644 apps/user-app/src/components/product/ProductVertical.vue delete mode 100644 apps/user-app/src/components/product/ProductVerticalFull.vue create mode 100644 apps/user-app/src/components/ui/PageBar.vue diff --git a/apps/user-app/src/components/product/CartItem.vue b/apps/user-app/src/components/product/CartItem.vue index a4d54ad..0399cdb 100644 --- a/apps/user-app/src/components/product/CartItem.vue +++ b/apps/user-app/src/components/product/CartItem.vue @@ -1,54 +1,71 @@ - diff --git a/apps/user-app/src/components/product/CollectionCard.vue b/apps/user-app/src/components/product/CollectionCard.vue deleted file mode 100644 index a5a67e5..0000000 --- a/apps/user-app/src/components/product/CollectionCard.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - - diff --git a/apps/user-app/src/components/product/ProductCard.vue b/apps/user-app/src/components/product/ProductCard.vue new file mode 100644 index 0000000..853b209 --- /dev/null +++ b/apps/user-app/src/components/product/ProductCard.vue @@ -0,0 +1,199 @@ + + + + + + diff --git a/apps/user-app/src/components/product/ProductHorizontal.vue b/apps/user-app/src/components/product/ProductHorizontal.vue deleted file mode 100644 index 1caa6b5..0000000 --- a/apps/user-app/src/components/product/ProductHorizontal.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - diff --git a/apps/user-app/src/components/product/ProductList.vue b/apps/user-app/src/components/product/ProductList.vue deleted file mode 100644 index 12b6576..0000000 --- a/apps/user-app/src/components/product/ProductList.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - diff --git a/apps/user-app/src/components/product/ProductVertical.vue b/apps/user-app/src/components/product/ProductVertical.vue deleted file mode 100644 index 3c0c062..0000000 --- a/apps/user-app/src/components/product/ProductVertical.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - diff --git a/apps/user-app/src/components/product/ProductVerticalFull.vue b/apps/user-app/src/components/product/ProductVerticalFull.vue deleted file mode 100644 index 475e14f..0000000 --- a/apps/user-app/src/components/product/ProductVerticalFull.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - diff --git a/apps/user-app/src/components/ui/PageBar.vue b/apps/user-app/src/components/ui/PageBar.vue new file mode 100644 index 0000000..7091d20 --- /dev/null +++ b/apps/user-app/src/components/ui/PageBar.vue @@ -0,0 +1,115 @@ + + + + + + diff --git a/apps/user-app/src/composables/useProduct.ts b/apps/user-app/src/composables/useProduct.ts index 0abe7d1..eb09be6 100644 --- a/apps/user-app/src/composables/useProduct.ts +++ b/apps/user-app/src/composables/useProduct.ts @@ -1,7 +1,9 @@ // Adapts our actual ProductSummary (apps/user-app/src/api/client.ts) into the -// same output shape legacy's Mixins/product/index.ts `useProduct()` produced, -// so the ported product-card components (ProductHorizontal/ProductVertical/ -// ProductVerticalFull) can render unchanged. +// same output shape legacy's Mixins/product/index.ts `useProduct()` produced. +// The legacy card components it was originally shaped for (ProductHorizontal/ +// ProductVertical/ProductVerticalFull) are gone, replaced by the redesigned +// components/product/ProductCard.vue, components/home/ShowcaseCard.vue and +// components/product/CartItem.vue — all of which consume this same contract. // // Honest gaps vs. legacy (no backend equivalent exists yet — apps/api was not // touched to add these): diff --git a/apps/user-app/src/views/CartView.vue b/apps/user-app/src/views/CartView.vue index b2432bf..9e1d18c 100644 --- a/apps/user-app/src/views/CartView.vue +++ b/apps/user-app/src/views/CartView.vue @@ -1,89 +1,114 @@