Feat/herbatica review - #442
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds 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. ChangesProduct Reviews Feature
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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
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. Comment |
Greptile SummaryThis 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.
Confidence Score: 4/5Safe 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
Reviews (5): Last reviewed commit: "fix: remove review title" | Re-trigger Greptile |
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
| Files Reviewed (8 files)
|
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
| Files Reviewed (8 files)
|
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (8 files)
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by nex-n2-pro:free · 607,403 tokens |
There was a problem hiding this comment.
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
📒 Files selected for processing (32)
AGENTS.mdapps/herbatika/AGENTS.mdapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-utils.tsapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/components/reviews/reviews-section.tsxapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/ssr/context.tsapps/herbatika/src/lib/storefront/ssr/prefetch-product.tsapps/herbatika/src/lib/storefront/ssr/types.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/storefront-core-definition.tsapps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/styles/tokens/_herbatika-semantic.cssapps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.csslibs/storefront-data/package.jsonlibs/storefront-data/src/medusa/foundation.tslibs/storefront-data/src/medusa/preset.tslibs/storefront-data/src/medusa/server-read.tslibs/storefront-data/src/reviews/hooks.tslibs/storefront-data/src/reviews/input-utils.tslibs/storefront-data/src/reviews/medusa-service.tslibs/storefront-data/src/reviews/query-keys.tslibs/storefront-data/src/reviews/query-options.tslibs/storefront-data/src/reviews/types.tslibs/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.mdbefore editing, as it overrides the root frontend-demo server assumption withhttp://localhost:3001runtime and routes work throughlibs/ui/skillsandlibs/storefront-data/skillsworkflows
Files:
apps/herbatika/src/lib/storefront/storefront-core-definition.tsapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/styles/tokens/_herbatika-semantic.cssapps/herbatika/src/lib/storefront/ssr/types.tsapps/herbatika/src/lib/storefront/ssr/prefetch-product.tsapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/ssr/context.tsapps/herbatika/src/components/product-detail/sections/product-detail-review-utils.tsapps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.cssapps/herbatika/AGENTS.mdapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/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.tsapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/lib/storefront/ssr/types.tsapps/herbatika/src/lib/storefront/ssr/prefetch-product.tsapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/ssr/context.tsapps/herbatika/src/components/product-detail/sections/product-detail-review-utils.tsapps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/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 withnext/linkornext/imageadapter support when that component exposes it
Use token-based utility classes likep-200 mt-300 gap-150 text-success bg-danger, not raw Tailwind palette/spacing values likep-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.tsapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/lib/storefront/ssr/types.tsapps/herbatika/src/lib/storefront/ssr/prefetch-product.tsapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/ssr/context.tsapps/herbatika/src/components/product-detail/sections/product-detail-review-utils.tsapps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/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.tsand adjacentstorefront-definition*files
Files:
apps/herbatika/src/lib/storefront/storefront-core-definition.tsapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/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.tsapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/lib/storefront/ssr/types.tsapps/herbatika/src/lib/storefront/ssr/prefetch-product.tsapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/ssr/context.tsapps/herbatika/src/components/product-detail/sections/product-detail-review-utils.tsapps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/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-onlyandgetServerQueryClientfor Server Component/SSR data paths
Files:
apps/herbatika/src/lib/storefront/storefront-core-definition.tsapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/lib/storefront/ssr/types.tsapps/herbatika/src/lib/storefront/ssr/prefetch-product.tsapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/ssr/context.tsapps/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.tsapps/herbatika/src/lib/storefront/review-query-config.tsapps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/lib/storefront/ssr/types.tsapps/herbatika/src/lib/storefront/ssr/prefetch-product.tsapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/reviews.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/ssr/context.tsapps/herbatika/src/components/product-detail/sections/product-detail-review-utils.tsapps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/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 JSXclassNameoverrides that duplicate UI-kit component props/tokens
Files:
apps/herbatika/src/styles/tokens/_herbatika-semantic.cssapps/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 - usecreateQueryKey()utility instead
Do not mix server and client code in the same file
Use cache strategies fromCacheConfig(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.tslibs/storefront-data/src/reviews/query-keys.tslibs/storefront-data/src/reviews/query-options.tslibs/storefront-data/src/medusa/foundation.tslibs/storefront-data/src/reviews/types.tslibs/storefront-data/src/reviews/hooks.tslibs/storefront-data/src/reviews/medusa-service.tslibs/storefront-data/src/medusa/server-read.tslibs/storefront-data/src/medusa/preset.ts
libs/storefront-data/**/*.{ts,tsx}
📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)
Do not use
anytype - use proper generics instead
Files:
libs/storefront-data/src/reviews/input-utils.tslibs/storefront-data/src/reviews/query-keys.tslibs/storefront-data/src/reviews/query-options.tslibs/storefront-data/src/medusa/foundation.tslibs/storefront-data/src/reviews/types.tslibs/storefront-data/src/reviews/hooks.tslibs/storefront-data/src/reviews/medusa-service.tslibs/storefront-data/src/medusa/server-read.tslibs/storefront-data/src/medusa/preset.tslibs/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.tslibs/storefront-data/src/reviews/query-keys.tslibs/storefront-data/src/reviews/query-options.tslibs/storefront-data/src/medusa/foundation.tslibs/storefront-data/src/reviews/types.tslibs/storefront-data/src/reviews/hooks.tslibs/storefront-data/src/reviews/medusa-service.tslibs/storefront-data/src/medusa/server-read.tslibs/storefront-data/src/medusa/preset.tslibs/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.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/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:guardrailsdo exist in the repo.The referenced scripts aren’t limited to token validation:
validate:ui-primitivesandvalidate:guardrailsare defined inapps/herbatika/package.json(withvalidate:guardrailschainingpnpm validate:token-usageandpnpm 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@utilityin Stylelint (potential gate failure on line 11)
apps/herbatika/src/styles/tokens/components/atoms/_herbatika-rating.csscontains:`@utility` rating-star-fill { inline-size: var(--star-fill); }
.stylelintrc.jsononly extendsstylelint-config-standard-scssand doesn’t setignoreAtRules/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@utilityblock.
--color-herbatika-slateis defined inapps/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!
|
@KaiUweCZE please check this branch, fix all comments, so that we can merge it. |
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
apps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/sections/product-detail-tabs.tsxapps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/components/reviews/reviews-section.tsxlibs/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}: Inapps/herbatika, follow the guidelines inapps/herbatika/AGENTS.mdwhich overrides the root frontend-demo server assumption with Herbatika'shttp://localhost:3001runtime and routes work throughlibs/ui/skillsandlibs/storefront-data/skillsworkflows
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 usingbunx biome check --write path/to/file.tsx
Files:
apps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxlibs/storefront-data/src/shared/use-delayed-prefetch-controller.tsapps/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.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxlibs/storefront-data/src/shared/use-delayed-prefetch-controller.tsapps/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-kitinstead 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 withnext/linkornext/imageadapter support when that component exposes it
Use token-based utility classes instead of raw Tailwind palette/spacing values; prefer classes likep-200 mt-300 gap-150 text-success bg-dangeroverp-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; useserver-onlyandgetServerQueryClientfor Server Component/SSR data paths
Files:
apps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/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 JSXclassNameoverrides that duplicate UI-kit component props/tokens
Files:
apps/herbatika/src/components/reviews/fractional-rating.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/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 ordist/
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.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/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.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/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 - usecreateQueryKey()utility instead
Do not mix server and client code in the same file
Use cache strategies fromCacheConfig(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
anytype - 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.tsxapps/herbatika/src/components/product-detail/sections/product-detail-metrics.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/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)returns1whenparse()yieldsnull.- Check that
createSerializeromitsREVIEW_PAGE_PARAMfrom 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=tsxflag, 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!
There was a problem hiding this comment.
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 winPrevent close-state races while submit mutation is pending.
The dialog can be closed during an in-flight submit, then
onSuccessupdates state afterwards and leaves stale success state for the next open. GuardhandleOpenChangeso close requests are ignored whileisBusy.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
📒 Files selected for processing (7)
apps/herbatika/src/app/reviews/product/[token]/page.tsxapps/herbatika/src/components/product-detail/sections/product-detail-review-dialog.tsxapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/reviews/product-review-form.tsxapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-token-status.tsapps/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, readapps/herbatika/AGENTS.mdbefore editing, as it overrides the root frontend-demo server assumption with Herbatika'shttp://localhost:3001runtime and routes work through thelibs/ui/skillsandlibs/storefront-data/skillsworkflows
Files:
apps/herbatika/src/app/reviews/product/[token]/page.tsxapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/reviews/product-review-token-status.tsapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-form.tsxapps/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.tsxapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/reviews/product-review-token-status.tsapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-form.tsxapps/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.tsxapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/reviews/product-review-token-status.tsapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-form.tsxapps/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-kitin 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 withnext/linkornext/imageadapter support when that component exposes it
Use token-based utility classes instead of raw Tailwind palette/spacing values (preferp-200 mt-300 gap-150 text-success bg-dangeroverp-4 mt-8 gap-4 bg-red-600 text-green-300)
Files:
apps/herbatika/src/app/reviews/product/[token]/page.tsxapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/reviews/product-review-token-status.tsapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-form.tsxapps/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-dataand do not import from package roots ordist/
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.tsxapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/reviews/product-review-token-status.tsapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-form.tsxapps/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-onlyandgetServerQueryClientfor Server Component/SSR data paths
Files:
apps/herbatika/src/app/reviews/product/[token]/page.tsxapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/reviews/product-review-token-status.tsapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-form.tsxapps/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.tsxapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/reviews/product-review-form.tsxapps/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!
|
🎉 This PR is included in version 0.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary by CodeRabbit