Skip to content

Tweak colors on the frontend#1022

Merged
SzBeni2003 merged 1 commit intostagingfrom
feature/fix-dropdown-navbar
Mar 29, 2026
Merged

Tweak colors on the frontend#1022
SzBeni2003 merged 1 commit intostagingfrom
feature/fix-dropdown-navbar

Conversation

@Isti01
Copy link
Copy Markdown
Collaborator

@Isti01 Isti01 commented Mar 29, 2026

Summary by CodeRabbit

  • Style

    • Updated color scheme across UI components, replacing accent colors with primary colors for visual consistency.
    • Refactored design system theme tokens: added app-background, removed accent color definitions.
    • Enhanced navigation, button, and dialog component hover and focus states.
    • Adjusted input field styling to use updated color tokens.
  • Refactor

    • Restructured mobile navigation menu layout and trigger behavior.
    • Improved navigation menu viewport rendering and positioning.

@Isti01 Isti01 requested a review from SzBeni2003 March 29, 2026 10:00
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

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

Project Deployment Actions Updated (UTC)
cmsch-cst Ready Ready Preview, Comment Mar 29, 2026 10:14am
cmsch-golyakorte Ready Ready Preview, Comment Mar 29, 2026 10:14am
cmsch-skktv Ready Ready Preview, Comment Mar 29, 2026 10:14am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

📝 Walkthrough

Walkthrough

The pull request updates the UI component library's color scheme by replacing accent color tokens with primary color tokens across hover and focus states. Additionally, theme tokens are restructured (adding app-background, removing accent colors), navigation components receive enhanced styling capabilities, and several minor styling adjustments refine background and layout properties.

Changes

Cohort / File(s) Summary
Color Token Migration: Accent → Primary
ColorModeSwitcher.tsx, Navbar.tsx, ChildNavItem.tsx, button.tsx, dialog.tsx, dropdown-menu.tsx, select.tsx, navigation-menu.tsx, NewsListItem.tsx
Systematically replace hover:bg-accent, focus:bg-accent, and related accent foreground classes with hover:bg-primary, focus:bg-primary, and primary-foreground equivalents across button, dropdown, select, and navigation components.
Background and Input Styling
AppBackground.tsx, input.tsx
Update background classes: AppBackground shifts from bg-background to bg-app-background; Input component changes from bg-background/ring-offset-background to bg-card/ring-offset-card.
Navigation Component Enhancements
desktop/NavItemWithChildren.tsx, mobile/NavItemWithChildren.tsx
Desktop variant now reads styling from useConfigContext() and applies computed backdrop, background, and color styles via inline style prop; width constraint changes from fixed to min-w-48. Mobile variant removes LinkComponent-based trigger, replaces with plain div, and adjusts child link layout from left-aligned to center-aligned.
Theme Token and CSS Restructuring
index.css
Add new --color-app-background token; remove --color-accent and --color-accent-foreground tokens. Update light/dark theme variables to use --*-container-bg fallbacks for --background and --popover. Refactor --muted-foreground to consistently reference --*-neutral-foreground. Adjust container utility: move max-width: none; outside breakpoint media block.
Minor UI Updates
LoadingView.tsx, loading.page.tsx
LoadingView button receives className="min-w-32" and renders "Újra" as explicit child; LoadingPage removes w-fit class from CmschPage.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 The accent hops away, the primary takes the stage,
With buttons bright and colors rearranged on every page.
The theme tokens dance in harmony, old colors fade to night,
While navigation finds new polish in the -foreground light! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Tweak colors on the frontend' directly and accurately summarizes the main objective of the changeset, which involves widespread color-related styling updates across multiple frontend components and theme configuration files.

✏️ 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 feature/fix-dropdown-navbar

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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/components/ui/navigation-menu.tsx (1)

8-19: ⚠️ Potential issue | 🔴 Critical

Add NavigationMenuViewport to the navigation hierarchy.

DesktopNav.tsx renders NavigationMenu > NavigationMenuList > NavItemWithChildren, but NavigationMenuViewport is missing. In Radix UI's Navigation Menu, NavigationMenuContent is portaled into NavigationMenuViewport for proper positioning, stacking, and animations. Without it, dropdown menus will not render correctly.

Add NavigationMenuViewport inside NavigationMenu after NavigationMenuList:

<NavigationMenu>
  <NavigationMenuList>
    {/* items */}
  </NavigationMenuList>
  <NavigationMenuViewport />
</NavigationMenu>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/ui/navigation-menu.tsx` around lines 8 - 19, The
NavigationMenu wrapper currently renders only children, so the Radix viewport
that hosts portaled NavigationMenuContent is missing; update the NavigationMenu
component (the forwardRef over NavigationMenuPrimitive.Root) to render a
NavigationMenuViewport element immediately after the NavigationMenuList/children
(i.e., after {children}) so portaled NavigationMenuContent items (from
NavItemWithChildren/NavigationMenuContent used in DesktopNav.tsx) have the
correct stacking and positioning; import/use the corresponding
NavigationMenuViewport (from NavigationMenuPrimitive or your local
NavigationMenuViewport wrapper) and place it inside the Root so dropdowns render
and animate correctly.
🧹 Nitpick comments (1)
frontend/src/components/ui/dialog.tsx (1)

53-53: Consider matching open-state text token to primary background.

data-[state=open]:bg-primary with data-[state=open]:text-muted-foreground may reduce contrast and is inconsistent with other primary interactions using text-primary-foreground.

Suggested class adjustment
- data-[state=open]:bg-primary data-[state=open]:text-muted-foreground
+ data-[state=open]:bg-primary data-[state=open]:text-primary-foreground
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/ui/dialog.tsx` at line 53, The open-state styling
uses data-[state=open]:bg-primary but keeps text as
data-[state=open]:text-muted-foreground which reduces contrast and deviates from
other primary interactions; update the dialog component's class string (where
the class contains data-[state=open]:bg-primary in
frontend/src/components/ui/dialog.tsx) to use
data-[state=open]:text-primary-foreground instead of
data-[state=open]:text-muted-foreground so the open state matches other primary
styles and maintains accessible contrast.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/common-components/navigation/ColorModeSwitcher.tsx`:
- Line 17: The Tailwind class in ColorModeSwitcher.tsx contains a typo: replace
"primary-foregound" with the correct token "primary-foreground" inside the
className string (the className on the ColorModeSwitcher component) so the
hover:bg utility targets the existing CSS variable and the hover background
works as intended.

In `@frontend/src/common-components/navigation/mobile/NavItemWithChildren.tsx`:
- Line 26: The JSX key on the Link in NavItemWithChildren currently uses
key={child.url}, which can produce duplicate/empty keys; update the key to use a
stable unique identifier such as child.name or a composite like
`${child.name}-${child.url}` (update the Link element inside the
NavItemWithChildren component where key={child.url} is set) so each mapped child
has a deterministic unique key and avoid React key collisions.

In `@frontend/src/common-components/navigation/Navbar.tsx`:
- Around line 57-59: The SheetTitle is currently a sibling of SheetContent which
breaks Radix UI's aria-labelledby expectations; inside Navbar.tsx move the
<SheetTitle> element to be a child/descendant of <SheetContent> (so it is
included in the dialog's content subtree) and replace the visual-hiding classes
("invisible absolute") with the Tailwind screen-reader utility ("sr-only") so
the title remains accessible but not visible; ensure you keep the same text
("Menü") and leave Sheet's props (open={isOpen}, onOpenChange={setIsOpen},
modal) unchanged.

---

Outside diff comments:
In `@frontend/src/components/ui/navigation-menu.tsx`:
- Around line 8-19: The NavigationMenu wrapper currently renders only children,
so the Radix viewport that hosts portaled NavigationMenuContent is missing;
update the NavigationMenu component (the forwardRef over
NavigationMenuPrimitive.Root) to render a NavigationMenuViewport element
immediately after the NavigationMenuList/children (i.e., after {children}) so
portaled NavigationMenuContent items (from
NavItemWithChildren/NavigationMenuContent used in DesktopNav.tsx) have the
correct stacking and positioning; import/use the corresponding
NavigationMenuViewport (from NavigationMenuPrimitive or your local
NavigationMenuViewport wrapper) and place it inside the Root so dropdowns render
and animate correctly.

---

Nitpick comments:
In `@frontend/src/components/ui/dialog.tsx`:
- Line 53: The open-state styling uses data-[state=open]:bg-primary but keeps
text as data-[state=open]:text-muted-foreground which reduces contrast and
deviates from other primary interactions; update the dialog component's class
string (where the class contains data-[state=open]:bg-primary in
frontend/src/components/ui/dialog.tsx) to use
data-[state=open]:text-primary-foreground instead of
data-[state=open]:text-muted-foreground so the open state matches other primary
styles and maintains accessible contrast.
🪄 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: 9dd7df80-3742-4cc3-8ddb-40ae63d25d89

📥 Commits

Reviewing files that changed from the base of the PR and between 7f149a5 and 3595d3d.

📒 Files selected for processing (16)
  • frontend/src/common-components/layout/AppBackground.tsx
  • frontend/src/common-components/navigation/ColorModeSwitcher.tsx
  • frontend/src/common-components/navigation/Navbar.tsx
  • frontend/src/common-components/navigation/desktop/ChildNavItem.tsx
  • frontend/src/common-components/navigation/desktop/NavItemWithChildren.tsx
  • frontend/src/common-components/navigation/mobile/NavItemWithChildren.tsx
  • frontend/src/components/ui/button.tsx
  • frontend/src/components/ui/dialog.tsx
  • frontend/src/components/ui/dropdown-menu.tsx
  • frontend/src/components/ui/input.tsx
  • frontend/src/components/ui/navigation-menu.tsx
  • frontend/src/components/ui/select.tsx
  • frontend/src/index.css
  • frontend/src/pages/loading/loading.page.tsx
  • frontend/src/pages/news/components/NewsListItem.tsx
  • frontend/src/util/LoadingView.tsx

aria-label="Sötét-világos mód váltás"
onClick={toggleColorMode}
className="p-2 rounded-md hover:bg-accent transition-colors focus-visible:ring-2 focus-visible:ring-ring"
className="p-2 rounded-md hover:bg-primary-foregound transition-colors focus-visible:ring-2 focus-visible:ring-ring"
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

Typo in Tailwind class: primary-foregound should be primary-foreground.

The class hover:bg-primary-foregound is missing the letter 'r', which will cause the hover background style to silently fail since the CSS variable won't exist.

🐛 Proposed fix
-      className="p-2 rounded-md hover:bg-primary-foregound transition-colors focus-visible:ring-2 focus-visible:ring-ring"
+      className="p-2 rounded-md hover:bg-primary-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring"
📝 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
className="p-2 rounded-md hover:bg-primary-foregound transition-colors focus-visible:ring-2 focus-visible:ring-ring"
className="p-2 rounded-md hover:bg-primary-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/common-components/navigation/ColorModeSwitcher.tsx` at line 17,
The Tailwind class in ColorModeSwitcher.tsx contains a typo: replace
"primary-foregound" with the correct token "primary-foreground" inside the
className string (the className on the ColorModeSwitcher component) so the
hover:bg utility targets the existing CSS variable and the hover background
works as intended.

<div className="flex flex-col justify-center">
{children.map((child) => (
<Link key={child.url} to={child.url || '#'} className="w-full" onClick={onNavigate}>
<Link key={child.url} to={child.url || '#'} className="w-full text-center" onClick={onNavigate}>
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

Using child.url as React key may cause issues if URLs are duplicated or empty.

If multiple children have the same URL or an empty URL, React will encounter duplicate keys. Consider using child.name (which appears unique per menu structure) or a combination like ${child.name}-${child.url}.

💡 Suggested fix
-            <Link key={child.url} to={child.url || '#'} className="w-full text-center" onClick={onNavigate}>
+            <Link key={child.name} to={child.url || '#'} className="w-full text-center" onClick={onNavigate}>
📝 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
<Link key={child.url} to={child.url || '#'} className="w-full text-center" onClick={onNavigate}>
<Link key={child.name} to={child.url || '#'} className="w-full text-center" onClick={onNavigate}>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/common-components/navigation/mobile/NavItemWithChildren.tsx` at
line 26, The JSX key on the Link in NavItemWithChildren currently uses
key={child.url}, which can produce duplicate/empty keys; update the key to use a
stable unique identifier such as child.name or a composite like
`${child.name}-${child.url}` (update the Link element inside the
NavItemWithChildren component where key={child.url} is set) so each mapped child
has a deterministic unique key and avoid React key collisions.

Comment on lines 57 to 59
<Sheet open={isOpen} modal={true} onOpenChange={setIsOpen}>
<SheetTitle className="invisible absolute">Menü</SheetTitle>
<SheetContent side="top" className="w-full p-0" style={{ backdropFilter, backgroundColor: background, color: textColor }}>
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

Move SheetTitle inside SheetContent for proper accessibility.

The SheetTitle is currently placed outside SheetContent but should be inside it. Radix UI's Dialog/Sheet uses aria-labelledby to associate the title with the dialog content, which requires the title to be a descendant of the content container.

♿ Proposed fix
       <Sheet open={isOpen} modal={true} onOpenChange={setIsOpen}>
-        <SheetTitle className="invisible absolute">Menü</SheetTitle>
         <SheetContent side="top" className="w-full p-0" style={{ backdropFilter, backgroundColor: background, color: textColor }}>
+          <SheetTitle className="sr-only">Menü</SheetTitle>
           <div className="pt-12">
             <MobileNav onNavigate={() => setIsOpen(false)} />
           </div>
         </SheetContent>
       </Sheet>

Note: Using sr-only (screen-reader only) is the idiomatic Tailwind approach for visually hidden but accessible content, rather than invisible absolute.

📝 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
<Sheet open={isOpen} modal={true} onOpenChange={setIsOpen}>
<SheetTitle className="invisible absolute">Menü</SheetTitle>
<SheetContent side="top" className="w-full p-0" style={{ backdropFilter, backgroundColor: background, color: textColor }}>
<Sheet open={isOpen} modal={true} onOpenChange={setIsOpen}>
<SheetContent side="top" className="w-full p-0" style={{ backdropFilter, backgroundColor: background, color: textColor }}>
<SheetTitle className="sr-only">Menü</SheetTitle>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/common-components/navigation/Navbar.tsx` around lines 57 - 59,
The SheetTitle is currently a sibling of SheetContent which breaks Radix UI's
aria-labelledby expectations; inside Navbar.tsx move the <SheetTitle> element to
be a child/descendant of <SheetContent> (so it is included in the dialog's
content subtree) and replace the visual-hiding classes ("invisible absolute")
with the Tailwind screen-reader utility ("sr-only") so the title remains
accessible but not visible; ensure you keep the same text ("Menü") and leave
Sheet's props (open={isOpen}, onOpenChange={setIsOpen}, modal) unchanged.

Copy link
Copy Markdown
Contributor

@SzBeni2003 SzBeni2003 left a comment

Choose a reason for hiding this comment

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

lgtm

@SzBeni2003 SzBeni2003 merged commit 5e7c814 into staging Mar 29, 2026
13 checks passed
Isti01 added a commit that referenced this pull request Mar 29, 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