Skip to content

feat: RecomendationTraining component#86

Merged
Tamir198 merged 3 commits into
mainfrom
LifeStyle/Recomend
Jun 4, 2026
Merged

feat: RecomendationTraining component#86
Tamir198 merged 3 commits into
mainfrom
LifeStyle/Recomend

Conversation

@rachelishteren

@rachelishteren rachelishteren commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Description

  • feat: RecomendationTraining component - pages/lifeStyle/physioAndTrainingTab/recomendationTraining

  • Mobile and desktop version support - with a design that is compatible with everyone

image image

Summary by CodeRabbit

  • New Features

    • Added a "Today Recommendations" area with responsive mobile and desktop layouts, showing two recommended videos (morning stretching — 10 min, balance training — 15 min) and a balance exercises section.
  • Localization

    • Added/updated Arabic, English, Hebrew, and Russian translations for the new lifestyle and training content.
  • Style

    • Updated video card appearance to a lighter/white variant.

@rachelishteren

Copy link
Copy Markdown
Collaborator Author

@Tamir198 This is only part of LifStyle page...
Later I will also fix the general style of the entire page.

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c65fbacf-cb15-4207-8c56-82016e8fbe83

📥 Commits

Reviewing files that changed from the base of the PR and between f37d483 and a12126b.

📒 Files selected for processing (11)
  • src/components/UI/Video/SGLVideoCard.tsx
  • src/constants/index.ts
  • src/locales/ar/translation.json
  • src/locales/en/translation.json
  • src/locales/he/translation.json
  • src/locales/ru/translation.json
  • src/pages/lifeStyle/LifeStyle.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingDesktop.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingMobile.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/style.ts
✅ Files skipped from review due to trivial changes (3)
  • src/locales/he/translation.json
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/style.ts
  • src/locales/ru/translation.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/pages/lifeStyle/LifeStyle.tsx
  • src/constants/index.ts
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx
  • src/components/UI/Video/SGLVideoCard.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingMobile.tsx

📝 Walkthrough

Walkthrough

Adds a responsive RecomendationTraining feature (mobile + desktop), new layout styles, two video-duration constants, localized lifeStyle.* keys in four languages, LifeStyle page integration, and a small SGLVideoCard variant change.

Changes

Lifestyle Recommendations and Responsive Layout

Layer / File(s) Summary
Multi-language Translations
src/locales/ar/translation.json, src/locales/en/translation.json, src/locales/he/translation.json, src/locales/ru/translation.json
Added lifeStyle.* translation keys for today recommendations, balance exercises, morning stretching, and balance training.
Video duration constants
src/constants/index.ts
Added BALANCE_VIDEO_TIME = 15 and STRETCH_VIDEO_TIME = 10 exports used by recommendation cards.
Layout style definitions
src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/style.ts
Exports five CSSProperties objects for mobile/desktop layout and spacing.
Desktop component
src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingDesktop.tsx
New desktop component renders localized headings, two SGLVideoCard entries with durations from constants, and the BalanceTraining section using desktop styles.
Mobile component
src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingMobile.tsx
New mobile component renders localized headings, two SGLVideoCard entries with durations from constants, and the BalanceTraining section using mobile styles.
Responsive wrapper
src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx
Now conditionally renders mobile or desktop recommendation components via useIsMobile().
LifeStyle page refactor
src/pages/lifeStyle/LifeStyle.tsx
Simplified to return RecomendationTraining only (removed direct BalanceTraining render and useTranslation usage).
Video Card Styling
src/components/UI/Video/SGLVideoCard.tsx
Changed SGLCard variant prop from outlined to white.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • Tamir198
  • GilHeller

Poem

🐰 A hop toward wellness, cards turned bright,

Desktop spreads and mobiles snug and light,
Translations stitched in every tongue,
Timed stretches counted, songs unsung,
A rabbit cheers the changes done.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive Description identifies the component being added and includes design screenshots, but lacks required checklist items and doesn't follow the template structure. Complete the provided checklist items (self-review and warnings check) and reference any related issue(s) to ensure proper tracking and documentation.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly identifies the main change: a new RecomendationTraining component being added to the codebase.
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 LifeStyle/Recomend

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/style.ts (1)

3-27: ⚡ Quick win

Prefer type annotation over as CSSProperties cast.

Casting with as silences the type checker, so a misspelled property name or invalid value would slip through. Annotating the variable type validates the object literal while still allowing literal narrowing for flexDirection.

♻️ Proposed change (apply to all four objects)
-export const rootStyle_mobile = {
+export const rootStyle_mobile: CSSProperties = {
   display: 'flex',
   flexDirection: 'column',
   gap: '1rem',
   padding: '1rem',
   paddingBottom: '1rem',
-} as CSSProperties
+}
🤖 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/physioAndTrainingTab/recomendationTraining/style.ts`
around lines 3 - 27, Replace the "as CSSProperties" casts with explicit type
annotations on each exported style object so the object literals are
type-checked; specifically change the declarations for rootStyle_mobile,
rootStyle_desktop, videoConteiner_desktop, and header_desktop to use ":
CSSProperties" after the variable name and retain the same object bodies,
applying this pattern to all four exports to catch misspelled or invalid CSS
properties at compile time.
🤖 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/physioAndTrainingTab/recomendationTraining/style.ts`:
- Around line 24-27: The header_desktop style uses mixed units for vertical
padding (paddingTop: '0.5em' vs paddingBottom: '0.5rem'); make them consistent
by updating one to match the other (e.g., change paddingTop to '0.5rem' or
paddingBottom to '0.5em') so vertical spacing is predictable; locate the
header_desktop export in the style.ts and normalize both paddingTop and
paddingBottom to the same unit.

---

Nitpick comments:
In `@src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/style.ts`:
- Around line 3-27: Replace the "as CSSProperties" casts with explicit type
annotations on each exported style object so the object literals are
type-checked; specifically change the declarations for rootStyle_mobile,
rootStyle_desktop, videoConteiner_desktop, and header_desktop to use ":
CSSProperties" after the variable name and retain the same object bodies,
applying this pattern to all four exports to catch misspelled or invalid CSS
properties at compile time.
🪄 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: 7e0e1f4b-3c67-4a2e-aae3-ee69f5690677

📥 Commits

Reviewing files that changed from the base of the PR and between c6cc371 and c9a9f3a.

📒 Files selected for processing (8)
  • src/components/UI/Video/SGLVideoCard.tsx
  • src/locales/ar/translation.json
  • src/locales/en/translation.json
  • src/locales/he/translation.json
  • src/locales/ru/translation.json
  • src/pages/lifeStyle/LifeStyle.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/style.ts

Comment on lines +24 to +27
export const header_desktop = {
paddingTop: '0.5em',
paddingBottom: '0.5rem',
} as CSSProperties

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

Inconsistent unit: 0.5em vs 0.5rem.

paddingTop uses em while paddingBottom uses rem, which yields asymmetric vertical padding whenever the element's font-size differs from the root. Likely unintended.

🔧 Proposed fix
 export const header_desktop = {
-  paddingTop: '0.5em',
+  paddingTop: '0.5rem',
   paddingBottom: '0.5rem',
 } as CSSProperties
📝 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 header_desktop = {
paddingTop: '0.5em',
paddingBottom: '0.5rem',
} as CSSProperties
export const header_desktop = {
paddingTop: '0.5rem',
paddingBottom: '0.5rem',
} as CSSProperties
🤖 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/physioAndTrainingTab/recomendationTraining/style.ts`
around lines 24 - 27, The header_desktop style uses mixed units for vertical
padding (paddingTop: '0.5em' vs paddingBottom: '0.5rem'); make them consistent
by updating one to match the other (e.g., change paddingTop to '0.5rem' or
paddingBottom to '0.5em') so vertical spacing is predictable; locate the
header_desktop export in the style.ts and normalize both paddingTop and
paddingBottom to the same unit.

return (
<>
{isMobile ? (
<div style={rootStyle_mobile}>

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 should extract the mobile and desktop into a separate component

<SGLVideoCard
title={t('lifeStyle.balanceTrainingTitle')}
description={t('lifeStyle.balanceTrainingDescription')}
durationInMinutes={15}

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 magic numbers, save this into constant value

<SGLVideoCard
title={t('lifeStyle.morningStretchingTitle')}
description={t('lifeStyle.morningStretchingDescription')}
durationInMinutes={10}

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 magic numbers, save this into constant value

@rachelishteren rachelishteren requested a review from Tamir198 June 1, 2026 14:14
@rachelishteren

Copy link
Copy Markdown
Collaborator Author

@Tamir198

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingMobile.tsx (1)

12-32: ⚡ Quick win

Remove unnecessary Fragment wrapper.

The Fragment <></> wraps a single div element. Since there's only one root element, the Fragment is unnecessary.

♻️ Proposed simplification
 export const RecomendationTrainingMobile = () => {
   const { t } = useTranslation()
 
   return (
-    <>
-      <div style={rootStyle_mobile}>
+    <div style={rootStyle_mobile}>
         <SGLTypography variant="mediumTitle" color="black">
           {t('lifeStyle.todayRecommendations')}
         </SGLTypography>
         <SGLVideoCard
           title={t('lifeStyle.morningStretchingTitle')}
           description={t('lifeStyle.morningStretchingDescription')}
           durationInMinutes={STRETCH_VIDEO_TIME}
         />
         <SGLVideoCard
           title={t('lifeStyle.balanceTrainingTitle')}
           description={t('lifeStyle.balanceTrainingDescription')}
           durationInMinutes={BALANCE_VIDEO_TIME}
         />
         <SGLTypography variant="mediumTitle" color="black">
           {t('lifeStyle.balanceExercises')}
         </SGLTypography>
         <BalanceTraining />
-      </div>
-    </>
+    </div>
   )
 }
🤖 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/physioAndTrainingTab/recomendationTraining/RecomendationTrainingMobile.tsx`
around lines 12 - 32, Remove the unnecessary Fragment wrapper around the single
root div in RecomendationTrainingMobile.tsx: delete the opening <> and closing
</> that envelop the div styled by rootStyle_mobile so the component returns the
div directly; verify components referenced (SGLTypography, SGLVideoCard,
BalanceTraining) and props (STRETCH_VIDEO_TIME, BALANCE_VIDEO_TIME) remain
unchanged and tests/exports still pass.
src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx (1)

7-7: ⚡ Quick win

Remove unnecessary Fragment wrapper.

The Fragment <></> wraps a single ternary expression. You can return the ternary directly.

♻️ Proposed simplification
 export const RecomendationTraining = () => {
   const isMobile = useIsMobile()
 
-  return <>{isMobile ? <RecomendationTrainingMobile /> : <RecomendationTrainingDesktop />}</>
+  return isMobile ? <RecomendationTrainingMobile /> : <RecomendationTrainingDesktop />
 }
🤖 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/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx`
at line 7, The return value in the RecomendationTraining component currently
wraps a single ternary in a Fragment; remove the unnecessary Fragment and return
the ternary expression directly (replace "return <>{isMobile ?
<RecomendationTrainingMobile /> : <RecomendationTrainingDesktop />}</>" with a
direct return of the ternary). Update the RecomendationTraining function so it
returns isMobile ? <RecomendationTrainingMobile /> :
<RecomendationTrainingDesktop /> and keep the existing isMobile,
RecomendationTrainingMobile and RecomendationTrainingDesktop identifiers
unchanged.
🤖 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/physioAndTrainingTab/recomendationTraining/style.ts`:
- Line 19: Rename the exported constant conteiner_desktop to container_desktop
in style.ts and update all references/imports; specifically change the export
name export const conteiner_desktop -> container_desktop, then update the import
in RecomendationTrainingDesktop.tsx to import container_desktop and replace any
usages of conteiner_desktop in that component (e.g., at the previously noted
lines around the root usage and the other occurrence) to the new symbol
container_desktop so names stay consistent.

---

Nitpick comments:
In
`@src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx`:
- Line 7: The return value in the RecomendationTraining component currently
wraps a single ternary in a Fragment; remove the unnecessary Fragment and return
the ternary expression directly (replace "return <>{isMobile ?
<RecomendationTrainingMobile /> : <RecomendationTrainingDesktop />}</>" with a
direct return of the ternary). Update the RecomendationTraining function so it
returns isMobile ? <RecomendationTrainingMobile /> :
<RecomendationTrainingDesktop /> and keep the existing isMobile,
RecomendationTrainingMobile and RecomendationTrainingDesktop identifiers
unchanged.

In
`@src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingMobile.tsx`:
- Around line 12-32: Remove the unnecessary Fragment wrapper around the single
root div in RecomendationTrainingMobile.tsx: delete the opening <> and closing
</> that envelop the div styled by rootStyle_mobile so the component returns the
div directly; verify components referenced (SGLTypography, SGLVideoCard,
BalanceTraining) and props (STRETCH_VIDEO_TIME, BALANCE_VIDEO_TIME) remain
unchanged and tests/exports still pass.
🪄 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: 4d090d11-28af-4dd1-bc2d-4c30862d752a

📥 Commits

Reviewing files that changed from the base of the PR and between c9a9f3a and b0867f2.

📒 Files selected for processing (6)
  • src/constants/index.ts
  • src/pages/lifeStyle/LifeStyle.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTraining.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingDesktop.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/RecomendationTrainingMobile.tsx
  • src/pages/lifeStyle/physioAndTrainingTab/recomendationTraining/style.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pages/lifeStyle/LifeStyle.tsx

paddingBottom: '1rem',
} as CSSProperties

export const conteiner_desktop = {

@coderabbitai coderabbitai Bot Jun 1, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Fix typo: conteiner_desktop should be container_desktop.

The export name contains a spelling error. Correct it to container_desktop for consistency with standard English spelling and better code maintainability.

📝 Proposed fix
-export const conteiner_desktop = {
+export const container_desktop = {
   display: 'flex',
   flexDirection: 'column',
   flex: 1,
   gap: '1rem',
   paddingTop: '1rem',
 } as CSSProperties

Note: You'll also need to update the import in RecomendationTrainingDesktop.tsx:

import {
  rootStyle_desktop,
  container_desktop,  // updated
  header_desktop,
  videoContainer_desktop,
} from './style'

And update both usages in the component (lines 18 and 37).

🤖 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/physioAndTrainingTab/recomendationTraining/style.ts` at
line 19, Rename the exported constant conteiner_desktop to container_desktop in
style.ts and update all references/imports; specifically change the export name
export const conteiner_desktop -> container_desktop, then update the import in
RecomendationTrainingDesktop.tsx to import container_desktop and replace any
usages of conteiner_desktop in that component (e.g., at the previously noted
lines around the root usage and the other occurrence) to the new symbol
container_desktop so names stay consistent.

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.

@rachelishteren I agree with this comment also we write our classs names likeThis and not like_this

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@Tamir198 Tamir198 left a comment

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.

Left comments, also you have conflicts

export const RecomendationTraining = () => {
const isMobile = useIsMobile()

return <>{isMobile ? <RecomendationTrainingMobile /> : <RecomendationTrainingDesktop />}</>

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 about return isMobile ? <RecomendationTrainingMobile /> : <RecomendationTrainingDesktop />

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I dont understand the comment :)

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.

I suggested alternative instead of wrapping everything in fragment and {}

paddingBottom: '1rem',
} as CSSProperties

export const conteiner_desktop = {

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.

@rachelishteren I agree with this comment also we write our classs names likeThis and not like_this

@rachelishteren rachelishteren requested a review from Tamir198 June 2, 2026 09:48
@rachelishteren

Copy link
Copy Markdown
Collaborator Author

@Tamir198

Tamir198
Tamir198 previously approved these changes Jun 3, 2026

@Tamir198 Tamir198 left a comment

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.

Approved, fix your conflicts

@rachelishteren

Copy link
Copy Markdown
Collaborator Author

@Tamir198 Ready to merge.

@Tamir198 Tamir198 merged commit 29a7800 into main Jun 4, 2026
2 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 7, 2026
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.

2 participants