Skip to content

fix: divider#62

Open
tg14102005-a11y wants to merge 6 commits into
mainfrom
feat/add-divider-tehila-v2
Open

fix: divider#62
tg14102005-a11y wants to merge 6 commits into
mainfrom
feat/add-divider-tehila-v2

Conversation

@tg14102005-a11y
Copy link
Copy Markdown
Collaborator

@tg14102005-a11y tg14102005-a11y commented Apr 28, 2026

Description

Please include a summary of the changes and the related issue.

Related Issue(s)

Fixes # (issue number)

Checklist:

  • [v ] I have performed a self-review of my own code
  • [v ] My changes generate no new warnings

Screenshots (if appropriate):

Summary by CodeRabbit

  • New Features

    • Added visual divider component with horizontal and vertical orientation options
    • Added meal recommendation card displaying recipe details with a view recipe button
    • Updated Daily Tips section with improved visual layout
  • Localization

    • Added pain level and concentration UI labels across English, Arabic, Hebrew, and Russian translations
  • Documentation

    • Added interactive component documentation via Storybook with live examples and interaction testing

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces a reusable Divider UI component, a Meal Recommendation component for the diet feature, translations for pain and concentration metrics across four languages, and a comprehensive Storybook setup with example components and Playwright-based test infrastructure. The DailyTips component integrates the new Divider.

Changes

Divider Component

Layer / File(s) Summary
Divider orientation types and constants
src/components/UI/Divider/types.ts
DividerOrientation constant and type define HORIZONTAL and VERTICAL string values for divider layout direction.
Divider styling and layout
src/components/UI/Divider/styles.ts
getDividerStyles(theme) provides theme-aware CSSProperties for horizontal and vertical dividers using mediumGrey palette color and fixed dimensions/margins.
Divider component and exports
src/components/UI/Divider/SGLDivider.tsx, src/components/UI/Divider/index.ts
SGLDivider component accepts optional orientation, defaults to horizontal, applies theme styles via Box, and module re-exports both component and orientation type for consumer imports.
DailyTips integration
src/pages/home/dailyTips/DailyTips.tsx
DailyTips wraps its card in a fragment and renders SGLDivider below the card, using mobile-aware layout for the card content.

Meal Recommendation Component

Layer / File(s) Summary
Meal recommendation styling
src/pages/lifeStyle/dietTab/mealRecommendation/styles.ts
getMealRecommendationStyles(theme) defines MUI SxProps for container layout, hero image placeholder, content typography, and primary-styled button with hover effects.
Meal recommendation component and exports
src/pages/lifeStyle/dietTab/mealRecommendation/MealRecommendation.tsx, src/pages/lifeStyle/dietTab/mealRecommendation/index.ts
SGLMealRecommendation accepts name, recipe, and optional onViewRecipe callback; renders hero image, title, recipe text, and conditionally shows a button to view the full recipe in Hebrew.

Localization

Layer / File(s) Summary
Pain and concentration translations
src/locales/en/translation.json, src/locales/ar/translation.json, src/locales/he/translation.json, src/locales/ru/translation.json
Six new localization keys (pain.level, pain.high, pain.low, concentration, concentration.high, concentration.low) added across all four language files with corresponding translated strings.

Storybook & Testing Infrastructure

Layer / File(s) Summary
Storybook configuration
.storybook/main.ts, .gitignore
Storybook main config defines story globs, enables Chromatic/Vitest/a11y/docs/onboarding addons, and uses @storybook/react-vite framework; .gitignore ignores Storybook artifacts.
ESLint and package dependencies
eslint.config.js, package.json
ESLint config adds Storybook plugin and recommended rules; package.json adds Storybook scripts (dev/build), core/Vite/Chromatic/Vitest/addon dependencies, and Playwright browser testing packages.
Vitest multi-project test setup
vite.config.ts, vitest.shims.d.ts
Vitest config restructures single test into multi-project setup with base jsdom project and Storybook+Playwright project (Chromium headless); type shims reference Playwright types.
Example components (Button)
src/stories/Button.tsx, src/stories/button.css, src/stories/Button.stories.ts
Reusable Storybook Button component with primary, size, and backgroundColor props; CSS defines base and modifier classes; stories export Primary, Secondary, Large, Small variants.
Example components (Header & Page)
src/stories/Header.tsx, src/stories/header.css, src/stories/Header.stories.ts, src/stories/Page.tsx, src/stories/page.css, src/stories/Page.stories.ts
Header component conditionally renders login/logout UI based on user state; Page combines Header with static instructional content and state management; both include CSS styling; stories include LoggedIn, LoggedOut, and an interaction test via play function.
Storybook documentation
src/stories/Configure.mdx
MDX documentation page "Configure your project" with guidance cards, feature tiles (Autodocs, Chromatic, Figma Plugin, Testing, Accessibility, Theming), addon callout, social/community links, and embedded responsive styling.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • Tamir198

Poem

🐰 A divider sits tall, a meal shines bright,
Story pages dance in the testing light,
Languages blend with new care and translation,
Infrastructure blooms—what a grand celebration!
From components to tests, the framework takes flight!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. The template requires a summary of changes and related issue, but both sections contain only placeholders with no actual content provided. Complete the description by providing a clear summary of what was changed and specify the related issue number, or remove the placeholder if no issue exists.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive terms like 'fix' without clearly indicating what was fixed or the primary change. Replace with a more descriptive title that clearly summarizes the main change, such as 'feat: add SGLDivider component and update divider styles' or similar.
✅ Passed checks (3 passed)
Check name Status Explanation
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-divider-tehila-v2
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/add-divider-tehila-v2

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
src/components/UI/Divider/SGLDivider.tsx (1)

6-13: Consider adding prop validation for percent.

The percent prop is typed as number but there's no runtime validation ensuring it's within 0-100 range. MUI's LinearProgress will clamp values, so this won't break, but documenting or validating the expected range could improve developer experience.

💡 Optional: Add JSDoc or validation
 interface SGLDividerProps {
   label: string
   value: string
+  /** Progress percentage (0-100) */
   percent: number
   lowLabel: string
   highLabel: string
   icon?: ReactNode
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/UI/Divider/SGLDivider.tsx` around lines 6 - 13, The percent
prop in SGLDividerProps lacks runtime validation; update the interface with a
JSDoc comment describing the 0–100 expectation and, inside the SGLDivider
component (where percent is consumed), clamp the value to the 0–100 range before
passing it to MUI's LinearProgress and emit a console.warn if the original value
was out of range; reference SGLDividerProps and the percent variable (and the
SGLDivider component) so maintainers can find and apply the clamp+warning logic.
src/pages/home/dailyTips/DailyTips.tsx (2)

37-53: Hardcoded values for value and percent.

Both SGLDivider instances use hardcoded value="5/10" and percent={50}. If this is placeholder/demo data, consider adding a TODO comment or sourcing from actual data. If intentional for this phase, this is fine to address later.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/home/dailyTips/DailyTips.tsx` around lines 37 - 53, Two SGLDivider
components (SGLDivider for pain and SGLDivider for concentration) use hardcoded
value="5/10" and percent={50}; replace these hardcoded props with real values
(e.g., derive from props/state/context such as painScore and concentrationScore
and compute percent = (score/10)*100 or source from your data model) or, if they
are temporary placeholders, add a clear TODO comment above each SGLDivider
noting they are demo values and must be replaced with real data later; update
the SGLDivider invocations (the value and percent props) accordingly so the
displayed text and percent reflect the actual computed variables.

10-10: Inconsistent icon usage pattern.

Bandage is imported directly from lucide-react (line 10) while SGLBrainIcon uses the established wrapper pattern in this codebase. For consistency, consider creating an SGLBandageIcon wrapper similar to SGLBrainIcon (see src/components/UI/Icons/BrainIcon/SGLBrainIcon.tsx).

♻️ Create a wrapper component

Create src/components/UI/Icons/BandageIcon/SGLBandageIcon.tsx:

import type { CSSProperties } from '@mui/material'
import { Bandage, type LucideProps } from 'lucide-react'

interface SGLBandageIconProps extends LucideProps {
  styles?: CSSProperties
  color?: string
  size?: number
  strokeWidth?: number
}

export const SGLBandageIcon = ({
  color = 'white',
  strokeWidth,
  size,
  styles,
  ...props
}: SGLBandageIconProps) => {
  return <Bandage color={color} strokeWidth={strokeWidth} size={size} style={styles} {...props} />
}

Then update DailyTips.tsx:

-import { Bandage } from 'lucide-react'
+import { SGLBandageIcon } from '@/components/UI/Icons/BandageIcon/SGLBandageIcon'
-        icon={<Bandage size={20} color={theme.palette.orange.main} />}
+        icon={<SGLBandageIcon size={20} color={theme.palette.orange.main} />}

Also applies to: 43-43

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/home/dailyTips/DailyTips.tsx` at line 10, Create a wrapper
component SGLBandageIcon (mirroring SGLBrainIcon) that re-exports the
lucide-react Bandage with the same props pattern (support CSSProperties via
styles, color defaulting to 'white', size, strokeWidth, and pass-through
LucideProps), place it at
src/components/UI/Icons/BandageIcon/SGLBandageIcon.tsx, then update
DailyTips.tsx to import and use SGLBandageIcon instead of importing Bandage
directly; remove the direct Bandage import so DailyTips uses the consistent
wrapper pattern used by SGLBrainIcon.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/locales/ar/translation.json`:
- Around line 70-76: The new translation entries for keys "pain.level",
"pain.high", "pain.low", "concentration", "concentration.high", and
"concentration.low" have inconsistent indentation; update these JSON lines to
use the same 2-space indentation as the rest of the file so each key-value pair
is indented with two spaces (e.g., align them with
"checkIn.completedSuccessfully") to match the locale formatting conventions.

In `@src/locales/en/translation.json`:
- Around line 70-76: The new translation keys ("pain.level", "pain.high",
"pain.low", "concentration", "concentration.high", "concentration.low") have
inconsistent indentation; update those keys to match the file's standard 2-space
indentation so all JSON entries align with existing entries (ensure each key
line begins with two spaces before the quote and a trailing comma/formatting
matches surrounding entries).

In `@src/locales/he/translation.json`:
- Around line 71-77: The new Hebrew translation keys ("pain.level", "pain.high",
"pain.low", "concentration", "concentration.high", "concentration.low") have
inconsistent indentation; update those lines to match the file's standard
2-space indentation (align them with "checkIn.completedSuccessfully") so the
JSON entries are uniformly indented and the file stays consistent with other
locale files.

In `@src/locales/ru/translation.json`:
- Around line 70-76: The new translation keys "pain.level", "pain.high",
"pain.low", "concentration", "concentration.high", and "concentration.low" are
misaligned with the file's 2-space indentation; fix by aligning each of those
keys with the rest of the JSON (prepend two spaces before each key) so the file
maintains consistent formatting and valid JSON structure.

---

Nitpick comments:
In `@src/components/UI/Divider/SGLDivider.tsx`:
- Around line 6-13: The percent prop in SGLDividerProps lacks runtime
validation; update the interface with a JSDoc comment describing the 0–100
expectation and, inside the SGLDivider component (where percent is consumed),
clamp the value to the 0–100 range before passing it to MUI's LinearProgress and
emit a console.warn if the original value was out of range; reference
SGLDividerProps and the percent variable (and the SGLDivider component) so
maintainers can find and apply the clamp+warning logic.

In `@src/pages/home/dailyTips/DailyTips.tsx`:
- Around line 37-53: Two SGLDivider components (SGLDivider for pain and
SGLDivider for concentration) use hardcoded value="5/10" and percent={50};
replace these hardcoded props with real values (e.g., derive from
props/state/context such as painScore and concentrationScore and compute percent
= (score/10)*100 or source from your data model) or, if they are temporary
placeholders, add a clear TODO comment above each SGLDivider noting they are
demo values and must be replaced with real data later; update the SGLDivider
invocations (the value and percent props) accordingly so the displayed text and
percent reflect the actual computed variables.
- Line 10: Create a wrapper component SGLBandageIcon (mirroring SGLBrainIcon)
that re-exports the lucide-react Bandage with the same props pattern (support
CSSProperties via styles, color defaulting to 'white', size, strokeWidth, and
pass-through LucideProps), place it at
src/components/UI/Icons/BandageIcon/SGLBandageIcon.tsx, then update
DailyTips.tsx to import and use SGLBandageIcon instead of importing Bandage
directly; remove the direct Bandage import so DailyTips uses the consistent
wrapper pattern used by SGLBrainIcon.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb90ac69-efa3-413e-be51-7ee838113857

📥 Commits

Reviewing files that changed from the base of the PR and between 0fdeada and 69cd3b0.

📒 Files selected for processing (7)
  • src/components/UI/Divider/SGLDivider.tsx
  • src/components/UI/Divider/styles.ts
  • src/locales/ar/translation.json
  • src/locales/en/translation.json
  • src/locales/he/translation.json
  • src/locales/ru/translation.json
  • src/pages/home/dailyTips/DailyTips.tsx

Comment thread src/locales/ar/translation.json Outdated
Comment thread src/locales/en/translation.json Outdated
Comment thread src/locales/he/translation.json Outdated
Comment thread src/locales/ru/translation.json Outdated
Copy link
Copy Markdown
Member

@Tamir198 Tamir198 left a comment

Choose a reason for hiding this comment

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

I cant understand what task from clickup this fixes , your title fix: pr review comments is not clear and there is no link to the issue right now

import { Box } from '@mui/material'
import { dividerStyles } from './styles'

export const SGLDivider = () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Our custom components should add ...props and also create an interface for the styles of the divider.
And one more thing, lets add a prop for vertical or horizontal divider, which will be horizontal by default

Comment thread src/components/UI/Divider/styles.ts Outdated
width: '100%',
height: '1px',
backgroundColor: 'mediumGrey.main',
my: 1.5,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use css properties not mui props

Comment thread src/components/UI/Divider/styles.ts Outdated
height: '1px',
backgroundColor: 'mediumGrey.main',
my: 1.5,
} as SxProps<Theme>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And change this type as well

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@src/components/UI/Divider/SGLDivider.tsx`:
- Line 15: The divider is rendered as a non-semantic <Box> in SGLDivider.tsx so
screen readers skip it; update the SGLDivider component to add role="separator"
and an aria-orientation attribute on the rendered <Box> (use
aria-orientation="vertical" when the divider is vertical, otherwise
"horizontal"), deriving the orientation from the component's existing
orientation/vertical prop or style logic so the accessibility attributes always
match the visual orientation.

In `@src/components/UI/Divider/styles.ts`:
- Around line 18-24: The vertical divider style dividerVertical uses height:
'100%' which can compute to 0 if the parent has no explicit height; change it to
use a minHeight with a fixed fallback (e.g., set minHeight to a sensible
pixel/rem value like '24px' or '1.5rem') and remove or keep height only if
parent height is guaranteed, and add a brief comment in the styles file noting
that callers must supply an explicit parent height if a full-height behavior is
required; update the rule in styles.ts for dividerVertical accordingly.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 924df189-1468-4c62-94c7-98a2e241edb7

📥 Commits

Reviewing files that changed from the base of the PR and between 3fa7170 and 9134d7d.

📒 Files selected for processing (2)
  • src/components/UI/Divider/SGLDivider.tsx
  • src/components/UI/Divider/styles.ts

const styles =
orientation === 'vertical' ? dividerStyles.dividerVertical : dividerStyles.dividerHorizontal

return <Box style={styles} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add role="separator" and aria-orientation for screen-reader accessibility.

<Box> renders a <div> with no semantic meaning. Screen readers will silently skip it; adding role="separator" with a matching aria-orientation communicates the divider's purpose to assistive technologies.

♿ Proposed fix
-  return <Box style={styles} />
+  return <Box role="separator" aria-orientation={orientation} style={styles} />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return <Box style={styles} />
return <Box role="separator" aria-orientation={orientation} style={styles} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/UI/Divider/SGLDivider.tsx` at line 15, The divider is rendered
as a non-semantic <Box> in SGLDivider.tsx so screen readers skip it; update the
SGLDivider component to add role="separator" and an aria-orientation attribute
on the rendered <Box> (use aria-orientation="vertical" when the divider is
vertical, otherwise "horizontal"), deriving the orientation from the component's
existing orientation/vertical prop or style logic so the accessibility
attributes always match the visual orientation.

Comment on lines +18 to +24
dividerVertical: {
width: '1px',
height: '100%',
backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
marginLeft: '1.5rem',
marginRight: '1.5rem',
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

height: '100%' on the vertical divider will silently render as 0 without a parent height.

In a standard block or column-flex layout (common for the card-list context this is used in), percentage heights resolve to 0 when the parent has no explicit height. The vertical divider will be invisible.

Consider using minHeight with a fixed fallback, or document that callers must provide a parent with a defined height.

💡 One approach — explicit minimum height
   dividerVertical: {
     width: '1px',
-    height: '100%',
+    height: '100%',
+    minHeight: '1rem',
     backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
     marginLeft: '1.5rem',
     marginRight: '1.5rem',
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dividerVertical: {
width: '1px',
height: '100%',
backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
marginLeft: '1.5rem',
marginRight: '1.5rem',
},
dividerVertical: {
width: '1px',
height: '100%',
minHeight: '1rem',
backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
marginLeft: '1.5rem',
marginRight: '1.5rem',
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/UI/Divider/styles.ts` around lines 18 - 24, The vertical
divider style dividerVertical uses height: '100%' which can compute to 0 if the
parent has no explicit height; change it to use a minHeight with a fixed
fallback (e.g., set minHeight to a sensible pixel/rem value like '24px' or
'1.5rem') and remove or keep height only if parent height is guaranteed, and add
a brief comment in the styles file noting that callers must supply an explicit
parent height if a full-height behavior is required; update the rule in
styles.ts for dividerVertical accordingly.

@tg14102005-a11y tg14102005-a11y requested a review from Tamir198 May 2, 2026 20:36
@Tamir198 Tamir198 changed the title fix: pr review comments fix: divider May 3, 2026
Copy link
Copy Markdown
Member

@Tamir198 Tamir198 left a comment

Choose a reason for hiding this comment

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

Left some comments, also try to avoid commits in hebrew

const dividerStyles = getDividerStyles(theme)

const styles =
orientation === 'vertical' ? dividerStyles.dividerVertical : dividerStyles.dividerHorizontal
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Save orientation into enum, make sure to expose that enum so it will be useable

const styles =
orientation === 'vertical' ? dividerStyles.dividerVertical : dividerStyles.dividerHorizontal

return <Box style={styles} />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We use sx for inner components

Comment thread src/components/UI/Divider/styles.ts Outdated
dividerHorizontal: {
width: '100%',
height: '1px',
backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No hardcoded colors, bring them from the theme file
Also why do you need that fallback color?

Comment thread src/components/UI/Divider/styles.ts Outdated
dividerVertical: {
width: '1px',
height: '100%',
backgroundColor: theme.palette.mediumGrey?.main || '#e0e0e0',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment in here about the color

"checkIn.performCheckIn": "בצע צ'ק אין",
"checkIn.notComing": "לא מגיע",
"checkIn.completedSuccessfully": "בוצע בהצלחה"
"checkIn.completedSuccessfully": "בוצע בהצלחה",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How are those files related this divider pr?

@tg14102005-a11y tg14102005-a11y requested a review from Tamir198 May 9, 2026 18:27
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/pages/lifeStyle/dietTab/DietTabExample.tsx (1)

27-27: ⚖️ Poor tradeoff

Replace alert() with production-ready UI.

The alert() call appears to be placeholder code. For production, consider using a modal, toast notification, or navigation to a recipe detail view.

🤖 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 `@src/pages/lifeStyle/dietTab/DietTabExample.tsx` at line 27, The inline alert
in DietTabExample (the onViewRecipe={() => alert(`צפייה ב: ${meal.name}`)}) is a
placeholder—replace it with a production UI flow by wiring onViewRecipe to
either open your recipe detail modal/component or navigate to a recipe detail
route; for example, call a local handler (e.g., handleViewRecipe) that uses
setState/showRecipeModal with the selected meal (meal.id or meal) or calls your
router (e.g., navigateToRecipeDetail(meal.id)) and remove the alert call. Ensure
the new handler uses existing UI primitives (RecipeModal, Toast, or your
navigation function) and passes the meal data so the detail view can render.
🤖 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 `@src/pages/lifeStyle/dietTab/DietTabExample.tsx`:
- Line 21: Replace the hardcoded Hebrew heading in the DietTabExample component
with the i18n call: import and use the project's translation hook (e.g.,
useTranslation or t) in DietTabExample and change the <h2> text to use
t('diet.recommendations') (or the agreed key), then add that key/value to all
four locale files so translations are available for each locale.

In `@src/pages/lifeStyle/dietTab/mealRecommendation/MealRecommendation.tsx`:
- Line 38: The hardcoded Hebrew button label "צפה במתכון המלא" in
MealRecommendation.tsx should be replaced with the i18n call: import and use the
translation hook (e.g., useTranslation/t) in the MealRecommendation component
and replace the literal string with t('meal.viewFullRecipe') (or your agreed
key). Also add the corresponding key "meal.viewFullRecipe" with the Hebrew value
to the project's translation JSONs so the text renders correctly in all locales.

---

Nitpick comments:
In `@src/pages/lifeStyle/dietTab/DietTabExample.tsx`:
- Line 27: The inline alert in DietTabExample (the onViewRecipe={() =>
alert(`צפייה ב: ${meal.name}`)}) is a placeholder—replace it with a production
UI flow by wiring onViewRecipe to either open your recipe detail modal/component
or navigate to a recipe detail route; for example, call a local handler (e.g.,
handleViewRecipe) that uses setState/showRecipeModal with the selected meal
(meal.id or meal) or calls your router (e.g., navigateToRecipeDetail(meal.id))
and remove the alert call. Ensure the new handler uses existing UI primitives
(RecipeModal, Toast, or your navigation function) and passes the meal data so
the detail view can render.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9f886133-8720-47bd-8c6a-e8f5027720f4

📥 Commits

Reviewing files that changed from the base of the PR and between 9134d7d and c3b4bbc.

📒 Files selected for processing (8)
  • src/components/UI/Divider/SGLDivider.tsx
  • src/components/UI/Divider/index.ts
  • src/components/UI/Divider/styles.ts
  • src/pages/home/home.tsx
  • src/pages/lifeStyle/dietTab/DietTabExample.tsx
  • src/pages/lifeStyle/dietTab/mealRecommendation/MealRecommendation.tsx
  • src/pages/lifeStyle/dietTab/mealRecommendation/index.ts
  • src/pages/lifeStyle/dietTab/mealRecommendation/styles.ts
✅ Files skipped from review due to trivial changes (3)
  • src/pages/home/home.tsx
  • src/components/UI/Divider/index.ts
  • src/pages/lifeStyle/dietTab/mealRecommendation/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/UI/Divider/SGLDivider.tsx

Comment thread src/pages/lifeStyle/dietTab/DietTabExample.tsx Outdated
fullWidth
variant="contained"
>
צפה במתכון המלא
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Hardcoded text instead of i18n.

The button text "צפה במתכון המלא" is hardcoded. Since the PR adds i18n keys, consider using the i18n system for this text as well.

🤖 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 `@src/pages/lifeStyle/dietTab/mealRecommendation/MealRecommendation.tsx` at
line 38, The hardcoded Hebrew button label "צפה במתכון המלא" in
MealRecommendation.tsx should be replaced with the i18n call: import and use the
translation hook (e.g., useTranslation/t) in the MealRecommendation component
and replace the literal string with t('meal.viewFullRecipe') (or your agreed
key). Also add the corresponding key "meal.viewFullRecipe" with the Hebrew value
to the project's translation JSONs so the text renders correctly in all locales.

Comment thread src/components/UI/Divider/styles.ts Outdated
import type { Theme } from '@mui/material'
import type { CSSProperties } from 'react'

export enum DividerOrientation {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be in types.ts file not styles

@@ -0,0 +1,32 @@
import { SGLMealRecommendation } from './mealRecommendation'

export const DietTabExample = () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can put this into a screen shot in this pr, also examples for components should be placed inside a story

@Tamir198
Copy link
Copy Markdown
Member

And fix your conflict

@tg14102005-a11y tg14102005-a11y requested a review from Tamir198 May 12, 2026 01:21
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
package.json (1)

60-71: ⚡ Quick win

Inconsistent version pinning strategy.

Lines 70-71 pin @vitest/browser-playwright and @vitest/coverage-v8 to exact versions (without ^), while all other dependencies use caret ranges. This inconsistency can lead to confusion and maintenance issues.

♻️ Align version pinning for consistency
-    "@vitest/browser-playwright": "4.1.4",
-    "@vitest/coverage-v8": "4.1.4"
+    "@vitest/browser-playwright": "^4.1.4",
+    "@vitest/coverage-v8": "^4.1.4"
🤖 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 `@package.json` around lines 60 - 71, The package.json uses caret ranges for
most dev deps but pins `@vitest/browser-playwright` and `@vitest/coverage-v8` to
exact "4.1.4"; update those two entries to use the same caret strategy (change
"@vitest/browser-playwright": "4.1.4" and "@vitest/coverage-v8": "4.1.4" to
"@vitest/browser-playwright": "^4.1.4" and "@vitest/coverage-v8": "^4.1.4") so
they match the other dependencies, then reinstall/refresh the lockfile to
persist the change.
src/stories/Header.tsx (1)

4-6: ⚡ Quick win

User type is duplicated.

The User type defined here (lines 4-6) is duplicated in src/stories/Page.tsx (lines 6-8). Consider extracting to a shared types file if these components will be maintained.

♻️ Extract shared type

Create src/stories/types.ts:

export type User = {
  name: string;
};

Then import in both files:

+import type { User } from './types';
-type User = {
-  name: string;
-};
🤖 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 `@src/stories/Header.tsx` around lines 4 - 6, The User type is duplicated
between the Header and Page components; extract a single exported type User into
a new shared module (e.g., types file) and remove the local type declarations in
both Header and Page, then import { User } into each component and update any
references to use the shared type; ensure the exported symbol name is exactly
User so existing props/type annotations (e.g., in Header and Page) continue to
work without changes.
🤖 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 `@src/stories/Configure.mdx`:
- Around line 50-54: Several external anchor elements (e.g., the <a
className="sb-action-link" href="..." target="_blank"> instances that render the
"Learn more" links and others using the RightArrow component) are missing the
rel="noopener noreferrer" attribute; update each anchor with target="_blank" in
Configure.mdx (all occurrences referenced in the review) to include
rel="noopener noreferrer" to prevent window.opener/tabnabbing vulnerabilities,
ensuring every external <a className="sb-action-link" ... target="_blank">
element across the listed blocks is updated.
- Around line 18-32: The inline style object in the RightArrow component
contains an invalid key ('path fill') causing a JS syntax error; remove the
"'path fill': 'currentColor'" entry from the style object in the RightArrow JSX
so only valid CSS properties remain (retain fill: 'currentColor' to apply to the
SVG and children).
- Line 1: Update the deprecated import of Meta in Configure.mdx: replace the
current import statement that imports Meta from "@storybook/addon-docs/blocks"
with an import from the newer "@storybook/blocks" module so the Meta symbol is
sourced from the Storybook 10.3.6 supported path.

---

Nitpick comments:
In `@package.json`:
- Around line 60-71: The package.json uses caret ranges for most dev deps but
pins `@vitest/browser-playwright` and `@vitest/coverage-v8` to exact "4.1.4"; update
those two entries to use the same caret strategy (change
"@vitest/browser-playwright": "4.1.4" and "@vitest/coverage-v8": "4.1.4" to
"@vitest/browser-playwright": "^4.1.4" and "@vitest/coverage-v8": "^4.1.4") so
they match the other dependencies, then reinstall/refresh the lockfile to
persist the change.

In `@src/stories/Header.tsx`:
- Around line 4-6: The User type is duplicated between the Header and Page
components; extract a single exported type User into a new shared module (e.g.,
types file) and remove the local type declarations in both Header and Page, then
import { User } into each component and update any references to use the shared
type; ensure the exported symbol name is exactly User so existing props/type
annotations (e.g., in Header and Page) continue to work without changes.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b0069bd-7a0a-4509-9e37-5d4b1da99fcc

📥 Commits

Reviewing files that changed from the base of the PR and between c3b4bbc and 148a47a.

⛔ Files ignored due to path filters (16)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/stories/assets/accessibility.png is excluded by !**/*.png
  • src/stories/assets/accessibility.svg is excluded by !**/*.svg
  • src/stories/assets/addon-library.png is excluded by !**/*.png
  • src/stories/assets/assets.png is excluded by !**/*.png
  • src/stories/assets/context.png is excluded by !**/*.png
  • src/stories/assets/discord.svg is excluded by !**/*.svg
  • src/stories/assets/docs.png is excluded by !**/*.png
  • src/stories/assets/figma-plugin.png is excluded by !**/*.png
  • src/stories/assets/github.svg is excluded by !**/*.svg
  • src/stories/assets/share.png is excluded by !**/*.png
  • src/stories/assets/styling.png is excluded by !**/*.png
  • src/stories/assets/testing.png is excluded by !**/*.png
  • src/stories/assets/theming.png is excluded by !**/*.png
  • src/stories/assets/tutorials.svg is excluded by !**/*.svg
  • src/stories/assets/youtube.svg is excluded by !**/*.svg
📒 Files selected for processing (21)
  • .gitignore
  • .storybook/main.ts
  • eslint.config.js
  • package.json
  • src/components/UI/Divider/SGLDivider.tsx
  • src/components/UI/Divider/index.ts
  • src/components/UI/Divider/styles.ts
  • src/components/UI/Divider/types.ts
  • src/stories/Button.stories.ts
  • src/stories/Button.tsx
  • src/stories/Configure.mdx
  • src/stories/Header.stories.ts
  • src/stories/Header.tsx
  • src/stories/Page.stories.ts
  • src/stories/Page.tsx
  • src/stories/assets/avif-test-image.avif
  • src/stories/button.css
  • src/stories/header.css
  • src/stories/page.css
  • vite.config.ts
  • vitest.shims.d.ts
✅ Files skipped from review due to trivial changes (9)
  • vitest.shims.d.ts
  • .storybook/main.ts
  • .gitignore
  • src/stories/button.css
  • src/stories/header.css
  • src/stories/page.css
  • src/components/UI/Divider/index.ts
  • src/components/UI/Divider/types.ts
  • src/stories/Button.tsx

Comment thread src/stories/Configure.mdx
@@ -0,0 +1,388 @@
import { Meta } from "@storybook/addon-docs/blocks";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the correct import path for Meta component in Storybook 10.3.6?

💡 Result:

The correct import path for Storybook 10.3.6’s Doc Block “Meta” is: import { Meta } from '@storybook/blocks'; This is the supported path for the MDX doc blocks (Storybook 10 deprecated/changed other imports). In Storybook 10, importing doc blocks from '@storybook/addon-docs/blocks' is deprecated, and docs say to use '@storybook/blocks' instead [1].

Citations:


Update deprecated import path for Storybook 10.3.6.

In Storybook 10.3.6, import Meta from @storybook/blocks instead of the deprecated @storybook/addon-docs/blocks:

Recommended change
- import { Meta } from "@storybook/addon-docs/blocks";
+ import { Meta } from "@storybook/blocks";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Meta } from "@storybook/addon-docs/blocks";
import { Meta } from "@storybook/blocks";
🤖 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 `@src/stories/Configure.mdx` at line 1, Update the deprecated import of Meta in
Configure.mdx: replace the current import statement that imports Meta from
"@storybook/addon-docs/blocks" with an import from the newer "@storybook/blocks"
module so the Meta symbol is sourced from the Storybook 10.3.6 supported path.

Comment thread src/stories/Configure.mdx
Comment on lines +18 to +32
export const RightArrow = () => <svg
viewBox="0 0 14 14"
width="8px"
height="14px"
style={{
marginLeft: '4px',
display: 'inline-block',
shapeRendering: 'inherit',
verticalAlign: 'middle',
fill: 'currentColor',
'path fill': 'currentColor'
}}
>
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
</svg>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix invalid JavaScript syntax in style object.

Line 28 contains invalid syntax: 'path fill': 'currentColor' is not a valid CSS property. Object keys with spaces aren't valid in JavaScript style objects, and 'path fill' isn't a CSS property.

This line should be removed, as the fill: 'currentColor' on line 27 already applies to the SVG and its children.

🐛 Proposed fix
 export const RightArrow = () => <svg 
     viewBox="0 0 14 14" 
     width="8px" 
     height="14px" 
     style={{ 
       marginLeft: '4px',
       display: 'inline-block',
       shapeRendering: 'inherit',
       verticalAlign: 'middle',
-      fill: 'currentColor',
-      'path fill': 'currentColor'
+      fill: 'currentColor'
     }}
 >
   <path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
 </svg>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const RightArrow = () => <svg
viewBox="0 0 14 14"
width="8px"
height="14px"
style={{
marginLeft: '4px',
display: 'inline-block',
shapeRendering: 'inherit',
verticalAlign: 'middle',
fill: 'currentColor',
'path fill': 'currentColor'
}}
>
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
</svg>
export const RightArrow = () => <svg
viewBox="0 0 14 14"
width="8px"
height="14px"
style={{
marginLeft: '4px',
display: 'inline-block',
shapeRendering: 'inherit',
verticalAlign: 'middle',
fill: 'currentColor'
}}
>
<path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
</svg>
🤖 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 `@src/stories/Configure.mdx` around lines 18 - 32, The inline style object in
the RightArrow component contains an invalid key ('path fill') causing a JS
syntax error; remove the "'path fill': 'currentColor'" entry from the style
object in the RightArrow JSX so only valid CSS properties remain (retain fill:
'currentColor' to apply to the SVG and children).

Comment thread src/stories/Configure.mdx
Comment on lines +50 to +54
<a
className="sb-action-link"
href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react&ref=configure"
target="_blank"
>Learn more<RightArrow /></a>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add security attributes to external links.

All anchor tags with target="_blank" are missing rel="noopener noreferrer", which creates a security vulnerability. The opened page can access window.opener and potentially redirect the original page (tabnabbing attack).

🔒 Proposed fix for all external links

Add rel="noopener noreferrer" to each anchor tag. Example for the first occurrence:

       <a
         className="sb-action-link"
         href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react&ref=configure"
         target="_blank"
+        rel="noopener noreferrer"
       >Learn more<RightArrow /></a>

Apply this same pattern to all 14 external links in this file (lines 50-54, 63-67, 76-80, 99-103, 109-113, 120-124, 131-135, 141-145, 151-155, 164-168, 180-184, 191-195, 203-207, 214-218).

Also applies to: 63-67, 76-80, 99-103, 109-113, 120-124, 131-135, 141-145, 151-155, 164-168, 180-184, 191-195, 203-207, 214-218

🤖 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 `@src/stories/Configure.mdx` around lines 50 - 54, Several external anchor
elements (e.g., the <a className="sb-action-link" href="..." target="_blank">
instances that render the "Learn more" links and others using the RightArrow
component) are missing the rel="noopener noreferrer" attribute; update each
anchor with target="_blank" in Configure.mdx (all occurrences referenced in the
review) to include rel="noopener noreferrer" to prevent window.opener/tabnabbing
vulnerabilities, ensuring every external <a className="sb-action-link" ...
target="_blank"> element across the listed blocks is updated.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants