Enable React Compiler across apps - #482
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
WalkthroughRemoves manual ChangesRemove manual memoisation and enable React Compiler
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Storybook A11y Report
LightNo a11y report JSON found for light. Storybook test-runner likely failed before reporting. DarkNo a11y report JSON found for dark. Storybook test-runner likely failed before reporting. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ea49d7d9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR enables the React Compiler for Payload (via
Confidence Score: 5/5Safe to merge; de-memoization is appropriate across all surfaces and the logic changes are correct. Every app touched by the de-memoization (frontend-demo, herbatika, n1) already had React Compiler active before this PR — confirmed by their existing next.config files. The new Medusa admin and Payload configurations are wired correctly. The only behavior-level change beyond memoization removal is the improved functional-update pattern for selectedVolumeDiscountId, which correctly preserves a user's discount-tier selection across option-set updates rather than blindly resetting to the first option; tracing through the filter logic confirms it still resets when the previously selected option is no longer available. apps/medusa-order-dashboard-plugin/src/admin/routes/order-dashboard/page.tsx — correctness of the de-memoized columns/filters/selectedOrderIdSet depends on whether the Medusa admin Vite build applies the new React Compiler Babel transform to pre-built plugin code (carry-over concern from prior review threads, partially addressed in 53e60b8). Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[React Compiler Enabled]
subgraph Already Active
FD[frontend-demo<br/>reactCompiler: true]
HB[herbatika<br/>reactCompiler: true]
N1[n1<br/>reactCompiler: true]
end
subgraph Newly Enabled in this PR
PL[payload<br/>next.config.mjs<br/>reactCompiler: true]
MB[medusa-be admin<br/>project.ts<br/>rolldown-plugin-babel + reactCompilerPreset]
end
A --> FD & HB & N1 & PL & MB
subgraph De-memoized
FD --> FD1[safe-html-content<br/>use-category-prefetch<br/>use-search-products]
HB --> HB1[use-checkout-controller<br/>use-checkout-inline-products<br/>use-product-detail-data<br/>use-category-listing-queries]
N1 --> N1A[analytics-provider<br/>address-picker]
MB --> MB1[use-data-table<br/>order-expedition/page<br/>companies/page<br/>quotes/columns ...]
end
subgraph Plugin risk
PG[medusa-order-dashboard-plugin<br/>page.tsx - pre-built?]
MB1 -.->|Compiler coverage uncertain| PG
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[React Compiler Enabled]
subgraph Already Active
FD[frontend-demo<br/>reactCompiler: true]
HB[herbatika<br/>reactCompiler: true]
N1[n1<br/>reactCompiler: true]
end
subgraph Newly Enabled in this PR
PL[payload<br/>next.config.mjs<br/>reactCompiler: true]
MB[medusa-be admin<br/>project.ts<br/>rolldown-plugin-babel + reactCompilerPreset]
end
A --> FD & HB & N1 & PL & MB
subgraph De-memoized
FD --> FD1[safe-html-content<br/>use-category-prefetch<br/>use-search-products]
HB --> HB1[use-checkout-controller<br/>use-checkout-inline-products<br/>use-product-detail-data<br/>use-category-listing-queries]
N1 --> N1A[analytics-provider<br/>address-picker]
MB --> MB1[use-data-table<br/>order-expedition/page<br/>companies/page<br/>quotes/columns ...]
end
subgraph Plugin risk
PG[medusa-order-dashboard-plugin<br/>page.tsx - pre-built?]
MB1 -.->|Compiler coverage uncertain| PG
end
Reviews (11): Last reviewed commit: "fix: include payload compiler in prod in..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
apps/herbatika/src/components/auth/use-auth-controller.ts (1)
40-239: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftrefactor: separate auth flow orchestration from cart-transfer/logout helpers
This hook now carries redirect resolution, login/register submission, post-auth cart transfer, logout handling, and UI feedback in one 200+ line unit. Splitting those concerns would keep the auth surface easier to evolve alongside the compiler rollout. As per coding guidelines,
apps/herbatika/src/**/*.{ts,tsx,js,jsx}should stay at a soft limit of ~200 lines, and exceeding it should trigger refactor consideration.🤖 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/auth/use-auth-controller.ts` around lines 40 - 239, The useAuthController hook is doing too many jobs in one place and is now beyond the preferred size, so split the orchestration from the helper logic. Extract the cart-transfer and logout flows from useAuthController into smaller hooks or utility functions, keeping useAuthController focused on wiring auth state, submit handlers, and return values. Use the existing symbols useAuthController, transferCartIfAvailable, runPostAuthCartTransfer, and handleLogout to guide the refactor while preserving behavior.Source: Coding guidelines
apps/herbatika/src/components/checkout/use-checkout-controller.ts (1)
68-476: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftrefactor: split this controller into smaller hooks/modules
This hook now bundles region bootstrap, cart syncing, address persistence, shipping/payment orchestration, completion flow, totals derivation, and UI state in one place. It is well beyond the Herbatika soft limit, so extracting those concerns would make future changes much safer to reason about. As per coding guidelines,
apps/herbatika/src/**/*.{ts,tsx,js,jsx}should stay at a soft limit of ~200 lines, and exceeding it should trigger refactor consideration.🤖 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/checkout/use-checkout-controller.ts` around lines 68 - 476, The useCheckoutController hook is doing too many jobs in one place, making it hard to maintain and exceeding the preferred size. Split the logic into smaller focused hooks/modules, using useCheckoutController as a thin coordinator and extracting concern-specific pieces such as region/cart bootstrap, address persistence, shipping/payment handling, order completion, and totals derivation. Keep the current public API stable while moving the implementation details into helpers with clear names like useCheckoutDetailsForm, useCheckoutActions, and the cart/region sync logic.Source: Coding guidelines
apps/frontend-demo/src/components/category-tree-filter.tsx (1)
55-55: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove leftover commented-out debug/dead code.
The
cancelAllPrefetches()comment (now that the destructure no longer extracts it) plus the commentedconsole.loglines are dead artefacts that add noise. Consider dropping them while this block is being touched.Also applies to: 94-94, 117-117, 125-127
🤖 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/frontend-demo/src/components/category-tree-filter.tsx` at line 55, Remove the leftover commented-out debug and dead code in category-tree-filter.tsx. Clean up the stale cancelAllPrefetches reference in the destructuring area and delete the commented console.log lines and any similar commented artefacts in the affected block. Keep the CategoryTreeFilter logic and related hooks/helpers intact, but ensure the touched section only contains live code and current intent.
🤖 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/frontend-demo/src/components/molecules/header-search.tsx`:
- Around line 80-91: The selection handling in header-search is routing the
synthetic "__search__" option as if it were a real product handle. Update the
logic around nextSelectedValue and searchItems so the "__search__" sentinel is
checked first and sent to handleSearch, then only use router.push in the
isProductHandle path for actual product values.
In `@apps/herbatika/src/components/checkout/use-checkout-controller.ts`:
- Around line 404-422: The shipping amount calculation in
use-checkout-controller is dropping the known selectedShippingOptionPrice once
cart.shipping_methods exists, causing a temporary 0 display when shipping_total
or shipping_subtotal is still missing. Update the cartShippingTotalAmount and
cartShippingSubtotalAmount logic to always pass selectedShippingOptionPrice as
the fallback into resolveCartShippingTotalAmount and
resolveCartShippingSubtotalAmount, rather than branching on
cartQuery.cart?.shipping_methods?.length.
In `@apps/medusa-be/package.json`:
- Around line 129-141: The React Compiler/Vite plugin versions are on an
incompatible major line with the current Vite 5 toolchain, so update the
dependency choices in package.json to versions compatible with Vite 5 or defer
them until the Vite 8 upgrade lands together. Review the entries for
`@vitejs/plugin-react`, `@rolldown/plugin-babel`, and the React Compiler
preset-related dependencies, and keep the admin build chain aligned on a single
Vite-compatible set.
In
`@apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx`:
- Around line 17-20: Update handleSuccess in route-modal-provider so the
fallback route uses nullish coalescing instead of logical OR. Replace the
current path resolution logic to use path ?? prev before calling navigate,
keeping empty strings as valid paths while still falling back only for null or
undefined values.
In
`@apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx`:
- Around line 199-204: The customer search response is being forced into
CustomerOption with an unsafe cast, then used immediately in the exact-match
lookup. Update employees-create-form.tsx around the customerSearch/customers
handling to validate or map the API response into CustomerOption objects before
accessing email, instead of using as CustomerOption[]. Keep the exactCustomer
selection logic, but make it operate on validated data from the customerSearch
boundary.
In
`@apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx`:
- Around line 58-62: Normalize the search term before applying the item filter
in manage-items-section.tsx: the `filteredItems` logic currently lower-cases
`i.title` and `i.product_title` but compares them against `filterTerm` as
entered, so uppercase input won’t match. Update the search flow around
`filteredItems` (and any related `filterTerm` usage) so the input is lower-cased
once before filtering, keeping the existing `toLowerCase()` checks on the item
fields.
In
`@apps/medusa-be/src/admin/routes/quotes/components/quote-manage/table/columns.tsx`:
- Around line 12-57: The quote table column definitions are being recreated on
every render, which makes the TanStack Table column reference unstable. Update
the columns builder in columns.tsx so the array returned from the function stays
stable by memoizing it with useMemo or hoisting the static defs, while keeping
the existing columnHelper.display and columnHelper.accessor definitions for
select, product, sku, and title.
---
Outside diff comments:
In `@apps/frontend-demo/src/components/category-tree-filter.tsx`:
- Line 55: Remove the leftover commented-out debug and dead code in
category-tree-filter.tsx. Clean up the stale cancelAllPrefetches reference in
the destructuring area and delete the commented console.log lines and any
similar commented artefacts in the affected block. Keep the CategoryTreeFilter
logic and related hooks/helpers intact, but ensure the touched section only
contains live code and current intent.
In `@apps/herbatika/src/components/auth/use-auth-controller.ts`:
- Around line 40-239: The useAuthController hook is doing too many jobs in one
place and is now beyond the preferred size, so split the orchestration from the
helper logic. Extract the cart-transfer and logout flows from useAuthController
into smaller hooks or utility functions, keeping useAuthController focused on
wiring auth state, submit handlers, and return values. Use the existing symbols
useAuthController, transferCartIfAvailable, runPostAuthCartTransfer, and
handleLogout to guide the refactor while preserving behavior.
In `@apps/herbatika/src/components/checkout/use-checkout-controller.ts`:
- Around line 68-476: The useCheckoutController hook is doing too many jobs in
one place, making it hard to maintain and exceeding the preferred size. Split
the logic into smaller focused hooks/modules, using useCheckoutController as a
thin coordinator and extracting concern-specific pieces such as region/cart
bootstrap, address persistence, shipping/payment handling, order completion, and
totals derivation. Keep the current public API stable while moving the
implementation details into helpers with clear names like
useCheckoutDetailsForm, useCheckoutActions, and the cart/region sync logic.
🪄 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: f2dfacae-87c8-49b5-8979-f1417a46c676
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (78)
apps/frontend-demo/src/components/category-tree-filter.tsxapps/frontend-demo/src/components/molecules/header-search.tsxapps/frontend-demo/src/components/safe-html-content.tsxapps/frontend-demo/src/hooks/use-accordion-tree.tsapps/frontend-demo/src/hooks/use-auth.tsapps/frontend-demo/src/hooks/use-category-prefetch.tsapps/frontend-demo/src/hooks/use-prefetch-product.tsapps/frontend-demo/src/hooks/use-prefetch-products.tsapps/frontend-demo/src/hooks/use-region.tsapps/frontend-demo/src/hooks/use-search-products.tsapps/herbatika/src/components/account-orders-list.tsxapps/herbatika/src/components/aside-filter-chip-section.tsxapps/herbatika/src/components/aside-filter.tsxapps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/components/auth/use-register-country-items.tsapps/herbatika/src/components/brands/use-brand-listing-controller.tsapps/herbatika/src/components/category/category-context-panel.tsxapps/herbatika/src/components/category/category-rich-text.tsxapps/herbatika/src/components/category/use-category-facet-items.tsapps/herbatika/src/components/category/use-category-listing-queries.tsapps/herbatika/src/components/checkout/sections/checkout-cart-item-row.tsxapps/herbatika/src/components/checkout/sections/checkout-empty-cart-section.tsxapps/herbatika/src/components/checkout/sections/checkout-shipping-section.tsxapps/herbatika/src/components/checkout/use-cart-products-by-handle.tsapps/herbatika/src/components/checkout/use-checkout-controller.tsapps/herbatika/src/components/checkout/use-checkout-inline-products.tsapps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsxapps/herbatika/src/components/header/use-herbatika-header-submenu.tsapps/herbatika/src/components/homepage/sections/purpose-carousel.tsxapps/herbatika/src/components/homepage/use-homepage-controller.tsapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/product-detail-html-content.tsxapps/herbatika/src/components/product-detail/sections/product-detail-reviews.tsxapps/herbatika/src/components/product-detail/use-product-detail-data.tsapps/herbatika/src/components/product-detail/use-product-detail-related-products.tsapps/herbatika/src/components/product-lists/use-account-product-lists.tsapps/herbatika/src/components/product-lists/use-product-list-picker.tsapps/herbatika/src/components/recently-visited-products-section.tsxapps/herbatika/src/components/reviews/product-review-token-page.tsxapps/herbatika/src/components/search/use-search-listing-controller.tsapps/herbatika/src/lib/storefront/catalog-products.tsapps/herbatika/src/lib/storefront/recently-visited-products.tsapps/herbatika/src/lib/storefront/regions.tsapps/herbatika/src/lib/storefront/use-logout-action.tsapps/herbatika/src/lib/storefront/use-pagination-url-builder.tsapps/medusa-be/package.jsonapps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsxapps/medusa-be/src/admin/components/common/table/data-table/data-table-filter/data-table-filter.tsxapps/medusa-be/src/admin/components/common/table/data-table/data-table.tsxapps/medusa-be/src/admin/components/rich-html-editor.tsxapps/medusa-be/src/admin/hooks/use-data-table.tsxapps/medusa-be/src/admin/routes/approvals/components/table/columns.tsxapps/medusa-be/src/admin/routes/companies/components/company-customer-group-drawer.tsxapps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsxapps/medusa-be/src/admin/routes/companies/page.tsxapps/medusa-be/src/admin/routes/order-expedition/page.tsxapps/medusa-be/src/admin/routes/packeta-labels/page.tsxapps/medusa-be/src/admin/routes/producers/[id]/page.tsxapps/medusa-be/src/admin/routes/producers/attributes/[id]/page.tsxapps/medusa-be/src/admin/routes/producers/page.tsxapps/medusa-be/src/admin/routes/quotes/components/quote-details/quote-items.tsxapps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-item.tsxapps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsxapps/medusa-be/src/admin/routes/quotes/components/quote-manage/table/columns.tsxapps/medusa-be/src/admin/routes/quotes/components/quote-messages.tsxapps/medusa-be/src/admin/routes/quotes/components/table/columns.tsxapps/medusa-be/src/admin/routes/reviews/page.tsxapps/medusa-be/src/admin/widgets/category-description-editor.tsxapps/medusa-be/src/admin/widgets/order-commercial-values.tsxapps/medusa-be/src/admin/widgets/product-description-editor.tsxapps/medusa-be/src/admin/widgets/product-producers.tsxapps/medusa-be/src/config/project.tsapps/medusa-order-dashboard-plugin/src/admin/routes/order-dashboard/fulfillment-modal.tsxapps/medusa-order-dashboard-plugin/src/admin/routes/order-dashboard/page.tsxapps/n1/src/app/pokladna/_components/address-picker.tsxapps/n1/src/providers/analytics-provider.tsxapps/payload/next.config.mjsapps/payload/package.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53e60b8c78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a80406254
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15515da4ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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 (2)
apps/herbatika/src/components/aside-filter.tsx (1)
184-202: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winfix: stop the slider sync effect from keying off a freshly created range.
Lines 196-201 now run after every render because
selectedRangeis rebuilt inline. WhenonChangeupdatessliderRange, this effect immediately writes the old committed range back into state, so the price slider can snap back while the user is dragging. Recompute the sync target inside the effect with primitive deps, or restore semantic memoisation forselectedRange.Proposed fix
const selectedRange = resolveRangeFromSelection( selectedPriceRange, priceBoundsForRender ) @@ - useEffect(() => { - setSliderRange((currentRange) => - areRangesEqual(currentRange, selectedRange) - ? currentRange - : selectedRange - ) - }, [selectedRange]) + useEffect(() => { + const nextSelectedRange = resolveRangeFromSelection( + selectedPriceRange, + priceBoundsForRender + ) + + setSliderRange((currentRange) => + areRangesEqual(currentRange, nextSelectedRange) + ? currentRange + : nextSelectedRange + ) + }, [ + selectedPriceRange.min, + selectedPriceRange.max, + priceBoundsForRender.min, + priceBoundsForRender.max, + ])🤖 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/aside-filter.tsx` around lines 184 - 202, The slider sync in aside-filter.tsx is using a freshly created selectedRange as the useEffect dependency, so the effect re-runs on every render and can overwrite in-progress drag updates. Update the synchronization around selectedRange, sliderRange, and resolveRangeFromSelection/resolveRangeWithinBounds so the committed range is derived from stable primitive dependencies inside the effect or memoized semantically before being used, and keep the setSliderRange guard based on areRangesEqual.apps/herbatika/src/components/product-detail/use-product-detail-data.ts (1)
49-182: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftrefactor: move the new product-detail resolvers into a sibling utility module.
Lines 49-182 are all pure derivation helpers, and this file now sits at ~360 lines. Splitting those helpers into a nearby
product-detail-data.utils.ts-style module would keep the hook readable and give you cleaner unit-test seams without changing behaviour. As per coding guidelines,apps/herbatika/src/**/*.{ts,tsx,js,jsx}: Keep source files at a soft limit of ~200 lines; exceeding this should trigger refactor consideration.🤖 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/use-product-detail-data.ts` around lines 49 - 182, The new pure derivation helpers in use-product-detail-data should be moved out of the hook into a sibling utility module to reduce file size and improve testability. Extract the resolver functions such as resolveSelectedVariant, resolveOptionTitlesById, resolveVariantItems, resolveShortDescriptionHtml, resolveProductSummaryText, resolveDisplayOriginalLabel, resolveProductVolumeDiscountOptions, resolveSelectedVolumeDiscountOption, resolveProductBreadcrumbItems, and resolveFreeShippingThresholdLabel into a nearby product-detail-data.utils-style file, then import them back into useProductDetailData without changing behavior.Source: Coding guidelines
🤖 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.tsx`:
- Around line 95-99: The fallback section in product-detail uses a raw Tailwind
radius class, which breaks the token-based styling contract. Update the section
wrapping the StatusText and LinkButton to use the existing Herbatika/UI-kit
radius token or equivalent prop instead of rounded-sm, keeping the styling
aligned with the token-driven approach used throughout the component.
---
Outside diff comments:
In `@apps/herbatika/src/components/aside-filter.tsx`:
- Around line 184-202: The slider sync in aside-filter.tsx is using a freshly
created selectedRange as the useEffect dependency, so the effect re-runs on
every render and can overwrite in-progress drag updates. Update the
synchronization around selectedRange, sliderRange, and
resolveRangeFromSelection/resolveRangeWithinBounds so the committed range is
derived from stable primitive dependencies inside the effect or memoized
semantically before being used, and keep the setSliderRange guard based on
areRangesEqual.
In `@apps/herbatika/src/components/product-detail/use-product-detail-data.ts`:
- Around line 49-182: The new pure derivation helpers in use-product-detail-data
should be moved out of the hook into a sibling utility module to reduce file
size and improve testability. Extract the resolver functions such as
resolveSelectedVariant, resolveOptionTitlesById, resolveVariantItems,
resolveShortDescriptionHtml, resolveProductSummaryText,
resolveDisplayOriginalLabel, resolveProductVolumeDiscountOptions,
resolveSelectedVolumeDiscountOption, resolveProductBreadcrumbItems, and
resolveFreeShippingThresholdLabel into a nearby product-detail-data.utils-style
file, then import them back into useProductDetailData without changing behavior.
🪄 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: 913937ab-e16a-4d9f-a74c-c25fb0938e51
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
apps/frontend-demo/src/components/molecules/header-search.tsxapps/herbatika/src/components/account-orders-list.tsxapps/herbatika/src/components/aside-filter.tsxapps/herbatika/src/components/category/use-category-facet-items.tsapps/herbatika/src/components/category/use-category-listing-queries.tsapps/herbatika/src/components/checkout/use-checkout-controller.tsapps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsxapps/herbatika/src/components/header/use-herbatika-header-submenu.tsapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/use-product-detail-data.tsapps/medusa-be/package.jsonapps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsxapps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsxapps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: Greptile Review
⚠️ CI failures not shown inline (2)
GitHub Actions: CI / 0_main.txt: Enable React Compiler across apps
Conclusion: failure
##[group]✅ > nx run medusa-be:test
> node ./scripts/run-vitest.mjs run --config vitest.config.ts
�[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv4.1.5 �[39m�[90m/home/runner/work/new-engine/new-engine/apps/medusa-be�[39m
�[32m✓�[39m tests/unit/src/workflows/customer-group-sync-steps.unit.spec.ts �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[32m 269�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/herbatica/herbatica-seed.unit.spec.ts �[2m(�[22m�[2m16 tests�[22m�[2m)�[22m�[32m 136�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/modules/payload/service.unit.spec.ts �[2m(�[22m�[2m34 tests�[22m�[2m)�[22m�[32m 98�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/api/admin/orders/[id]/commercial-values/utils.unit.spec.ts �[2m(�[22m�[2m20 tests�[22m�[2m)�[22m�[32m 40�[2mms�[22m�[39m
�[32m✓�[39m src/modules/payment-paykit/__tests__/base.unit.spec.ts �[2m(�[22m�[2m24 tests�[22m�[2m)�[22m�[32m 65�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/api/store/product-lists/routes.unit.spec.ts �[2m(�[22m�[2m10 tests�[22m�[2m)�[22m�[33m 1935�[2mms�[22m�[39m
�[33m�[2m✓�[22m�[39m allows unauthenticated access to public lists �[33m 1848�[2mms�[22m�[39m
�[32m✓�[39m src/modules/payment-paykit/__tests__/stripe.unit.spec.ts �[2m(�[22m�[2m20 tests�[22m�[2m)�[22m�[32m 65�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/modules/ppl-client/service.unit.spec.ts �[2m(�[22m�[2m19 tests�[22m�[2m)�[22m�[32m 33�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/catalog/catalog-products-route.unit.spec.ts �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 20�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/workflows/order-commercial-values/apply-commercial-values.unit.spec.ts �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 108�[2mms�[22m�[39m
�[32m✓�[39m src/api/admin/promotions/__tests__/utils.unit.spec.ts �[2m(�[22m�[2m40 tests�[22m�[2m)�[22m�[32m 20�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/workflows/product-list/steps.unit.spec.ts �[2m(�[22m�[2m10 tests�[22m�[2m)�[22m�[32m 39�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/modules/fulfillmen...
GitHub Actions: CI / main: Enable React Compiler across apps
Conclusion: failure
##[group]✅ > nx run medusa-be:test
> node ./scripts/run-vitest.mjs run --config vitest.config.ts
�[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv4.1.5 �[39m�[90m/home/runner/work/new-engine/new-engine/apps/medusa-be�[39m
�[32m✓�[39m tests/unit/src/workflows/customer-group-sync-steps.unit.spec.ts �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[32m 269�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/herbatica/herbatica-seed.unit.spec.ts �[2m(�[22m�[2m16 tests�[22m�[2m)�[22m�[32m 136�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/modules/payload/service.unit.spec.ts �[2m(�[22m�[2m34 tests�[22m�[2m)�[22m�[32m 98�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/api/admin/orders/[id]/commercial-values/utils.unit.spec.ts �[2m(�[22m�[2m20 tests�[22m�[2m)�[22m�[32m 40�[2mms�[22m�[39m
�[32m✓�[39m src/modules/payment-paykit/__tests__/base.unit.spec.ts �[2m(�[22m�[2m24 tests�[22m�[2m)�[22m�[32m 65�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/api/store/product-lists/routes.unit.spec.ts �[2m(�[22m�[2m10 tests�[22m�[2m)�[22m�[33m 1935�[2mms�[22m�[39m
�[33m�[2m✓�[22m�[39m allows unauthenticated access to public lists �[33m 1848�[2mms�[22m�[39m
�[32m✓�[39m src/modules/payment-paykit/__tests__/stripe.unit.spec.ts �[2m(�[22m�[2m20 tests�[22m�[2m)�[22m�[32m 65�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/modules/ppl-client/service.unit.spec.ts �[2m(�[22m�[2m19 tests�[22m�[2m)�[22m�[32m 33�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/catalog/catalog-products-route.unit.spec.ts �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 20�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/workflows/order-commercial-values/apply-commercial-values.unit.spec.ts �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 108�[2mms�[22m�[39m
�[32m✓�[39m src/api/admin/promotions/__tests__/utils.unit.spec.ts �[2m(�[22m�[2m40 tests�[22m�[2m)�[22m�[32m 20�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/workflows/product-list/steps.unit.spec.ts �[2m(�[22m�[2m10 tests�[22m�[2m)�[22m�[32m 39�[2mms�[22m�[39m
�[32m✓�[39m tests/unit/src/modules/fulfillmen...
🧰 Additional context used
📓 Path-based instructions (16)
apps/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Import UI components using the
@techsio/ui-kitnamespace, not@libs/ui, for runtime apps
Files:
apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsxapps/herbatika/src/components/checkout/use-checkout-controller.tsapps/herbatika/src/components/header/use-herbatika-header-submenu.tsapps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsxapps/herbatika/src/components/product-detail.tsxapps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsxapps/frontend-demo/src/components/molecules/header-search.tsxapps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsxapps/herbatika/src/components/aside-filter.tsxapps/herbatika/src/components/category/use-category-facet-items.tsapps/herbatika/src/components/account-orders-list.tsxapps/herbatika/src/components/product-detail/use-product-detail-data.tsapps/herbatika/src/components/category/use-category-listing-queries.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run Biome linting and formatting only on changed files using 'bunx biome check --write path/to/file'
Files:
apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsxapps/herbatika/src/components/checkout/use-checkout-controller.tsapps/herbatika/src/components/header/use-herbatika-header-submenu.tsapps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsxapps/herbatika/src/components/product-detail.tsxapps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsxapps/frontend-demo/src/components/molecules/header-search.tsxapps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsxapps/herbatika/src/components/aside-filter.tsxapps/herbatika/src/components/category/use-category-facet-items.tsapps/herbatika/src/components/account-orders-list.tsxapps/herbatika/src/components/product-detail/use-product-detail-data.tsapps/herbatika/src/components/category/use-category-listing-queries.ts
apps/herbatika/**
📄 CodeRabbit inference engine (AGENTS.md)
apps/herbatika/**: Read apps/herbatika/AGENTS.md before editing Herbatika app and follow its specific configuration which overrides root assumptions
Herbatika app runs on http://localhost:3001 and routes work through libs/ui/skills and libs/storefront-data/skills workflows
Files:
apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsxapps/herbatika/src/components/checkout/use-checkout-controller.tsapps/herbatika/src/components/header/use-herbatika-header-submenu.tsapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/aside-filter.tsxapps/herbatika/src/components/category/use-category-facet-items.tsapps/herbatika/src/components/account-orders-list.tsxapps/herbatika/src/components/product-detail/use-product-detail-data.tsapps/herbatika/src/components/category/use-category-listing-queries.ts
apps/**/!(medusa-be)/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use modern React patterns and React 19 for frontend applications in the monorepo
Files:
apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsxapps/herbatika/src/components/checkout/use-checkout-controller.tsapps/herbatika/src/components/header/use-herbatika-header-submenu.tsapps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsxapps/herbatika/src/components/product-detail.tsxapps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsxapps/frontend-demo/src/components/molecules/header-search.tsxapps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsxapps/herbatika/src/components/aside-filter.tsxapps/herbatika/src/components/category/use-category-facet-items.tsapps/herbatika/src/components/account-orders-list.tsxapps/herbatika/src/components/product-detail/use-product-detail-data.tsapps/herbatika/src/components/category/use-category-listing-queries.ts
apps/herbatika/src/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
apps/herbatika/src/**/*.{jsx,tsx}: Use internal UI primitives/components from@techsio/ui-kitinstead of native controls in app code. Avoid raw , , , <textarea>, , 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. Files: apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx apps/herbatika/src/components/product-detail.tsx apps/herbatika/src/components/aside-filter.tsx apps/herbatika/src/components/account-orders-list.tsx apps/herbatika/src/**/*.{jsx,tsx,css} 📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md) Use token-based utility classes instead of raw Tailwind palette/spacing values. Prefer tokenized classes like p-200, mt-300, gap-150, text-success, bg-danger over raw Tailwind values like p-4, mt-8, bg-red-600. Files: apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx apps/herbatika/src/components/product-detail.tsx apps/herbatika/src/components/aside-filter.tsx apps/herbatika/src/components/account-orders-list.tsx apps/herbatika/src/** 📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md) apps/herbatika/src/**: Put Herbatika visual differences in src/styles/tokens/**; avoid JSX className overrides that duplicate UI-kit component props/tokens. Use kebab-case for file names and PascalCase for React component names in Herbatika. Files: apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx apps/herbatika/src/components/checkout/use-checkout-controller.ts apps/herbatika/src/components/header/use-herbatika-header-submenu.ts apps/herbatika/src/components/product-detail.tsx apps/herbatika/src/components/aside-filter.tsx apps/herbatika/src/components/category/use-category-facet-items.ts apps/herbatika/src/components/account-orders-list.tsx apps/herbatika/src/components/product-detail/use-product-detail-data.ts apps/herbatika/src/components/category/use-category-listing-queries.ts apps/herbatika/src/**/*.{ts,tsx} 📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md) apps/herbatika/src/**/*.{ts,tsx}: Use explicit package subpath imports from @techsio/storefront-data. Do not import from package roots or dist/. Keep server-only and client-only boundaries explicit in Herbatika app code; use 'server-only' and 'getServerQueryClient' for Server Component/SSR data paths. Files: apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx apps/herbatika/src/components/checkout/use-checkout-controller.ts apps/herbatika/src/components/header/use-herbatika-header-submenu.ts apps/herbatika/src/components/product-detail.tsx apps/herbatika/src/components/aside-filter.tsx apps/herbatika/src/components/category/use-category-facet-items.ts apps/herbatika/src/components/account-orders-list.tsx apps/herbatika/src/components/product-detail/use-product-detail-data.ts apps/herbatika/src/components/category/use-category-listing-queries.ts apps/herbatika/src/**/*.{ts,tsx,js,jsx} 📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md) Keep source files at a soft limit of ~200 lines; exceeding this should trigger refactor consideration. Files: apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx apps/herbatika/src/components/checkout/use-checkout-controller.ts apps/herbatika/src/components/header/use-herbatika-header-submenu.ts apps/herbatika/src/components/product-detail.tsx apps/herbatika/src/components/aside-filter.tsx apps/herbatika/src/components/category/use-category-facet-items.ts apps/herbatika/src/components/account-orders-list.tsx apps/herbatika/src/components/product-detail/use-product-detail-data.ts apps/herbatika/src/components/category/use-category-listing-queries.ts apps/medusa-be/src/admin/**/* 📄 CodeRabbit inference engine (CLAUDE.md) Place admin panel customizations under apps/medusa-be/src/admin Files: apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx apps/medusa-be/**/*.{ts,tsx} 📄 CodeRabbit inference engine (apps/medusa-be/CLAUDE.md) apps/medusa-be/**/*.{ts,tsx}: Use TypeScript for type checking - run npx tsc --noEmit for validation Forbidden: Non-null assertions (!) - always use type guards and validation instead Annotate generic field access with explicit unknown type before type guards - const v: unknown = result[field] Don't use as Type without validation - always validate before casting Use Modules.* and ContainerRegistrationKeys.* constants instead of hardcoding strings Batch operations with CHUNK_SIZE to avoid unbounded operations Extract pure functions to separate files for testability without runtime dependencies Files: apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx apps/medusa-be/**/*.{ts,tsx,js,jsx} 📄 CodeRabbit inference engine (apps/medusa-be/CLAUDE.md) apps/medusa-be/**/*.{ts,tsx,js,jsx}: Use Biome linter with ultracite preset - run bunx biome check --write . and always use braces in conditionals Comments should explain 'why', never 'what' - use self-documenting code via clear naming Always use const per declaration - const a = 1; const b = 2 is correct, one variable per line Use nullish coalescing (??) operator instead of logical OR (||) for default values Files: apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx apps/medusa-be/src/admin/**/*.{ts,tsx} 📄 CodeRabbit inference engine (apps/medusa-be/CLAUDE.md) Admin app uses Vite - access env vars via import.meta.env.VITE_* with .DEV and .PROD modifiers Files: apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx apps/medusa-be/src/**/*.{ts,tsx} 📄 CodeRabbit inference engine (AGENTS.md) Medusa backend custom logic should be organized in api/, modules/, workflows/, admin/, subscribers/, and jobs/ directories under apps/medusa-be/src/ Files: apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx **/package.json 📄 CodeRabbit inference engine (CLAUDE.md) Use pnpm CLI to add dependencies; never edit package.json directly Files: apps/medusa-be/package.json apps/frontend-demo/src/components/@(atoms|molecules|organisms)/*.tsx 📄 CodeRabbit inference engine (apps/frontend-demo/CLAUDE.md) apps/frontend-demo/src/components/@(atoms|molecules|organisms)/*.tsx: Place app-specific components in apps/frontend-demo/src/components/[atoms|molecules|organisms]/component-name.tsx In each component TSX file, import its token CSS (e.g., import './_component-name.css') Define component props with TypeScript interfaces Use functional components and hooks for implementation Use tv() with slots for component styles; only add variants/sizes when necessary Use Tailwind classes mapped to tokens (e.g., bg-button-bg, p-button-sm); never use arbitrary CSS variable values like bg-[var(--...)] or p-[var(--...)] Do not hardcode colors or spacing in JSX/TSX; use design tokens and/or tv() Files: apps/frontend-demo/src/components/molecules/header-search.tsx 🧠 Learnings (7) 📚 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/header/herbatika-mobile-menu-nav.tsx apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx apps/herbatika/src/components/product-detail.tsx apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx apps/frontend-demo/src/components/molecules/header-search.tsx apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx apps/herbatika/src/components/aside-filter.tsx apps/herbatika/src/components/account-orders-list.tsx 📚 Learning: 2026-06-14T17:05:00.817Z Learnt from: KaiUweCZE Repo: TechsioCZ/new-engine PR: 442 File: apps/herbatika/src/components/reviews/product-review-token-page.tsx:36-42 Timestamp: 2026-06-14T17:05:00.817Z Learning: When reviewing code in apps/herbatika that calls `useProducts(input: ProductListInput, options?)`, treat `enabled` provided inside the first argument (`input`) as intentional and valid. The `ProductListInput` type includes an optional `enabled?: boolean` (via `BaseStorefrontProductListInput & { enabled?: boolean }`), and the hook infrastructure strips `enabled` before constructing the HTTP request and query key (following the same `stripListInput` behavior used elsewhere). Therefore, do NOT flag `useProducts({ enabled: ... , ... }, options)` as a contract violation; `enabled` belongs in the input object, not in the `options` argument. Applied to files: apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx apps/herbatika/src/components/checkout/use-checkout-controller.ts apps/herbatika/src/components/header/use-herbatika-header-submenu.ts apps/herbatika/src/components/product-detail.tsx apps/herbatika/src/components/aside-filter.tsx apps/herbatika/src/components/category/use-category-facet-items.ts apps/herbatika/src/components/account-orders-list.tsx apps/herbatika/src/components/product-detail/use-product-detail-data.ts apps/herbatika/src/components/category/use-category-listing-queries.ts 📚 Learning: 2026-05-07T12:06:55.558Z Learnt from: redeyecz Repo: TechsioCZ/new-engine PR: 375 File: apps/medusa-be/src/admin/widgets/order-payment-reminder.tsx:3-11 Timestamp: 2026-05-07T12:06:55.558Z Learning: In Medusa admin code under `apps/medusa-be/src/admin/` (admin widgets/routes), UI components must be imported from `medusajs/ui` (the Medusa admin UI kit). Do not apply the project-wide `libs/ui/atoms/*` and `libs/ui/molecules/*` import conventions to these files, and never flag `medusajs/ui` imports in this admin directory as violating the `libs/ui` convention. Applied to files: apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.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: apps/medusa-be/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: apps/medusa-be/package.json 📚 Learning: 2026-05-20T15:58:53.048Z Learnt from: redeyecz Repo: TechsioCZ/new-engine PR: 413 File: apps/medusa-be/package.json:77-80 Timestamp: 2026-05-20T15:58:53.048Z Learning: When reviewing monorepo `package.json` files, treat any dependencies/devDependencies using the `paykit-sdk/*` scope (e.g., `paykit-sdk/core`, `paykit-sdk/stripe`, `paykit-sdk/comgate`, `paykit-sdk/gopay`) as coming from the TechsioCZ/new-engine private npm registry. Do not flag dependency version constraints (e.g., `^1.2.0`) as invalid merely because those packages/versions are not found on the public npm registry. Public-web/private-web availability checks against the public npm API are not applicable for these packages; if validation is needed, rely on the private registry/CI install behavior instead. Applied to files: apps/medusa-be/package.json 📚 Learning: 2026-02-10T15:19:38.125Z Learnt from: KaiUweCZE Repo: NMIT-WR/new-engine PR: 328 File: apps/frontend-demo/src/components/molecules/header-search.tsx:75-99 Timestamp: 2026-02-10T15:19:38.125Z Learning: In apps/frontend-demo/src/components/molecules/header-search.tsx, the dataset invariant is that every product has a handle property. The current fallback in handleSelect calls handleSearch(selected) when a product exists but lacks a handle, and this is acceptable only if that invariant always holds. Actionable guidance: 1) Document the invariant and rely on it in code reviews. 2) Add a defensive guard or a test to verify no product arrives without a handle. For future-proofing, consider guarding the fallback (e.g., if (product?.handle) { handleSearch(product) } else { log/throw or skip }) and ensure a log message when the invariant is violated. Applied to files: apps/frontend-demo/src/components/molecules/header-search.tsx 🔇 Additional comments (13) apps/medusa-be/package.json (1) 61-61: Still unresolved: keep the React Compiler tooling on a Vite-compatible line. This appears to be the same Medusa admin/Vite compatibility issue already raised earlier, and the current dependency versions still show that plugin line. Please re-check @vitejs/plugin-react and @rolldown/plugin-babel against the Medusa admin Vite major before merge. Also applies to: 95-103 apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx (1) 18-18: LGTM! Also applies to: 22-26 apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx (1) 57-71: LGTM! Also applies to: 182-182, 215-225 apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx (1) 58-65: LGTM! apps/herbatika/src/components/header/use-herbatika-header-submenu.ts (1) 58-121: LGTM! apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx (1) 106-126: LGTM! apps/herbatika/src/components/category/use-category-listing-queries.ts (1) 97-192: LGTM! apps/herbatika/src/components/category/use-category-facet-items.ts (1) 19-43: LGTM! apps/herbatika/src/components/product-detail.tsx (1) 53-65: LGTM! apps/herbatika/src/components/account-orders-list.tsx (1) 41-64: LGTM! Also applies to: 95-95 apps/herbatika/src/components/checkout/use-checkout-controller.ts (1) 169-173: LGTM! Also applies to: 410-424 apps/frontend-demo/src/components/molecules/header-search.tsx (2) 27-50: LGTM! Also applies to: 82-84 85-89: 🎯 Functional Correctness The product.id fallback is unnecessary Product.handle is required, and /products/[handle] is handle-based, so this branch should route by handle only. > Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
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 (2)
apps/herbatika/src/components/aside-filter.tsx (1)
184-202: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winfix: stop the slider sync effect from keying off a freshly created range.
Lines 196-201 now run after every render because
selectedRangeis rebuilt inline. WhenonChangeupdatessliderRange, this effect immediately writes the old committed range back into state, so the price slider can snap back while the user is dragging. Recompute the sync target inside the effect with primitive deps, or restore semantic memoisation forselectedRange.Proposed fix
const selectedRange = resolveRangeFromSelection( selectedPriceRange, priceBoundsForRender ) @@ - useEffect(() => { - setSliderRange((currentRange) => - areRangesEqual(currentRange, selectedRange) - ? currentRange - : selectedRange - ) - }, [selectedRange]) + useEffect(() => { + const nextSelectedRange = resolveRangeFromSelection( + selectedPriceRange, + priceBoundsForRender + ) + + setSliderRange((currentRange) => + areRangesEqual(currentRange, nextSelectedRange) + ? currentRange + : nextSelectedRange + ) + }, [ + selectedPriceRange.min, + selectedPriceRange.max, + priceBoundsForRender.min, + priceBoundsForRender.max, + ])🤖 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/aside-filter.tsx` around lines 184 - 202, The slider sync in aside-filter.tsx is using a freshly created selectedRange as the useEffect dependency, so the effect re-runs on every render and can overwrite in-progress drag updates. Update the synchronization around selectedRange, sliderRange, and resolveRangeFromSelection/resolveRangeWithinBounds so the committed range is derived from stable primitive dependencies inside the effect or memoized semantically before being used, and keep the setSliderRange guard based on areRangesEqual.apps/herbatika/src/components/product-detail/use-product-detail-data.ts (1)
49-182: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftrefactor: move the new product-detail resolvers into a sibling utility module.
Lines 49-182 are all pure derivation helpers, and this file now sits at ~360 lines. Splitting those helpers into a nearby
product-detail-data.utils.ts-style module would keep the hook readable and give you cleaner unit-test seams without changing behaviour. As per coding guidelines,apps/herbatika/src/**/*.{ts,tsx,js,jsx}: Keep source files at a soft limit of ~200 lines; exceeding this should trigger refactor consideration.🤖 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/use-product-detail-data.ts` around lines 49 - 182, The new pure derivation helpers in use-product-detail-data should be moved out of the hook into a sibling utility module to reduce file size and improve testability. Extract the resolver functions such as resolveSelectedVariant, resolveOptionTitlesById, resolveVariantItems, resolveShortDescriptionHtml, resolveProductSummaryText, resolveDisplayOriginalLabel, resolveProductVolumeDiscountOptions, resolveSelectedVolumeDiscountOption, resolveProductBreadcrumbItems, and resolveFreeShippingThresholdLabel into a nearby product-detail-data.utils-style file, then import them back into useProductDetailData without changing behavior.Source: Coding guidelines
🤖 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.tsx`:
- Around line 95-99: The fallback section in product-detail uses a raw Tailwind
radius class, which breaks the token-based styling contract. Update the section
wrapping the StatusText and LinkButton to use the existing Herbatika/UI-kit
radius token or equivalent prop instead of rounded-sm, keeping the styling
aligned with the token-driven approach used throughout the component.
---
Outside diff comments:
In `@apps/herbatika/src/components/aside-filter.tsx`:
- Around line 184-202: The slider sync in aside-filter.tsx is using a freshly
created selectedRange as the useEffect dependency, so the effect re-runs on
every render and can overwrite in-progress drag updates. Update the
synchronization around selectedRange, sliderRange, and
resolveRangeFromSelection/resolveRangeWithinBounds so the committed range is
derived from stable primitive dependencies inside the effect or memoized
semantically before being used, and keep the setSliderRange guard based on
areRangesEqual.
In `@apps/herbatika/src/components/product-detail/use-product-detail-data.ts`:
- Around line 49-182: The new pure derivation helpers in use-product-detail-data
should be moved out of the hook into a sibling utility module to reduce file
size and improve testability. Extract the resolver functions such as
resolveSelectedVariant, resolveOptionTitlesById, resolveVariantItems,
resolveShortDescriptionHtml, resolveProductSummaryText,
resolveDisplayOriginalLabel, resolveProductVolumeDiscountOptions,
resolveSelectedVolumeDiscountOption, resolveProductBreadcrumbItems, and
resolveFreeShippingThresholdLabel into a nearby product-detail-data.utils-style
file, then import them back into useProductDetailData without changing behavior.
🪄 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: 913937ab-e16a-4d9f-a74c-c25fb0938e51
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
apps/frontend-demo/src/components/molecules/header-search.tsxapps/herbatika/src/components/account-orders-list.tsxapps/herbatika/src/components/aside-filter.tsxapps/herbatika/src/components/category/use-category-facet-items.tsapps/herbatika/src/components/category/use-category-listing-queries.tsapps/herbatika/src/components/checkout/use-checkout-controller.tsapps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsxapps/herbatika/src/components/header/use-herbatika-header-submenu.tsapps/herbatika/src/components/product-detail.tsxapps/herbatika/src/components/product-detail/use-product-detail-data.tsapps/medusa-be/package.jsonapps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsxapps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsxapps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx
📜 Review details
🔇 Additional comments (13)
apps/medusa-be/package.json (1)
61-61: Still unresolved: keep the React Compiler tooling on a Vite-compatible line.This appears to be the same Medusa admin/Vite compatibility issue already raised earlier, and the current dependency versions still show that plugin line. Please re-check
@vitejs/plugin-reactand@rolldown/plugin-babelagainst the Medusa admin Vite major before merge.Also applies to: 95-103
apps/medusa-be/src/admin/components/common/modals/route-focus-modal/route-modal-provider.tsx (1)
18-18: LGTM!Also applies to: 22-26
apps/medusa-be/src/admin/routes/companies/components/employees/employees-create-form.tsx (1)
57-71: LGTM!Also applies to: 182-182, 215-225
apps/medusa-be/src/admin/routes/quotes/components/quote-manage/manage-items-section.tsx (1)
58-65: LGTM!apps/herbatika/src/components/header/use-herbatika-header-submenu.ts (1)
58-121: LGTM!apps/herbatika/src/components/header/herbatika-mobile-menu-nav.tsx (1)
106-126: LGTM!apps/herbatika/src/components/category/use-category-listing-queries.ts (1)
97-192: LGTM!apps/herbatika/src/components/category/use-category-facet-items.ts (1)
19-43: LGTM!apps/herbatika/src/components/product-detail.tsx (1)
53-65: LGTM!apps/herbatika/src/components/account-orders-list.tsx (1)
41-64: LGTM!Also applies to: 95-95
apps/herbatika/src/components/checkout/use-checkout-controller.ts (1)
169-173: LGTM!Also applies to: 410-424
apps/frontend-demo/src/components/molecules/header-search.tsx (2)
27-50: LGTM!Also applies to: 82-84
85-89: 🎯 Functional CorrectnessThe
product.idfallback is unnecessaryProduct.handleis required, and/products/[handle]is handle-based, so this branch should route by handle only.> Likely an incorrect or invalid review comment.
🛑 Comments failed to post (1)
apps/herbatika/src/components/product-detail.tsx (1)
95-99: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
fix: keep Herbatika radius styling token-based.
Line 95 introduces
rounded-sm, which is a raw Tailwind radius utility. Please swap it for the existing token-driven radius utility (or a UI-kit prop) so this fallback surface stays aligned with the Herbatika styling contract. As per coding guidelines,apps/herbatika/src/**/*.{jsx,tsx,css}: Use token-based utility classes instead of raw Tailwind palette/spacing values.🤖 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.tsx` around lines 95 - 99, The fallback section in product-detail uses a raw Tailwind radius class, which breaks the token-based styling contract. Update the section wrapping the StatusText and LinkButton to use the existing Herbatika/UI-kit radius token or equivalent prop instead of rounded-sm, keeping the styling aligned with the token-driven approach used throughout the component.Source: Coding guidelines
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87a0560ef3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbbed336e6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb059e0b0f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
🎉 This PR is included in version 0.19.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Validation
pnpm -w exec biome check --write <changed non-Herbatika files>pnpm --filter medusa-order-dashboard-plugin typecheckpnpm --dir apps/herbatika buildREDIS_SESSIONS_ENABLED=0 MEILISEARCH_ENABLED=0 CACHE_PROVIDER=inmemory EVENT_BUS_PROVIDER=local WORKFLOW_ENGINE_PROVIDER=inmemory LOCKING_PROVIDER=postgres FILE_PROVIDER=local FILE_LOCAL_UPLOAD_DIR=.medusa/uploads NOTIFICATION_PROVIDER=local pnpm --filter medusa-be exec medusa build --admin-onlyPAYLOAD_SECRET=local-build-secret DATABASE_URL=postgres://payload:payload@127.0.0.1:5432/payload S3_BUCKET=local-payload-bucket S3_ENDPOINT=http://127.0.0.1:9000 S3_REGION=local S3_ACCESS_KEY_ID=local S3_SECRET_ACCESS_KEY=local pnpm --dir apps/payload buildpnpm install --frozen-lockfileExisting blockers observed
pnpm --dir apps/herbatika validate:guardrailsfails on existing token/arbitrary-value violations across the apppnpm peers checkfails on existing peer mismatchespnpm --filter n1 buildfails because@techsio/analytics/*modules cannot be resolvedpnpm --filter frontend-demo buildfails after prebuild because backend category generation cannot connect tolocalhost:9000and then TypeScript hits an existingPopoverprop mismatch insrc/components/auth/auth-dropdown.tsxGenerated with Codex.
Summary by CodeRabbit