Skip to content

feat(reviews): store reviews, verified-purchase reviews and the post-order prompt - #71

Merged
roncodes merged 1 commit into
release/v0.1.0from
feat/reviews
Oct 7, 2026
Merged

roncodes merged 1 commit into
release/v0.1.0from
feat/reviews

Conversation

@roncodes

@roncodes roncodes commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

This implements reviews from the redesign prototype. It's stacked on feat/services-booking and uses the verified-reviews API from fleetbase/storefront#115.

Store reviews (reviews.list, route StoreReviews)

  • Rating summary: the average, its stars, the review count, and a bar for each star level from reviews/count.
  • Your review: the viewer's own review (is_mine) is pinned at the top with Delete and a confirmation sheet.
  • List: Newest / Highest / Lowest / Oldest sorting. Each review shows an avatar (or monogram), name, how long ago, stars, text, photos and "Verified purchase". More reviews load as you scroll.
  • Footer: Write a review when the customer can, or the reason they can't:
    • sign in (with a sign-in button);
    • no completed order yet;
    • already reviewed their latest order.
  • Loading skeleton, error with retry, and an empty state.
  • Reachable from the store page: the rating line now reads "★ 4.3 Reviews" and is a link. It's hidden when reviews are turned off (options.reviews_enabled === false).

Write a review (reviews.write, route WriteReview)

  • Store card with the order number when opened from an order.
  • Rating: large stars with a word for each (Poor → Excellent).
  • Text with a character counter (the backend requires text, up to 2000 characters), and up to four photos from the library, each removable.
  • Checks eligibility first. When the customer can't review yet, the footer explains why, and offers a retry if the check itself failed.
  • Posting, failure-with-retry, and a thank-you screen with See your review / Back to shopping.

After an order

On a delivered or collected order, tracking asks "How was {store}?" with tappable stars. Tapping one opens the review form pre-filled with that rating and the order. If the order was already reviewed, it shows "You reviewed this order · View".

Shared code

  • src/commerce/reviews.ts: list, counts, eligibility, create and delete, plus the rating summary and relative times. Times fall back to a plain date where Intl.RelativeTimeFormat is missing.
  • useReviewRequest sends review calls as the signed-in customer (so is_mine and eligibility are about them) and anonymously otherwise.
  • StarInput in src/ui.
  • New screen ids reviews.list and reviews.write. Routes are added to the Network stacks (with a stores/:storeId/reviews deep link), the order stack and the single-store home stack.

Not included

  • Rating individual items in the prototype: the review list endpoint only lists store reviews, so item ratings wouldn't show anywhere yet.
  • Proof of delivery on the delivered screen: it belongs with tracking and needs a public proof endpoint.

Backend change in #115

Public review payloads included each reviewer's full name, email and phone number. #115 now returns "first name and last initial" (for example "Ada B.") and no contact details on public routes.

Testing

  • Unit tests: __tests__/commerce/reviews.test.ts.
  • yarn jest: 172 tests pass. yarn typecheck:strict is clean. yarn lint:strict has 0 errors, and now also covers the review screens.
  • Web preview against the local API's seeded reviews: summary, distribution and list on the store reviews screen.
  • Web preview of the write-review form opened with a 4-star prefill.
  • Not tested yet: eligibility, posting and deleting. The local API doesn't have #115 deployed.

…order prompt

- Store reviews: rating summary and distribution, the viewer's own review with
  delete, sortable reviews with photos and "Verified purchase", pagination, and
  a footer that offers "Write a review" or explains why not (sign in, no
  completed order, already reviewed).
- Write a review: stars with a word for each rating, text with a counter, up to
  four photos, eligibility checked first, posting and thank-you states.
- Entry points: the store page rating links to reviews; a delivered or collected
  order asks "How was {store}?" and opens the review with that rating.
- src/commerce/reviews.ts with tests; StarInput in src/ui; reviews.list and
  reviews.write screen ids.
Base automatically changed from feat/services-booking to release/v0.1.0 October 7, 2026 05:42
@roncodes
roncodes merged commit 71f3704 into release/v0.1.0 Oct 7, 2026
@roncodes
roncodes deleted the feat/reviews branch October 7, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant