Skip to content

feat(herbatika): render homepage promo from CMS page - #543

Merged
KaiUweCZE merged 5 commits into
masterfrom
feat/herbatica-cms-homepage-promo
Aug 4, 2026
Merged

feat(herbatika): render homepage promo from CMS page#543
KaiUweCZE merged 5 commits into
masterfrom
feat/herbatica-cms-homepage-promo

Conversation

@KaiUweCZE

@KaiUweCZE KaiUweCZE commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Homepage promotional content can now be managed dynamically through the CMS.
    • Promotional sections support configurable headings, rich text, imagery and accessible navigation.
    • Added a redirect from /homepage-promo to the homepage promotion section.
    • Fallback content remains available when no promotional content is configured.
  • Bug Fixes

    • Promotional HTML is sanitised to remove unsafe elements, attributes and styles while preserving supported formatting.
  • Tests

    • Added coverage for supported rich text and sanitisation of unsafe content.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
new-engine-ui-storybook Ready Ready Preview Aug 4, 2026 3:34pm

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The homepage now fetches promotional content from the CMS, sanitises the supplied HTML, and renders dynamic promotion text and images. A redirect sends /homepage-promo to the homepage promotion anchor.

Changes

Homepage promotion

Layer / File(s) Summary
CMS promotion data contract and fetch
apps/herbatika/src/components/homepage/homepage.data.types.ts, apps/herbatika/src/lib/storefront/cms-types.ts, apps/herbatika/src/lib/storefront/cms-homepage-promo.ts, apps/herbatika/src/lib/storefront/cms.ts
The HomepagePromoContent type defines promotional content with required heading and HTML, plus optional image metadata. The CMS page type gains an optional image field. The mapper trims required fields, resolves image data, and returns HomepagePromoContent or null. The fetcher retrieves and maps the CMS page asynchronously.
Promotion HTML sanitisation
apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts, apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts, apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
The shared sanitiser accepts configurable options for additional tags, attributes, and attribute values. The homepage promotion configuration permits specific rich-text elements and constrained attributes. Tests verify preservation of supported markup and removal of unsafe content.
Homepage promotion rendering
apps/herbatika/src/app/page.tsx, apps/herbatika/src/components/herbatika-homepage.tsx, apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx, apps/herbatika/src/styles/tokens/_herbatika-spacing.css
The homepage fetches promotion data in parallel with existing storefront data and passes it to the promotion section. The section receives the promotion data, resolves dynamic image metadata with fallbacks, renders sanitised CMS HTML or fallback paragraphs, and implements anchor-based scrolling. A CSS token provides the scroll offset.
Promotion route redirect
apps/herbatika/next.config.ts
The /homepage-promo URL temporarily redirects to /#homepage-promo.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Visitor
  participant HomePage
  participant CMS
  participant HomepagePromoSection
  Visitor->>HomePage: open homepage
  HomePage->>CMS: fetch homepage promotion
  CMS-->>HomePage: return promotion data or null
  HomePage->>HomepagePromoSection: pass homepagePromo
  HomepagePromoSection-->>Visitor: render sanitised promotion or fallback
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes rendering the Herbatika homepage promotion from CMS content.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/herbatica-cms-homepage-promo
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/herbatica-cms-homepage-promo

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.

🔧 Biome (2.5.5)
apps/herbatika/src/styles/tokens/_herbatika-spacing.css

File contains syntax errors that prevent linting: Line 1: Tailwind-specific syntax is disabled.

🔧 ESLint

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

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

The PR moves the Herbatika homepage promotional section to CMS-managed content while retaining static fallbacks.

  • Fetches and maps the dedicated homepage-promo CMS page during homepage rendering.
  • Adds CMS-controlled heading, rich text, image, and image-alt content.
  • Redirects the standalone promo URL to the corresponding homepage anchor.
  • Adds an anchor scroll offset token for the storefront header.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/herbatika/src/app/page.tsx Fetches the homepage promo alongside existing SSR data and passes it into the homepage composition.
apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx Renders CMS promo fields with sanitized rich text, static fallbacks, and hash-target scrolling.
apps/herbatika/src/lib/storefront/cms-homepage-promo.ts Maps the dedicated CMS page into the homepage promo data contract and rejects incomplete title/content records.
apps/herbatika/next.config.ts Redirects the standalone CMS promo path to the homepage promo anchor.
apps/herbatika/src/styles/tokens/_herbatika-spacing.css Defines a tokenized scroll offset accounting for the mobile header and search form.

Reviews (2): Last reviewed commit: "fix(herbatika): scroll to homepage promo..." | Re-trigger Greptile

Comment thread apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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

Inline comments:
In `@apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts`:
- Around line 1-4: Reorder the specifiers in the import declaration for
sanitizeHtml and SanitizeHtmlOptions so the type-only specifier appears before
the value specifier, without changing the import source or running Biome.

In `@apps/herbatika/src/styles/tokens/_herbatika-spacing.css`:
- Around line 39-43: Update the calc expression for
--spacing-homepage-promo-scroll-offset so each continuation operator is placed
at the beginning of the following line, preserving the existing spacing
calculation and satisfying the stylesheet formatting rule.
🪄 Autofix

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 Plus

Run ID: f1fe8fc6-01a8-43c1-9f96-4caa987d5718

📥 Commits

Reviewing files that changed from the base of the PR and between e21f345 and d97dc63.

📒 Files selected for processing (8)
  • apps/herbatika/next.config.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/lib/storefront/cms.ts
  • apps/herbatika/src/styles/tokens/_herbatika-spacing.css
💤 Files with no reviewable changes (1)
  • apps/herbatika/src/lib/storefront/cms.ts
📜 Review details
⚠️ CI failures not shown inline (2)

GitHub Actions: CI / 0_main.txt: feat(herbatika): render homepage promo from CMS page

Conclusion: failure

View job details

##[group]❌ > nx run herbatika:lint
 �[2m$ biome check�[22m
 next.config.ts:73:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × This async function lacks an await expression.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Remove this async modifier, or add an await expression in the function.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Async functions without await expressions may not need to be declared async.
 src/app/page.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × Formatter would have printed the following content:
      8  8 │
      9  9 │   export default async function HomePage() {
     10    │ - ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all(
     11    │ - ····[
     12    │ - ······prefetchHomePageStorefrontData(),
     13    │ - ······fetchCmsHeroBanners(),
     14    │ - ······fetchCmsHomepagePromo(),
     15    │ - ····]
     16    │ - ··)
        10 │ + ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all([
        11 │ + ····prefetchHomePageStorefrontData(),
        12 │ + ····fetchCmsHeroBanners(),
        13 │ + ····fetchCmsHomepagePromo(),
        14 │ + ··])
     17 15 │
     18 16 │     return (
 src/components/homepage/sections/homepage-promo-html.ts:1:1 assist/source/organizeImports  FIXABLE  ━━━━━━━━━━
   × The imports and exports are not sorted.
   > 1 │ impo...

GitHub Actions: CI / main: feat(herbatika): render homepage promo from CMS page

Conclusion: failure

View job details

##[group]❌ > nx run herbatika:lint
 �[2m$ biome check�[22m
 next.config.ts:73:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × This async function lacks an await expression.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Remove this async modifier, or add an await expression in the function.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Async functions without await expressions may not need to be declared async.
 src/app/page.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × Formatter would have printed the following content:
      8  8 │
      9  9 │   export default async function HomePage() {
     10    │ - ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all(
     11    │ - ····[
     12    │ - ······prefetchHomePageStorefrontData(),
     13    │ - ······fetchCmsHeroBanners(),
     14    │ - ······fetchCmsHomepagePromo(),
     15    │ - ····]
     16    │ - ··)
        10 │ + ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all([
        11 │ + ····prefetchHomePageStorefrontData(),
        12 │ + ····fetchCmsHeroBanners(),
        13 │ + ····fetchCmsHomepagePromo(),
        14 │ + ··])
     17 15 │
     18 16 │     return (
 src/components/homepage/sections/homepage-promo-html.ts:1:1 assist/source/organizeImports  FIXABLE  ━━━━━━━━━━
   × The imports and exports are not sorted.
   > 1 │ impo...
🧰 Additional context used
📓 Path-based instructions (10)
apps/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Import UI components using the @techsio/ui-kit namespace, not @libs/ui, for runtime apps

Files:

  • apps/herbatika/next.config.ts
  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.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/next.config.ts
  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.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/next.config.ts
  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/styles/tokens/_herbatika-spacing.css
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.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/next.config.ts
  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
apps/herbatika/**/*.{ts,tsx}

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

apps/herbatika/**/*.{ts,tsx}: Keep app-specific behavior in Herbatika; promote behavior into shared libraries only when there is a real API or platform gap.
For UI work consuming @techsio/ui-kit, follow the required UI-kit workflow and relevant usage, integration, token, and audit skills; library authoring must follow libs/ui/AGENTS.md and library skills.
For storefront-data work, use the relevant shared-data skill and prefer the preset surface from @techsio/storefront-data, including shared hooks, flows, query keys, query options, cache policy, and SSR helpers.

Files:

  • apps/herbatika/next.config.ts
  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
apps/herbatika/**/*

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

apps/herbatika/**/*: Do not edit generated outputs in .next/, dist/, or storybook-static/. Do not edit ignored local/ reference files unless explicitly requested.
The app runs on http://localhost:3001; do not assume the root frontend-demo URL localhost:3000. Prefer root-invoked scripts using pnpm -C apps/herbatika <script>.
Do not run Biome commands in this app until the stability issue is resolved.
Treat approximately 200 lines per source file as a soft limit; exceeding it should prompt refactoring consideration, not act as an absolute blocker.

Files:

  • apps/herbatika/next.config.ts
  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/styles/tokens/_herbatika-spacing.css
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
apps/herbatika/src/**/*.{ts,tsx}

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

apps/herbatika/src/**/*.{ts,tsx}: Use internal UI primitives and components first; avoid raw <button>, <input>, <select>, <textarea>, <img>, and inline SVG icons unless a documented exception exists.
For Next.js links and images, prefer UI-kit components with next/link or next/image adapter support when available.
Use token-based utility classes instead of raw Tailwind palette or spacing values.
Put Herbatika visual differences in src/styles/tokens/**; avoid JSX className overrides that duplicate UI-kit component props or tokens.
Keep app-local data code thin: SDK instances, field defaults, localized text, toasts, analytics, form DTOs, address adapters, and Herbatika-specific read models may remain local.
Move repeated backend communication, query-key construction, cache synchronization, mutation invalidation, and reusable Medusa behavior into libs/storefront-data.
Use explicit package subpath imports; never import from package roots or dist/.
Keep server-only and client-only boundaries explicit; use server-only and getServerQueryClient for Server Component and SSR data paths.
Prefer small composable modules and shared helpers over duplicated logic.
Use kebab-case file names and PascalCase React component names.

Files:

  • apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
apps/herbatika/src/lib/storefront/**/*.{ts,tsx}

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

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

Files:

  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Vitest for running tests in backend and UI library projects

Files:

  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
apps/herbatika/**/*.{test,spec}.{ts,tsx}

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

Manual QA must include a user-flow smoke pass, DevTools Console and Network checks, and visual regression review; save evidence under .qa/local-web-testing-YYYY-MM-DD/.

Files:

  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
🧠 Learnings (2)
📚 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/product-detail/utils/html-sanitizer.ts
  • apps/herbatika/src/lib/storefront/cms-homepage-promo.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts
  • apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
📚 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/homepage/sections/homepage-promo-section.tsx
🪛 ast-grep (0.45.0)
apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx

[warning] 54-54: Usage of dangerouslySetInnerHTML detected. This bypasses React's built-in XSS protection. Always sanitize HTML content using libraries like DOMPurify before injecting it into the DOM to prevent XSS attacks.
Context: dangerouslySetInnerHTML
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation

(react-unsafe-html-injection)

🪛 GitHub Actions: CI / 0_main.txt
apps/herbatika/next.config.ts

[error] 73-81: Biome lint error (lint/suspicious/useAwait): async function 'redirects' has no await expression. Remove 'async' or add an await.

apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts

[error] 99-105: Biome lint error (lint/nursery/useMaxParams): isAttributeAllowed has 5 parameters, but no more than 4 are allowed.

apps/herbatika/src/lib/storefront/cms-homepage-promo.ts

[error] 35-37: Biome formatting check failed. Collapse the mapCmsPageToHomepagePromo call to the expected single-line format.

apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx

[error] 53-53: Biome lint error (lint/nursery/useSortedClasses): CSS classes in the className attribute are not sorted.

apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts

[error] 1-4: Biome organizeImports check failed (assist/source/organizeImports). Reorder the type and value imports.

🪛 GitHub Actions: CI / main
apps/herbatika/next.config.ts

[error] 73-81: Biome lint/suspicious/useAwait: async function 'redirects' lacks an await expression. Remove async or add an await.

apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts

[error] 99-105: Biome lint/nursery/useMaxParams: Function 'isAttributeAllowed' has 5 parameters; no more than 4 are allowed.

apps/herbatika/src/lib/storefront/cms-homepage-promo.ts

[error] 35-37: Biome formatter check failed. Format the mapCmsPageToHomepagePromo call according to Biome's expected formatting.

apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx

[error] 53-53: Biome lint/nursery/useSortedClasses: CSS classes in className are not sorted.

apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts

[error] 1-4: Biome assist/source/organizeImports: Imports and exports are not sorted. Run Biome's organize imports fix.

🪛 Stylelint (17.14.1)
apps/herbatika/src/styles/tokens/_herbatika-spacing.css

[error] 40-40: Unexpected newline after "+" (scss/operator-no-newline-after)

(scss/operator-no-newline-after)


[error] 41-41: Unexpected newline after "+" (scss/operator-no-newline-after)

(scss/operator-no-newline-after)

🔇 Additional comments (6)
apps/herbatika/next.config.ts (1)

73-81: LGTM!

apps/herbatika/src/lib/storefront/cms-homepage-promo.ts (1)

8-8: LGTM!

Also applies to: 13-31

apps/herbatika/src/components/product-detail/utils/html-sanitizer.ts (1)

44-52: LGTM!

Also applies to: 100-116, 248-280, 292-313, 329-329

apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts (1)

6-35: LGTM!

apps/herbatika/src/components/homepage/sections/homepage-promo-html.test.ts (1)

1-50: LGTM!

apps/herbatika/src/components/homepage/sections/homepage-promo-section.tsx (1)

2-6: LGTM!

Also applies to: 18-33, 53-55

Comment thread apps/herbatika/src/styles/tokens/_herbatika-spacing.css

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
apps/herbatika/src/styles/tokens/_herbatika-spacing.css (1)

40-42: ⚠️ Potential issue | 🟠 Major

Restore the formatter-approved calc layout.

CI still rejects this expression. Keep each + at the end of the preceding line, as in Lines 64-68.

Proposed fix
-    var(--height-header-mobile)
-    + var(--height-search-form)
-    + var(--spacing-300)
+    var(--height-header-mobile) +
+    var(--height-search-form) +
+    var(--spacing-300)

As per coding guidelines, do not run Biome commands in this app until the stability issue is resolved. Apply this formatting manually.

🤖 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/styles/tokens/_herbatika-spacing.css` around lines 40 -
42, Manually restore the formatter-approved calc layout in the spacing
expression around the listed CSS variables by placing each “+” at the end of the
preceding line, matching the existing pattern in the nearby Lines 64-68; do not
run Biome commands.

Sources: Coding guidelines, Linters/SAST tools, Pipeline failures

🤖 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.

Duplicate comments:
In `@apps/herbatika/src/styles/tokens/_herbatika-spacing.css`:
- Around line 40-42: Manually restore the formatter-approved calc layout in the
spacing expression around the listed CSS variables by placing each “+” at the
end of the preceding line, matching the existing pattern in the nearby Lines
64-68; do not run Biome commands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: af094f80-e9f0-4f07-ab3e-981f0e3034a3

📥 Commits

Reviewing files that changed from the base of the PR and between d97dc63 and ee88006.

📒 Files selected for processing (2)
  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
  • apps/herbatika/src/styles/tokens/_herbatika-spacing.css
📜 Review details
⚠️ CI failures not shown inline (2)

GitHub Actions: CI / main: feat(herbatika): render homepage promo from CMS page

Conclusion: failure

View job details

##[group]❌ > nx run herbatika:lint
 �[2m$ biome check�[22m
 next.config.ts:73:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × This async function lacks an await expression.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Remove this async modifier, or add an await expression in the function.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Async functions without await expressions may not need to be declared async.
 src/app/page.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × Formatter would have printed the following content:
      8  8 │
      9  9 │   export default async function HomePage() {
     10    │ - ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all(
     11    │ - ····[
     12    │ - ······prefetchHomePageStorefrontData(),
     13    │ - ······fetchCmsHeroBanners(),
     14    │ - ······fetchCmsHomepagePromo(),
     15    │ - ····]
     16    │ - ··)
        10 │ + ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all([
        11 │ + ····prefetchHomePageStorefrontData(),
        12 │ + ····fetchCmsHeroBanners(),
        13 │ + ····fetchCmsHomepagePromo(),
        14 │ + ··])
     17 15 │
     18 16 │     return (
 src/components/homepage/sections/homepage-promo-section.tsx:53:23 lint/nursery/useSortedClasses  FIXABLE  ━━━━━━━━━━
   × These CSS classes should be sorted.
     51 │  ...

GitHub Actions: CI / 0_main.txt: feat(herbatika): render homepage promo from CMS page

Conclusion: failure

View job details

##[group]❌ > nx run herbatika:lint
 �[2m$ biome check�[22m
 next.config.ts:73:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × This async function lacks an await expression.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Remove this async modifier, or add an await expression in the function.
     71 │   reactCompiler: true,
     72 │   cacheComponents: true,
   > 73 │   async redirects() {
        │   ^^^^^^^^^^^^^^^^^^^
   > 74 │     return [
         ...
   > 80 │     ]
   > 81 │   },
        │   ^
     82 │   outputFileTracingRoot: join(__dirname, "../../"),
     83 │   outputFileTracingExcludes: {
   i Async functions without await expressions may not need to be declared async.
 src/app/page.tsx format ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   × Formatter would have printed the following content:
      8  8 │
      9  9 │   export default async function HomePage() {
     10    │ - ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all(
     11    │ - ····[
     12    │ - ······prefetchHomePageStorefrontData(),
     13    │ - ······fetchCmsHeroBanners(),
     14    │ - ······fetchCmsHomepagePromo(),
     15    │ - ····]
     16    │ - ··)
        10 │ + ··const·[{·dehydratedState·},·heroBanners,·homepagePromo]·=·await·Promise.all([
        11 │ + ····prefetchHomePageStorefrontData(),
        12 │ + ····fetchCmsHeroBanners(),
        13 │ + ····fetchCmsHomepagePromo(),
        14 │ + ··])
     17 15 │
     18 16 │     return (
 src/components/homepage/sections/homepage-promo-section.tsx:53:23 lint/nursery/useSortedClasses  FIXABLE  ━━━━━━━━━━
   × These CSS classes should be sorted.
     51 │  ...
🧰 Additional context used
📓 Path-based instructions (7)
apps/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Import UI components using the @techsio/ui-kit namespace, not @libs/ui, for runtime apps

Files:

  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.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/homepage/sections/homepage-promo-html.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/homepage/sections/homepage-promo-html.ts
  • apps/herbatika/src/styles/tokens/_herbatika-spacing.css
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/homepage/sections/homepage-promo-html.ts
apps/herbatika/**/*.{ts,tsx}

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

apps/herbatika/**/*.{ts,tsx}: Keep app-specific behavior in Herbatika; promote behavior into shared libraries only when there is a real API or platform gap.
For UI work consuming @techsio/ui-kit, follow the required UI-kit workflow and relevant usage, integration, token, and audit skills; library authoring must follow libs/ui/AGENTS.md and library skills.
For storefront-data work, use the relevant shared-data skill and prefer the preset surface from @techsio/storefront-data, including shared hooks, flows, query keys, query options, cache policy, and SSR helpers.

Files:

  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
apps/herbatika/**/*

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

apps/herbatika/**/*: Do not edit generated outputs in .next/, dist/, or storybook-static/. Do not edit ignored local/ reference files unless explicitly requested.
The app runs on http://localhost:3001; do not assume the root frontend-demo URL localhost:3000. Prefer root-invoked scripts using pnpm -C apps/herbatika <script>.
Do not run Biome commands in this app until the stability issue is resolved.
Treat approximately 200 lines per source file as a soft limit; exceeding it should prompt refactoring consideration, not act as an absolute blocker.

Files:

  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
  • apps/herbatika/src/styles/tokens/_herbatika-spacing.css
apps/herbatika/src/**/*.{ts,tsx}

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

apps/herbatika/src/**/*.{ts,tsx}: Use internal UI primitives and components first; avoid raw <button>, <input>, <select>, <textarea>, <img>, and inline SVG icons unless a documented exception exists.
For Next.js links and images, prefer UI-kit components with next/link or next/image adapter support when available.
Use token-based utility classes instead of raw Tailwind palette or spacing values.
Put Herbatika visual differences in src/styles/tokens/**; avoid JSX className overrides that duplicate UI-kit component props or tokens.
Keep app-local data code thin: SDK instances, field defaults, localized text, toasts, analytics, form DTOs, address adapters, and Herbatika-specific read models may remain local.
Move repeated backend communication, query-key construction, cache synchronization, mutation invalidation, and reusable Medusa behavior into libs/storefront-data.
Use explicit package subpath imports; never import from package roots or dist/.
Keep server-only and client-only boundaries explicit; use server-only and getServerQueryClient for Server Component and SSR data paths.
Prefer small composable modules and shared helpers over duplicated logic.
Use kebab-case file names and PascalCase React component names.

Files:

  • apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts
🧠 Learnings (1)
📚 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/homepage/sections/homepage-promo-html.ts
🪛 GitHub Actions: CI / 0_main.txt
apps/herbatika/src/styles/tokens/_herbatika-spacing.css

[error] 40-42: Biome formatter check failed. Format the calc expression according to the formatter output.

🪛 GitHub Actions: CI / main
apps/herbatika/src/styles/tokens/_herbatika-spacing.css

[error] 40-42: Biome formatting check failed. Format the calc expression according to Biome.

🪛 Stylelint (17.14.1)
apps/herbatika/src/styles/tokens/_herbatika-spacing.css

[error] 41-41: Unexpected newline before "+" (scss/operator-no-newline-before)

(scss/operator-no-newline-before)


[error] 42-42: Unexpected newline before "+" (scss/operator-no-newline-before)

(scss/operator-no-newline-before)

🔇 Additional comments (1)
apps/herbatika/src/components/homepage/sections/homepage-promo-html.ts (1)

3-3: LGTM!

@KaiUweCZE
KaiUweCZE merged commit dd6d75e into master Aug 4, 2026
4 of 5 checks passed
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 0.32.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant