Skip to content

Feat/herbatica review - #442

Merged
KaiUweCZE merged 9 commits into
masterfrom
feat/herbatica-review
Jun 14, 2026
Merged

Feat/herbatica review#442
KaiUweCZE merged 9 commits into
masterfrom
feat/herbatica-review

Conversation

@KaiUweCZE

@KaiUweCZE KaiUweCZE commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added a complete product reviews experience: listing with pagination, empty/error/loading states, and “write review” flow (including token-based review submission) with verified-purchase display where eligible.
    • Product detail tabs are now hash-aware and controlled, with smooth navigation to the reviews section.
    • Added fractional star ratings.
  • Documentation
    • Updated Herbatika-specific repository/agent guidelines, including local dev routing details.
  • Tests
    • Added coverage for server review-summary “repair” when summary data is inconsistent.
  • Style
    • Introduced review/rating design tokens and a related styling utility.

@semanticdiff-com

semanticdiff-com Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  apps/herbatika/src/lib/storefront/ssr/types.ts  92% smaller
  apps/herbatika/src/lib/storefront/storefront-config.ts  79% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-breadcrumb.css  76% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-radio-group.css  75% smaller
  apps/herbatika/src/lib/storefront/ssr/context.ts  63% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-product-card.css  61% smaller
  apps/herbatika/src/components/product-detail.tsx  59% smaller
  apps/herbatika/src/components/reviews/reviews-section.tsx  58% smaller
  apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts  56% smaller
  apps/herbatika/src/lib/storefront/storefront-server.ts  56% smaller
  apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx  40% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-radio-card.css  33% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-select.css  29% smaller
  libs/storefront-data/src/medusa/preset.ts  26% smaller
  libs/storefront-data/src/medusa/server-read.ts  19% smaller
  apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx  17% smaller
  libs/storefront-data/src/shared/use-delayed-prefetch-controller.ts  1% smaller
  AGENTS.md Unsupported file format
  apps/herbatika/AGENTS.md Unsupported file format
  apps/herbatika/src/app/reviews/product/[token]/page.tsx  0% smaller
  apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx  0% smaller
  apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts  0% smaller
  apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx  0% smaller
  apps/herbatika/src/components/reviews/fractional-rating.tsx  0% smaller
  apps/herbatika/src/components/reviews/product-review-errors.ts  0% smaller
  apps/herbatika/src/components/reviews/product-review-form.tsx  0% smaller
  apps/herbatika/src/components/reviews/product-review-token-page.tsx  0% smaller
  apps/herbatika/src/components/reviews/product-review-token-status.ts  0% smaller
  apps/herbatika/src/lib/storefront/review-query-config.ts  0% smaller
  apps/herbatika/src/lib/storefront/reviews.ts  0% smaller
  apps/herbatika/src/lib/storefront/storefront-core-definition.ts  0% smaller
  apps/herbatika/src/lib/storefront/storefront.ts  0% smaller
  apps/herbatika/src/styles/tokens/_herbatika-semantic.css  0% smaller
  apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css  0% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-accordion.css  0% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-carousel.css  0% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-dialog.css  0% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-search-form.css  0% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-steps.css  0% smaller
  apps/herbatika/src/styles/tokens/components/molecules/_herbatika-tabs.css  0% smaller
  libs/storefront-data/package.json  0% smaller
  libs/storefront-data/src/medusa/foundation.ts  0% smaller
  libs/storefront-data/src/reviews/hooks.ts  0% smaller
  libs/storefront-data/src/reviews/input-utils.ts  0% smaller
  libs/storefront-data/src/reviews/medusa-service.ts  0% smaller
  libs/storefront-data/src/reviews/query-keys.ts  0% smaller
  libs/storefront-data/src/reviews/query-options.ts  0% smaller
  libs/storefront-data/src/reviews/types.ts  0% smaller
  libs/storefront-data/tests/reviews.medusa-service.test.ts  0% smaller

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
new-engine-ui-storybook Ready Ready Preview, Comment Jun 14, 2026 4:30pm

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds a reviews domain and end-to-end app support: types, Medusa service, React Query factories/hooks, preset wiring and exports, SSR review prefetch, Herbatika UI components (metrics, reviews list, create dialog), tokens, and documentation updates.

Changes

Product Reviews Feature

Layer / File(s) Summary
Documentation and guidelines
AGENTS.md, apps/herbatika/AGENTS.md
Root and app AGENTS updated with Herbatika subtree precedence, dev port (http://localhost:3001), and skill-routing / guardrails.
Review types and contracts
libs/storefront-data/src/reviews/types.ts
Adds review/customer shapes, list input/response types, service and query-key interfaces, and React Query result/mutation typings.
Medusa service and list input utilities
libs/storefront-data/src/reviews/medusa-service.ts, libs/storefront-data/src/reviews/input-utils.ts, libs/storefront-data/tests/reviews.medusa-service.test.ts
Medusa-backed review service with summary-repair logic, input utilities to strip UI-only fields and compute pagination defaults, and service tests covering summary inconsistency repair and bounded fetch strategies.
Query keys, query options and hooks
libs/storefront-data/src/reviews/query-keys.ts, libs/storefront-data/src/reviews/query-options.ts, libs/storefront-data/src/reviews/hooks.ts
Query-key factory, query-options factory, and hook factory providing useProductReviews, useSuspenseProductReviews, usePrefetchProductReviews and useCreateProductReview; delayed prefetch controller upgraded to support async execution.
Storefront-data preset wiring & exports
libs/storefront-data/src/medusa/*, libs/storefront-data/package.json
Integrates reviews into foundation, preset and server-read wiring; exposes new ./reviews/* package exports.
Herbatika app storefront and SSR wiring
apps/herbatika/src/lib/storefront/*, apps/herbatika/src/lib/storefront/ssr/*
App-level query keys/config, server prefetch helpers/types, client barrel, and PRODUCT_REVIEWS_PAGE_SIZE (10); SSR prefetch of first reviews page.
Review UI primitives & tokens
apps/herbatika/src/components/reviews/*, apps/herbatika/src/styles/tokens/*
FractionalRating, updated ReviewsSection props/markup, review mapping utilities and new rating design tokens/utilities.
Review creation form & token page
apps/herbatika/src/components/reviews/product-review-*.ts/tsx
Form validation, error-message resolution with status/token heuristics, and product-token-scoped review submission page.
Product detail metrics, reviews list & create dialog
apps/herbatika/src/components/product-detail/sections/product-detail-*.tsx
ProductDetailMetrics fetches teaser reviews; ProductDetailReviews implements paginated list with states; ProductReviewCreateDialog provides mutation and success flow.
Product detail integration & navigation
apps/herbatika/src/components/product-detail.tsx, apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
ProductDetail now controls active section, responds to URL hash for reviews, and supports handleShowAllReviews to switch tab and scroll to reviews. Tabs become controlled with conditional reviews rendering.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ProductDetail
  participant ProductDetailMetrics
  participant ProductDetailReviews
  participant ProductReviewCreateDialog
  participant useProductReviews
  participant useCreateProductReview
  participant QueryClient
  participant MedusaService
  participant MedusaAPI

  User->>ProductDetail: open product page
  ProductDetail->>ProductDetailMetrics: render metrics (productId)
  ProductDetailMetrics->>useProductReviews: fetch teaser reviews
  useProductReviews->>QueryClient: useQuery(list options)
  QueryClient->>MedusaService: listProductReviews(productId, limit, offset)
  MedusaService->>MedusaAPI: GET /products/{id}/reviews
  MedusaAPI-->>MedusaService: reviews + summary
  MedusaService-->>QueryClient: resolved reviews
  QueryClient-->>ProductDetailMetrics: teaser data

  User->>ProductDetailMetrics: click "show all reviews"
  ProductDetail->>ProductDetailReviews: set active section + scroll to reviews

  User->>ProductDetailReviews: open create dialog
  ProductDetailReviews->>ProductReviewCreateDialog: open dialog
  User->>ProductReviewCreateDialog: submit review
  ProductReviewCreateDialog->>useCreateProductReview: mutate(create)
  useCreateProductReview->>MedusaAPI: POST /store/reviews
  MedusaAPI-->>useCreateProductReview: created review
  useCreateProductReview->>QueryClient: invalidate review queries
  QueryClient->>MedusaService: refetch list
  ProductDetailReviews-->>User: show updated reviews / success
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • TechsioCZ/new-engine#360: Related server-read preset infrastructure extended here for reviews prefetch and query-options composition.
  • TechsioCZ/new-engine#437: Corresponding backend review and token routes that this PR's client-side review listing/creation flows integrate with.
  • TechsioCZ/new-engine#378: Adds Medusa SDK dependencies needed to build the new libs/storefront-data/src/reviews/* modules and storefront-data exports.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Feat/herbatica review' is overly vague and does not clearly describe the main changes. It uses a generic prefix and a misspelled app name, providing insufficient context about the actual feature being implemented. Consider renaming to something more descriptive and specific, such as 'feat: implement product review system for Herbatika' or 'feat: add product reviews with token-based creation flow', following conventional commit conventions with proper capitalisation and clarity.
Docstring Coverage ⚠️ Warning Docstring coverage is 3.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/herbatica-review
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/herbatica-review

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a complete product reviews experience to the Herbatika storefront: a full-list view with URL-driven pagination (nuqs), a teaser section on the product metrics panel, a review-submission dialog for authenticated users, and a dedicated token-based review page for post-purchase email links.

  • Data layer (libs/storefront-data/src/reviews/): new generic createProductReviewHooks factory, createMedusaProductReviewService with smart summary-repair logic, and wiring into the existing Medusa preset and server-read preset.
  • Product detail: tabs and accordion converted to controlled state; ProductDetailReviews wrapped in <Suspense> via ProductDetailReviewsSlot; SSR prefetch extended to include the first page of reviews.
  • Token review page: standalone page that reads token + product_id from URL and submits via review_token; server validates token-product match so URL manipulation is safe.

Confidence Score: 4/5

Safe to merge once the dialog-dismissal race condition is addressed.

The dialog close-while-busy race means a user who dismisses via backdrop/ESC during an in-flight mutation will see the success screen on next open. That is the only current functional defect; SSR prefetch, cache sharing, Suspense wrapping, and token-page server-side validation are all implemented correctly.

apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx — handleOpenChange/isBusy race; apps/herbatika/src/components/product-detail.tsx — hash/scroll-reset ordering issue.

Important Files Changed

Filename Overview
libs/storefront-data/src/reviews/hooks.ts New hook factory for product reviews — generic, follows established factory pattern; uses semiStatic cache strategy by default (1h stale), which may be too long for user-generated content.
libs/storefront-data/src/reviews/medusa-service.ts New Medusa service for reviews; implements smart summary repair logic with REVIEW_SUMMARY_REPAIR_LIMIT=100 guard; well-tested.
apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx New dialog for review submission; correctly disables submit button while busy, but handleOpenChange can be triggered via backdrop/ESC while mutation is in-flight.
apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx Full review list with pagination, loading/error/empty/out-of-range states, nuqs-based URL pagination; correctly wrapped in Suspense via ProductDetailReviewsSlot.
apps/herbatika/src/components/product-detail.tsx Controlled tab state added; hash-based deep link to reviews tab implemented, but initial hash is cleared by scroll-reset effect before product loads.
apps/herbatika/src/components/reviews/product-review-token-page.tsx Token-based review submission page; correctly shows form even when product lookup fails (by design); handles all product status states.
apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts SSR prefetch extended to include first-page reviews; uses same params as client-side queries, ensuring cache hydration is reused without duplicate network requests.
libs/storefront-data/tests/reviews.medusa-service.test.ts Tests cover both the complete-set and paginated-set summary repair paths; assertions verify fetch call count and repaired summary values.

Fix All in Codex

Reviews (5): Last reviewed commit: "fix: remove review title" | Re-trigger Greptile

Comment thread apps/herbatika/src/components/reviews/fractional-rating.tsx Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css 7-12 Missing --color-rating-fg-active token definition. The FractionalRating component uses text-rating-fg-active (fractional-rating.tsx:55) but only --color-rating-fg-base is defined. The base figma tokens define --color-rating-fg-active: var(--color-warning) - this override must also define the active color or it will be undefined.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
libs/storefront-data/src/reviews/input-utils.ts 5-11 Function stripListInput duplicates stripListInput in medusa-service.ts:35-46 with identical logic (stripping enabled and page). This violates DRY - the shared version should be imported instead.

| libs/storefront-data/tests/reviews.medusa-service.test.ts | 99, 106 | Test expectations include signal: undefined which is correct, but consider using expect.anything() or omitting signal assertions to avoid coupling tests to implementation details. The signal parameter may become defined in future.

Files Reviewed (8 files)
  • apps/herbatika/src/components/reviews/fractional-rating.tsx - New component for fractional star rating display
  • apps/herbatika/src/components/reviews/reviews-section.tsx - Updated with new props and FractionalRating usage
  • apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css - Rating token overrides
  • libs/storefront-data/src/reviews/hooks.ts - Review hooks factory (TanStack Query)
  • libs/storefront-data/src/reviews/medusa-service.ts - Medusa review service implementation
  • libs/storefront-data/src/reviews/types.ts - Review type definitions
  • libs/storefront-data/tests/reviews.medusa-service.test.ts - Review service tests
  • libs/storefront-data/src/reviews/input-utils.ts - Input parameter utilities

@kilo-code-bot kilo-code-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS token issue - --color-rating-fg-active is missing

Comment thread apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css 8 Missing --color-rating-fg-active token definition. The FractionalRating component uses text-rating-fg-active (fractional-rating.tsx:55) but this token is not defined. The base figma tokens define --color-rating-fg-active: var(--color-warning) - this override must also define the active color.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
libs/storefront-data/src/reviews/input-utils.ts 5-11 stripListInput does NOT strip productId, but stripListInput in medusa-service.ts:35-46 DOES strip productId. This inconsistency is a potential bug - if the hooks use createDefaultListParams from input-utils.ts without a custom buildListParams, productId could be incorrectly included in query parameters sent to the API.

| libs/storefront-data/tests/reviews.medusa-service.test.ts | 99, 106 | Test expectations include signal: undefined which is correct, but consider using expect.anything() or omitting signal assertions to avoid coupling tests to implementation details.

Files Reviewed (8 files)
  • apps/herbatika/src/components/reviews/fractional-rating.tsx - New component for fractional star rating display
  • apps/herbatika/src/components/reviews/reviews-section.tsx - Updated with new props and FractionalRating usage
  • apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css - Rating token overrides
  • libs/storefront-data/src/reviews/hooks.ts - Review hooks factory (TanStack Query)
  • libs/storefront-data/src/reviews/medusa-service.ts - Medusa review service implementation
  • libs/storefront-data/src/reviews/types.ts - Review type definitions
  • libs/storefront-data/tests/reviews.medusa-service.test.ts - Review service tests
  • libs/storefront-data/src/reviews/input-utils.ts - Input parameter utilities

@kilo-code-bot

kilo-code-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css 8 Missing --color-rating-fg-active token definition. The FractionalRating component uses text-rating-fg-active (fractional-rating.tsx:55) but this token is not defined. The base figma tokens define --color-rating-fg-active: var(--color-warning) - this override must also define the active color or stars won't render with the correct color.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
libs/storefront-data/tests/reviews.medusa-service.test.ts 99, 106 Test expectations include signal: undefined which is correct, but consider using expect.anything() or omitting signal assertions to avoid coupling tests to implementation details. The signal parameter may become defined in future.
Files Reviewed (8 files)
  • apps/herbatika/src/components/reviews/fractional-rating.tsx - New component for fractional star rating display
  • apps/herbatika/src/components/reviews/reviews-section.tsx - Updated with new props and FractionalRating usage
  • apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css - Rating token overrides
  • libs/storefront-data/src/reviews/hooks.ts - Review hooks factory (TanStack Query)
  • libs/storefront-data/src/reviews/medusa-service.ts - Medusa review service implementation
  • libs/storefront-data/src/reviews/types.ts - Review type definitions
  • libs/storefront-data/tests/reviews.medusa-service.test.ts - Review service tests
  • libs/storefront-data/src/reviews/input-utils.ts - Input parameter utilities

@kilo-code-bot

kilo-code-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • apps/herbatika/src/components/reviews/reviews-section.tsx

Reviewed by nex-n2-pro:free · 607,403 tokens

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx`:
- Around line 63-66: The onLinkClick handler currently always calls
event.preventDefault(), breaking native hash navigation when no callback is
provided; change the handler to only call event.preventDefault() and
onShowAllReviews() when onShowAllReviews is defined (e.g., if (onShowAllReviews)
{ event.preventDefault(); onShowAllReviews(); }) so that when onShowAllReviews
is undefined the link falls back to normal hash navigation; update the inline
handler where onLinkClick is defined to use this conditional check referencing
onShowAllReviews.

In
`@apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx`:
- Around line 39-309: The component ProductReviewCreateDialog bundles UI,
validation and submit orchestration; extract validateReviewForm and
resolveReviewSubmitErrorMessage into pure helper modules (e.g.
reviewValidation.ts and reviewErrors.ts) and move submission logic
(createReviewMutation usage, isBusy/isSubmitted/submitError state and
handleSubmit/handleOpenChange side-effects) into a custom hook (e.g.
useReviewForm or useSubmitReview) that exposes values, setValues, errors,
setErrors, isBusy, isSubmitted, submitError, handleSubmit and handleOpenChange;
update ProductReviewCreateDialog to only import the helpers and call the hook,
keep rendering intact. Ensure references to ReviewFormValues/ReviewFormErrors,
REVIEW_FORM_ID, REVIEW_CONTENT_MIN_LENGTH, resolveReviewSubmitErrorMessage,
validateReviewForm, createReviewMutation (or its hook useCreateProductReview)
are preserved when moving logic so tests and callers can find them.

In
`@apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx`:
- Around line 152-184: The component must clamp out-of-range review pages: after
useProductReviews (reviewsQuery) returns totalPages, check if currentPage
(resolved by resolveReviewsPage) > reviewsQuery.totalPages and, if so, compute
the valid URL with getReviewPageUrl({page: reviewsQuery.totalPages}) and update
the browser/location (e.g., router.replace or history.replaceState) to that URL
so the component renders the last page of reviews instead of an empty list;
ensure this guard runs once totalPages is known and avoid infinite loops by only
redirecting when the page is actually out-of-range.

In `@libs/storefront-data/src/reviews/hooks.ts`:
- Around line 229-231: The delayed prefetch passes an async callback to
schedulePrefetch which schedules it via setTimeout without handling rejections;
to fix, wrap the call to prefetchProductReviews in a rejection-safe wrapper or
update schedulePrefetch to handle returned promises. Concretely, change the call
site that currently passes () => prefetchProductReviews(input) so it instead
invokes prefetchProductReviews(input) and catches errors (e.g., () =>
prefetchProductReviews(input).catch(err => /* handle/log */)), or modify
schedulePrefetch to detect a returned Promise and await it inside a try/catch;
reference the functions schedulePrefetch, prefetchProductReviews, and
queryClient.prefetchQuery when locating the code to update.

In `@libs/storefront-data/src/reviews/medusa-service.ts`:
- Around line 82-135: Add concise inline comments in the listProductReviews
function to document the "summary repair" behavior: explain when
hasInconsistentSummary triggers, why we refetch with limit: response.count (up
to REVIEW_SUMMARY_REPAIR_LIMIT) to get a complete review set, and that
calculateReviewSummary is used to recalc the summary when hasCompleteReviewSet
returns true; place these comments immediately above the conditional block that
uses hasInconsistentSummary and the subsequent fetch so readers can quickly
understand the intent and safeguards.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2bde2d58-9f71-49e7-b573-4d986ed1397c

📥 Commits

Reviewing files that changed from the base of the PR and between 4e6a199 and 4ffe2de.

📒 Files selected for processing (32)
  • AGENTS.md
  • apps/herbatika/AGENTS.md
  • apps/herbatika/src/components/product-detail.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/ssr/context.ts
  • apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts
  • apps/herbatika/src/lib/storefront/ssr/types.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/styles/tokens/_herbatika-semantic.css
  • apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css
  • libs/storefront-data/package.json
  • libs/storefront-data/src/medusa/foundation.ts
  • libs/storefront-data/src/medusa/preset.ts
  • libs/storefront-data/src/medusa/server-read.ts
  • libs/storefront-data/src/reviews/hooks.ts
  • libs/storefront-data/src/reviews/input-utils.ts
  • libs/storefront-data/src/reviews/medusa-service.ts
  • libs/storefront-data/src/reviews/query-keys.ts
  • libs/storefront-data/src/reviews/query-options.ts
  • libs/storefront-data/src/reviews/types.ts
  • libs/storefront-data/tests/reviews.medusa-service.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Greptile Review
  • GitHub Check: Kilo Code Review
🧰 Additional context used
📓 Path-based instructions (14)
apps/herbatika/**

📄 CodeRabbit inference engine (AGENTS.md)

For Herbatika app work, read apps/herbatika/AGENTS.md before editing, as it overrides the root frontend-demo server assumption with http://localhost:3001 runtime and routes work through libs/ui/skills and libs/storefront-data/skills workflows

Files:

  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/styles/tokens/_herbatika-semantic.css
  • apps/herbatika/src/lib/storefront/ssr/types.ts
  • apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/ssr/context.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
  • apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css
  • apps/herbatika/AGENTS.md
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/product-detail.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
apps/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/**/*.{ts,tsx,js,jsx}: Use @techsio/ui-kit/... import pattern for runtime app imports from UI library (e.g., @techsio/ui-kit/atoms/button, @techsio/ui-kit/molecules/dialog)
Use Modern.js from Bytedance as the preferred frontend framework, though Next.js 15+ can sometimes be used

Files:

  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/lib/storefront/ssr/types.ts
  • apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/ssr/context.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/product-detail.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
apps/herbatika/src/{app,components,lib}/**/*.{tsx,ts}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

apps/herbatika/src/{app,components,lib}/**/*.{tsx,ts}: Use internal UI primitives/components first from @techsio/ui-kit, not native controls such as <button>, <input>, <select>, <textarea>, <img>, or inline SVG icons in app code unless there is a documented exception
For Next.js links/images, prefer the UI-kit component with next/link or next/image adapter support when that component exposes it
Use token-based utility classes like p-200 mt-300 gap-150 text-success bg-danger, not raw Tailwind palette/spacing values like p-4 mt-8 gap-4 bg-red-600 text-green-300
Prefer the preset surface from @techsio/storefront-data: shared hooks, flows, query keys, query options, cache policy, and SSR helpers

Files:

  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/lib/storefront/ssr/types.ts
  • apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/ssr/context.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/product-detail.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
apps/herbatika/src/lib/storefront/*.ts

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Herbatika composes the shared data layer in src/lib/storefront/storefront.ts and adjacent storefront-definition* files

Files:

  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
apps/herbatika/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Use explicit package subpath imports; do not import from package roots or dist/

Files:

  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/lib/storefront/ssr/types.ts
  • apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/ssr/context.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/product-detail.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
apps/herbatika/src/{app,lib}/**/*.{tsx,ts}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Keep server-only and client-only boundaries explicit; use server-only and getServerQueryClient for Server Component/SSR data paths

Files:

  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/lib/storefront/ssr/types.ts
  • apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/ssr/context.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
apps/herbatika/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Keep naming explicit and consistent: use kebab-case for files and PascalCase for React components in Herbatika app code

Files:

  • apps/herbatika/src/lib/storefront/storefront-core-definition.ts
  • apps/herbatika/src/lib/storefront/review-query-config.ts
  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/lib/storefront/ssr/types.ts
  • apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/lib/storefront/storefront.ts
  • apps/herbatika/src/lib/storefront/reviews.ts
  • apps/herbatika/src/lib/storefront/storefront-config.ts
  • apps/herbatika/src/lib/storefront/ssr/context.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts
  • apps/herbatika/src/lib/storefront/storefront-server.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/product-detail.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
apps/herbatika/src/styles/tokens/**/*.css

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Put Herbatika visual differences in src/styles/tokens/** and avoid JSX className overrides that duplicate UI-kit component props/tokens

Files:

  • apps/herbatika/src/styles/tokens/_herbatika-semantic.css
  • apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css
**/package.json

📄 CodeRabbit inference engine (CLAUDE.md)

Use pnpm CLI to add dependencies; never edit package.json directly

Files:

  • libs/storefront-data/package.json
libs/storefront-data/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)

libs/storefront-data/src/**/*.{ts,tsx}: Do not import from ./dist/ paths - use source files instead
Do not hardcode query keys - use createQueryKey() utility instead
Do not mix server and client code in the same file
Use cache strategies from CacheConfig (static, semiStatic, realtime, userData) for query configuration
Use TanStack Query 5+ for data fetching, caching, and SSR hydration in @techsio/storefront-data

Files:

  • libs/storefront-data/src/reviews/input-utils.ts
  • libs/storefront-data/src/reviews/query-keys.ts
  • libs/storefront-data/src/reviews/query-options.ts
  • libs/storefront-data/src/medusa/foundation.ts
  • libs/storefront-data/src/reviews/types.ts
  • libs/storefront-data/src/reviews/hooks.ts
  • libs/storefront-data/src/reviews/medusa-service.ts
  • libs/storefront-data/src/medusa/server-read.ts
  • libs/storefront-data/src/medusa/preset.ts
libs/storefront-data/**/*.{ts,tsx}

📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)

Do not use any type - use proper generics instead

Files:

  • libs/storefront-data/src/reviews/input-utils.ts
  • libs/storefront-data/src/reviews/query-keys.ts
  • libs/storefront-data/src/reviews/query-options.ts
  • libs/storefront-data/src/medusa/foundation.ts
  • libs/storefront-data/src/reviews/types.ts
  • libs/storefront-data/src/reviews/hooks.ts
  • libs/storefront-data/src/reviews/medusa-service.ts
  • libs/storefront-data/src/medusa/server-read.ts
  • libs/storefront-data/src/medusa/preset.ts
  • libs/storefront-data/tests/reviews.medusa-service.test.ts
libs/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use @libs/ui/... import alias only in projects that define and verify that alias explicitly in their configuration

Files:

  • libs/storefront-data/src/reviews/input-utils.ts
  • libs/storefront-data/src/reviews/query-keys.ts
  • libs/storefront-data/src/reviews/query-options.ts
  • libs/storefront-data/src/medusa/foundation.ts
  • libs/storefront-data/src/reviews/types.ts
  • libs/storefront-data/src/reviews/hooks.ts
  • libs/storefront-data/src/reviews/medusa-service.ts
  • libs/storefront-data/src/medusa/server-read.ts
  • libs/storefront-data/src/medusa/preset.ts
  • libs/storefront-data/tests/reviews.medusa-service.test.ts
libs/storefront-data/src/**/types.ts

📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)

Type service interfaces with generics in @techsio/storefront-data

Files:

  • libs/storefront-data/src/reviews/types.ts
libs/storefront-data/src/**/hooks.ts

📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)

Always use factory pattern for hooks (e.g., createProductHooks, createCollectionHooks, etc.)

Files:

  • libs/storefront-data/src/reviews/hooks.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:45.733Z
Learning: Always use pnpm CLI commands for package management: `pnpm add <package>`, `pnpm add -D <package>`, `pnpm add -w <package>` instead of editing package.json directly
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:45.733Z
Learning: Run Biome linting and formatting only on the files or paths that were changed using `bunx biome check --write path/to/file.tsx`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:45.733Z
Learning: Never ask to run `pnpm dev` or check if the dev server is running; always assume the development server is already running on http://localhost:3000 for frontend-demo, except for `apps/herbatika` which uses http://localhost:3001
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:45.733Z
Learning: The project is an Nx monorepo with pnpm for package management and Nx for orchestrating builds and development workflows
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:57.077Z
Learning: Keep app-local code thin: SDK instance, field defaults, localized text, toasts, analytics, form DTOs, address adapters, and Herbatika-specific read models can stay here; move repeated backend communication, query key construction, cache sync, mutation invalidation, or reusable Medusa behavior into `libs/storefront-data`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:57.077Z
Learning: Soft limit: ~200 lines per source file. Exceeding it is a red flag and should trigger refactor consideration
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:57.077Z
Learning: For manual QA in Herbatika, use skill `local-web-testing` and perform minimum checks: user flow smoke pass + DevTools Console + Network + visual regression review; save evidence to `.qa/local-web-testing-YYYY-MM-DD/`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:57.077Z
Learning: Temporarily do not run Biome commands in Herbatika app until stability issue is resolved
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-12T16:52:57.077Z
Learning: From `apps/herbatika`, `pnpm dev` runs the app on `http://localhost:3001`; from the repo root, prefer `pnpm -C apps/herbatika <script>` for app scripts
📚 Learning: 2025-12-16T19:45:17.746Z
Learnt from: BleedingDev
Repo: NMIT-WR/new-engine PR: 207
File: libs/ui/src/molecules/select.tsx:50-50
Timestamp: 2025-12-16T19:45:17.746Z
Learning: When reviewing Tailwind classes in TSX/TS files, prefer using square brackets for arbitrary CSS values and complex expressions. Specifically: - Do not use the parentheses syntax (z-(--z-index)) for anything beyond simple CSS variable references; this syntax auto-wraps in var() and cannot handle calc or complex functions. - Use the square brackets syntax (e.g., h-[calc(var(--available-height)-var(--spacing-content))]) for calc expressions, var with calc, and any complex CSS expressions. This rule applies broadly to Tailwind v4 usage in TSX code across the project.

Applied to files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/product-detail.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
📚 Learning: 2026-02-05T14:43:17.404Z
Learnt from: KaiUweCZE
Repo: NMIT-WR/new-engine PR: 324
File: apps/medusa-be/package.json:0-0
Timestamp: 2026-02-05T14:43:17.404Z
Learning: Validate and enforce React 19 compatibility across monorepo workspaces. Since Medusa UI supports React 19 via root package.json overrides and Medusa Cloud prerequisites show React 19 overrides for npm workspaces, ensure workspace root and all relevant package.json files align with React 19 (18+ requirement is satisfied). When reviewing, verify that overrides exist in the root package.json and that dependent packages in apps or packages directories declare React 19 (or compatible) in their peerDependencies or dependencies as appropriate for workspace usage.

Applied to files:

  • libs/storefront-data/package.json
📚 Learning: 2026-05-07T19:05:58.339Z
Learnt from: redeyecz
Repo: TechsioCZ/new-engine PR: 390
File: apps/medusa-be/package.json:78-81
Timestamp: 2026-05-07T19:05:58.339Z
Learning: When reviewing changes to `package.json`, do not automatically flag dependency additions/removals as "manually edited" or as "bypassing the pnpm lockfile" just because the `package.json` diff shows only that file changed. First verify whether `pnpm-lock.yaml` is missing the corresponding entries. Since `pnpm add` updates both `package.json` and `pnpm-lock.yaml` together, legitimate changes can appear in the `package.json` diff while still being properly tracked in the lockfile.

Applied to files:

  • libs/storefront-data/package.json
🪛 markdownlint-cli2 (0.22.1)
AGENTS.md

[warning] 21-21: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

apps/herbatika/AGENTS.md

[warning] 3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 10-10: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 18-18: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 26-26: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 40-40: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 48-48: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🪛 Stylelint (17.12.0)
apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css

[error] 11-11: Unexpected unknown at-rule "@utility" (scss/at-rule-no-unknown)

(scss/at-rule-no-unknown)

🔇 Additional comments (36)
AGENTS.md (1)

35-38: docs: validate:ui-primitives / validate:guardrails do exist in the repo.

The referenced scripts aren’t limited to token validation: validate:ui-primitives and validate:guardrails are defined in apps/herbatika/package.json (with validate:guardrails chaining pnpm validate:token-usage and pnpm validate:ui-primitives).
So the “dead ends” concern is only valid if AGENTS.md expects these commands from the repo root rather than from that workspace/package context.

libs/storefront-data/src/reviews/types.ts (1)

1-106: LGTM!

libs/storefront-data/src/reviews/input-utils.ts (2)

5-11: LGTM!


13-39: LGTM!

libs/storefront-data/src/reviews/medusa-service.ts (4)

35-46: LGTM!


48-62: LGTM!


64-69: LGTM!


137-148: LGTM!

libs/storefront-data/tests/reviews.medusa-service.test.ts (4)

5-31: LGTM!


33-44: LGTM!


46-68: LGTM!


70-113: LGTM!

libs/storefront-data/package.json (1)

261-280: LGTM!

libs/storefront-data/src/medusa/foundation.ts (3)

49-53: LGTM!


80-80: LGTM!


120-122: LGTM!

libs/storefront-data/src/reviews/query-keys.ts (1)

5-18: LGTM!

libs/storefront-data/src/reviews/query-options.ts (1)

48-88: LGTM!

libs/storefront-data/src/medusa/preset.ts (1)

146-159: LGTM!

Also applies to: 278-284, 310-313, 475-480, 566-566, 646-650, 803-803, 834-839, 878-878, 1011-1021

libs/storefront-data/src/medusa/server-read.ts (1)

77-91: LGTM!

Also applies to: 176-185, 260-260, 277-280, 360-365, 406-406, 451-454, 519-519, 559-562, 620-626

apps/herbatika/src/lib/storefront/review-query-config.ts (1)

1-1: LGTM!

apps/herbatika/src/lib/storefront/reviews.ts (1)

1-20: LGTM!

apps/herbatika/src/styles/tokens/_herbatika-semantic.css (1)

29-29: LGTM!

apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css (1)

11-13: Allow Tailwind v4 @utility in Stylelint (potential gate failure on line 11)

apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.css contains:

`@utility` rating-star-fill {
    inline-size: var(--star-fill);
}

.stylelintrc.json only extends stylelint-config-standard-scss and doesn’t set ignoreAtRules / atRuleNoUnknown, so whether Stylelint accepts @utility (vs @theme) depends on the upstream config. Add an allow-list/ignore for Tailwind v4 at-rules (e.g. @utility, @theme) or scope a /* stylelint-disable scss/at-rule-no-unknown */ to the @utility block.

--color-herbatika-slate is defined in apps/herbatika/src/styles/tokens/_herbatika-semantic.css, so that token reference is fine.

apps/herbatika/src/lib/storefront/storefront-config.ts (1)

42-43: LGTM!

Also applies to: 173-175

apps/herbatika/src/lib/storefront/storefront-core-definition.ts (1)

41-43: LGTM!

apps/herbatika/src/lib/storefront/storefront-server.ts (1)

22-22: LGTM!

Also applies to: 60-62, 123-132

apps/herbatika/src/lib/storefront/storefront.ts (1)

39-41: LGTM!

apps/herbatika/src/lib/storefront/ssr/context.ts (1)

10-10: LGTM!

Also applies to: 22-22, 75-80

apps/herbatika/src/lib/storefront/ssr/prefetch-product.ts (1)

15-15: LGTM!

Also applies to: 18-18, 36-42

apps/herbatika/src/lib/storefront/ssr/types.ts (1)

2-2: LGTM!

Also applies to: 14-14

apps/herbatika/src/components/product-detail/sections/product-detail-review-utils.ts (1)

1-49: LGTM!

apps/herbatika/src/components/reviews/fractional-rating.tsx (1)

1-66: LGTM!

apps/herbatika/src/components/reviews/reviews-section.tsx (1)

8-197: LGTM!

apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx (1)

7-121: LGTM!

apps/herbatika/src/components/product-detail.tsx (1)

7-155: LGTM!

Comment thread apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx Outdated
Comment thread libs/storefront-data/src/reviews/hooks.ts
Comment thread libs/storefront-data/src/reviews/medusa-service.ts
@BleedingDev

Copy link
Copy Markdown
Collaborator

@KaiUweCZE please check this branch, fix all comments, so that we can merge it.

Comment thread apps/herbatika/src/components/product-detail.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx`:
- Around line 22-32: In ProductDetailReviewsSlot, replace the Suspense
fallback={null} with a visible fallback (e.g.
fallback={<ProductDetailReviewsSkeleton />}), import
ProductDetailReviewsSkeleton from product-detail-reviews.tsx, and if that symbol
isn't exported yet, export it from product-detail-reviews.tsx; alternatively use
a minimal loading indicator component as the fallback to improve perceived
performance.

In `@apps/herbatika/src/components/reviews/fractional-rating.tsx`:
- Line 25: In the FractionalRating component remove the redundant
"pointer-events-none" from the root span's class list (the element that
currently has className="inline-flex items-center relative gap-rating-lg
text-rating-lg pointer-events-none") and keep the existing "pointer-events-none"
on the overlay element (the filled-overlay at the overlay rendering around line
43); no other changes are required—just delete the token from the root span's
className so the overlay-level declaration controls pointer events.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ad5f646c-ee12-4719-8bab-a70a9dfa84fc

📥 Commits

Reviewing files that changed from the base of the PR and between 4ffe2de and 109f2cd.

📒 Files selected for processing (6)
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/reviews/reviews-section.tsx
  • libs/storefront-data/src/shared/use-delayed-prefetch-controller.ts
💤 Files with no reviewable changes (1)
  • apps/herbatika/src/components/reviews/reviews-section.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Greptile Review
  • GitHub Check: Kilo Code Review
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: In apps/herbatika, follow the guidelines in apps/herbatika/AGENTS.md which overrides the root frontend-demo server assumption with Herbatika's http://localhost:3001 runtime and routes work through libs/ui/skills and libs/storefront-data/skills workflows
Import UI components from @techsio/ui-kit/ namespace using the pattern @techsio/ui-kit/atoms/... or @techsio/ui-kit/molecules/... for atoms and molecules respectively
Use Zag.js for building React UI components with custom styling via Tailwind CSS
Run Biome linting and formatting only on changed files or paths using bunx biome check --write path/to/file.tsx

Files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • libs/storefront-data/src/shared/use-delayed-prefetch-controller.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Modern.js from Bytedance as the preferred framework for frontend work; Next.js 15+ can be used as an alternative

Files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • libs/storefront-data/src/shared/use-delayed-prefetch-controller.ts
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
apps/herbatika/src/{app,components,lib}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

apps/herbatika/src/{app,components,lib}/**/*.{ts,tsx}: Use internal UI primitives/components from @techsio/ui-kit instead of native HTML elements in app code; avoid raw <button>, <input>, <select>, <textarea>, <img>, and inline SVG icons
For Next.js links/images, prefer the UI-kit component with next/link or next/image adapter support when that component exposes it
Use token-based utility classes instead of raw Tailwind palette/spacing values; prefer classes like p-200 mt-300 gap-150 text-success bg-danger over p-4 mt-8 gap-4 bg-red-600 text-green-300
Use the preset surface from @techsio/storefront-data: shared hooks, flows, query keys, query options, cache policy, and SSR helpers
Keep server-only and client-only boundaries explicit; use server-only and getServerQueryClient for Server Component/SSR data paths

Files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
apps/herbatika/src/{app,components,lib,styles}/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Put Herbatika visual differences in src/styles/tokens/**; avoid JSX className overrides that duplicate UI-kit component props/tokens

Files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
apps/herbatika/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

apps/herbatika/src/**/*.{ts,tsx}: Use explicit package subpath imports; do not import from package roots or dist/
Soft limit of ~200 lines per source file; exceeding it is a red flag and should trigger refactor consideration

Files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
apps/herbatika/src/components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Use kebab-case for file names and PascalCase for React component names

Files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
libs/storefront-data/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)

libs/storefront-data/src/**/*.{ts,tsx}: Do not import from ./dist/ paths - use source files instead
Do not hardcode query keys - use createQueryKey() utility instead
Do not mix server and client code in the same file
Use cache strategies from CacheConfig (static, semiStatic, realtime, userData) for query configuration
Use TanStack Query 5+ for data fetching, caching, and SSR hydration in @techsio/storefront-data

Files:

  • libs/storefront-data/src/shared/use-delayed-prefetch-controller.ts
libs/storefront-data/**/*.{ts,tsx}

📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)

Do not use any type - use proper generics instead

Files:

  • libs/storefront-data/src/shared/use-delayed-prefetch-controller.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:23.810Z
Learning: Always assume the development server is already running on http://localhost:3000 for frontend-demo; never ask to run `pnpm dev` or check if the dev server is running
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:23.810Z
Learning: Use Nx for orchestrating builds and development workflows in the monorepo
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:23.810Z
Learning: Use pnpm for package management in the monorepo
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:23.810Z
Learning: This is an Nx monorepo for an e-commerce platform built with Medusa.js, structured with `apps/` for application projects and `libs/` for shared libraries
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:23.810Z
Learning: Medusa.js v2 is used for the backend; TanStack Query + Medusa storefront data layer is used in `libs/storefront-data`; RSLib is used for library builds
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:23.810Z
Learning: Use Vitest for testing backend and UI library components; comprehensive test coverage is planned
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Run guardrails validation before handing off: `pnpm validate:token-usage`, `pnpm validate:ui-primitives`, or `pnpm validate:guardrails`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Keep app-local code thin: SDK instance, field defaults, localized text, toasts, analytics, form DTOs, address adapters, and Herbatika-specific read models should remain app-local
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Move repeated backend communication, query key construction, cache sync, mutation invalidation, or reusable Medusa behavior into `libs/storefront-data`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: From `apps/herbatika`, `pnpm dev` runs the app on `http://localhost:3001`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Do not use the root frontend-demo `localhost:3000` assumption for this app; use `localhost:3001` instead
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Do not run Biome commands in this app until stability issue is resolved
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Prefer small composable modules and shared helpers over duplicated logic
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: For app UI work that consumes `techsio/ui-kit`, read `libs/ui/skills/ui-kit-workflow-orchestrator/SKILL.md` first and route through `component-usage-ux`, component-specific `*-usage` skill, `framework-consumer-integration`, `app-token-overrides`, and `app-ui-kit-audit`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: For storefront data work involving `techsio/storefront-data`, read `libs/storefront-data/skills/use-storefront-data-skills/SKILL.md` first and pick the smallest relevant follow-up skill
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: This file (`apps/herbatika/AGENTS.md`) applies to `apps/herbatika` and overrides the root `AGENTS.md` unless explicitly stated otherwise
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: If work touches `libs/ui` or `libs/storefront-data`, follow their local `AGENTS.md` as the source of truth for library code
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Keep app-specific behavior in this app; promote behavior into a library only when the shared package has a real API/platform gap
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: You may read `local/` reference material, but do not edit ignored local workspace files unless the user explicitly asks
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: For manual QA testing, use skill `local-web-testing` with minimum checks including user flow smoke pass, DevTools Console, Network tab, and visual regression review
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-13T15:21:41.379Z
Learning: Save QA evidence to `.qa/local-web-testing-YYYY-MM-DD/` including screenshots and JSON/text notes
📚 Learning: 2025-12-16T19:45:17.746Z
Learnt from: BleedingDev
Repo: NMIT-WR/new-engine PR: 207
File: libs/ui/src/molecules/select.tsx:50-50
Timestamp: 2025-12-16T19:45:17.746Z
Learning: When reviewing Tailwind classes in TSX/TS files, prefer using square brackets for arbitrary CSS values and complex expressions. Specifically: - Do not use the parentheses syntax (z-(--z-index)) for anything beyond simple CSS variable references; this syntax auto-wraps in var() and cannot handle calc or complex functions. - Use the square brackets syntax (e.g., h-[calc(var(--available-height)-var(--spacing-content))]) for calc expressions, var with calc, and any complex CSS expressions. This rule applies broadly to Tailwind v4 usage in TSX code across the project.

Applied to files:

  • apps/herbatika/src/components/reviews/fractional-rating.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx
🔇 Additional comments (6)
libs/storefront-data/src/shared/use-delayed-prefetch-controller.ts (1)

18-31: LGTM!

apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsx (1)

63-70: LGTM!

apps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsx (2)

187-199: LGTM!


35-45: Review: Confirm nuqs parser/serializer null handling matches the docs

  • Check that reviewPageParser.createParser(...).withDefault(1) returns 1 when parse() yields null.
  • Check that createSerializer omits REVIEW_PAGE_PARAM from the URL when you serialise { [REVIEW_PAGE_PARAM]: null } (page <= 1 ? null : page).
  • The repo uses nuqs ^2.8.8, but the repo-wide scan failed on the --type=tsx flag, so the null/omission semantics still need to be matched against nuqs’ documentation (or a correctly configured search).
apps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsx (2)

34-97: LGTM!


100-131: LGTM!

Comment thread apps/herbatika/src/components/reviews/fractional-rating.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx (1)

54-61: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prevent close-state races while submit mutation is pending.

The dialog can be closed during an in-flight submit, then onSuccess updates state afterwards and leaves stale success state for the next open. Guard handleOpenChange so close requests are ignored while isBusy.

Suggested patch
   const handleOpenChange = ({ open }: { open: boolean }) => {
+    if (!open && isBusy) {
+      return;
+    }
     setIsOpen(open);

     if (!open) {
       setFormResetKey((current) => current + 1);
       setIsSubmitted(false);
       setSubmitError(null);
     }
   };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx`
around lines 54 - 61, In the handleOpenChange function, add a guard condition to
prevent closing the dialog while a submit mutation is in flight. When the open
parameter is false (indicating a close request), check the isBusy flag and only
proceed with the state reset operations (setFormResetKey, setIsSubmitted,
setSubmitError) if isBusy is false. This prevents stale success state from
persisting to the next dialog open when the dialog is closed during an in-flight
submit mutation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/herbatika/src/components/reviews/product-review-token-page.tsx`:
- Around line 36-42: The useProducts hook call in product-review-token-page.tsx
is passing the enabled property as part of the input object (first argument),
but according to the hook's contract in
apps/herbatika/src/lib/storefront/products.ts, it should be passed in the
options object (second argument). Extract the enabled property from the input
object passed to useProducts and add it as a separate options argument, keeping
all other properties in the input object. This ensures the query only executes
when normalizedProductId has a valid value, preventing unrelated product blocks
from rendering.

---

Outside diff comments:
In
`@apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx`:
- Around line 54-61: In the handleOpenChange function, add a guard condition to
prevent closing the dialog while a submit mutation is in flight. When the open
parameter is false (indicating a close request), check the isBusy flag and only
proceed with the state reset operations (setFormResetKey, setIsSubmitted,
setSubmitError) if isBusy is false. This prevents stale success state from
persisting to the next dialog open when the dialog is closed during an in-flight
submit mutation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: be8f0c0a-073c-447f-a936-a217ef84564b

📥 Commits

Reviewing files that changed from the base of the PR and between 52c4836 and 61611b3.

📒 Files selected for processing (7)
  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-token-status.ts
  • apps/herbatika/src/components/reviews/reviews-section.tsx
💤 Files with no reviewable changes (1)
  • apps/herbatika/src/components/reviews/reviews-section.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Greptile Review
  • GitHub Check: main
  • GitHub Check: Kilo Code Review
🧰 Additional context used
📓 Path-based instructions (6)
apps/herbatika/**

📄 CodeRabbit inference engine (AGENTS.md)

When touching apps/herbatika, read apps/herbatika/AGENTS.md before editing, as it overrides the root frontend-demo server assumption with Herbatika's http://localhost:3001 runtime and routes work through the libs/ui/skills and libs/storefront-data/skills workflows

Files:

  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/components/reviews/product-review-token-status.ts
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
apps/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Import UI library components from the workspace package contract using @techsio/ui-kit/atoms/... or @techsio/ui-kit/molecules/... pattern. Do not use @libs/ui/... unless the project explicitly defines and verifies that alias

Files:

  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/components/reviews/product-review-token-status.ts
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
apps/{medusa-demo,medusa-fe,herbatika}/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Modern.js as the preferred frontend framework, though Next.js 15+ can be used when necessary

Files:

  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/components/reviews/product-review-token-status.ts
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
apps/herbatika/src/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

apps/herbatika/src/**/*.{js,jsx,ts,tsx}: Use internal UI primitives/components first from @techsio/ui-kit in app code, avoiding raw <button>, <input>, <select>, <textarea>, <img>, and inline SVG icons unless documented otherwise
For Next.js links and images, prefer the UI-kit component with next/link or next/image adapter support when that component exposes it
Use token-based utility classes instead of raw Tailwind palette/spacing values (prefer p-200 mt-300 gap-150 text-success bg-danger over p-4 mt-8 gap-4 bg-red-600 text-green-300)

Files:

  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/components/reviews/product-review-token-status.ts
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
apps/herbatika/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

apps/herbatika/src/**/*.{ts,tsx,js,jsx}: Use explicit package subpath imports from @techsio/storefront-data and do not import from package roots or dist/
Prefer small composable modules and shared helpers over duplicated logic with a soft limit of ~200 lines per source file
Use kebab-case for file names and PascalCase for React component names

Files:

  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/components/reviews/product-review-token-status.ts
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
apps/herbatika/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)

Keep server-only and client-only boundaries explicit using server-only and getServerQueryClient for Server Component/SSR data paths

Files:

  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/components/reviews/product-review-token-status.ts
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:29.338Z
Learning: Always use CLI commands to install packages, never edit package.json directly. Use `pnpm add <package>` for dependencies, `pnpm add -D <package>` for dev dependencies, and `pnpm add -w <package>` for workspace root
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:29.338Z
Learning: Run Biome linting and formatting only on files or paths you changed using `bunx biome check --write path/to/file.tsx`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:29.338Z
Learning: Never ask to run `pnpm dev` or check if the dev server is running. Always assume the development server is already running on http://localhost:3000 for frontend-demo, except for `apps/herbatika` which uses http://localhost:3001
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:39.246Z
Learning: Run `pnpm validate:token-usage`, `pnpm validate:ui-primitives`, or `pnpm validate:guardrails` before handing off work
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:39.246Z
Learning: Keep app-local storefront code thin: restrict to SDK instance, field defaults, localized text, toasts, analytics, form DTOs, address adapters, and Herbatika-specific read models
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:39.246Z
Learning: Move repeated backend communication, query key construction, cache sync, mutation invalidation, or reusable Medusa behavior into `libs/storefront-data` rather than keeping it in app code
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:39.246Z
Learning: From `apps/herbatika`, run `pnpm dev` to run the app on `http://localhost:3001`, not the root frontend-demo `localhost:3000`
Learnt from: CR
Repo: TechsioCZ/new-engine

Timestamp: 2026-06-14T16:26:39.246Z
Learning: For manual QA testing, use the `local-web-testing` skill and save evidence to `.qa/local-web-testing-YYYY-MM-DD/` with screenshots and notes
📚 Learning: 2025-12-16T19:45:17.746Z
Learnt from: BleedingDev
Repo: NMIT-WR/new-engine PR: 207
File: libs/ui/src/molecules/select.tsx:50-50
Timestamp: 2025-12-16T19:45:17.746Z
Learning: When reviewing Tailwind classes in TSX/TS files, prefer using square brackets for arbitrary CSS values and complex expressions. Specifically: - Do not use the parentheses syntax (z-(--z-index)) for anything beyond simple CSS variable references; this syntax auto-wraps in var() and cannot handle calc or complex functions. - Use the square brackets syntax (e.g., h-[calc(var(--available-height)-var(--spacing-content))]) for calc expressions, var with calc, and any complex CSS expressions. This rule applies broadly to Tailwind v4 usage in TSX code across the project.

Applied to files:

  • apps/herbatika/src/app/reviews/product/[token]/page.tsx
  • apps/herbatika/src/components/reviews/product-review-token-page.tsx
  • apps/herbatika/src/components/reviews/product-review-form.tsx
  • apps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsx
🔇 Additional comments (4)
apps/herbatika/src/components/reviews/product-review-errors.ts (1)

1-73: LGTM!

apps/herbatika/src/components/reviews/product-review-form.tsx (1)

1-149: LGTM!

apps/herbatika/src/components/reviews/product-review-token-status.ts (1)

1-27: LGTM!

apps/herbatika/src/app/reviews/product/[token]/page.tsx (1)

1-34: LGTM!

Comment thread apps/herbatika/src/components/reviews/product-review-token-page.tsx
@KaiUweCZE
KaiUweCZE merged commit 010d187 into master Jun 14, 2026
6 of 7 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants