Skip to content

feat: enhance ThemeDropdown with keyboard navigation and improved layout#6554

Merged
bijin-bruno merged 2 commits intousebruno:mainfrom
abhishek-bruno:feat/theme-switcher-ui
Dec 30, 2025
Merged

feat: enhance ThemeDropdown with keyboard navigation and improved layout#6554
bijin-bruno merged 2 commits intousebruno:mainfrom
abhishek-bruno:feat/theme-switcher-ui

Conversation

@abhishek-bruno
Copy link
Member

@abhishek-bruno abhishek-bruno commented Dec 30, 2025

Description

  • Added keyboard navigation support for theme selection.
  • Refactored theme selection UI to improve accessibility and user experience.
  • Updated styles for better responsiveness and visual clarity.
  • Consolidated theme rendering logic for light and dark themes.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • New Features

    • Keyboard-navigable theme selector with full arrow, Enter/Space and Tab support, improved focus management, and unified dialog-style layout
    • Mode section (Light/Dark/System) with radio-style mode buttons and two-column theme lists in system mode
  • Style

    • Redesigned theme dropdown layout, spacing, and visual hierarchy with clearer active/focused/hover states
    • Modular theme list/item components, truncation support, improved check-icon alignment, and theme-token driven colors for accessibility

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

Walkthrough

Refactored ThemeDropdown: styling reorganized into modular components and tokens; component logic replaced nested submenus with a single keyboard-navigable dialog, two-column system-mode layout, explicit focus management, and comprehensive keyboard handlers.

Changes

Cohort / File(s) Summary
Styling (ThemeDropdown)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
Reworked styles: larger container, padding, border-radius, token-driven colors/spacing; introduced .theme-menu.two-columns, mode-section, mode-buttons, mode-button, theme-lists, theme-list/theme-item, theme-item-label, and check-icon. Updated hover/focus/active and focused-outline behavior and two-column list layout.
Component (ThemeDropdown logic & rendering)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
Replaced two-submenu/Tippy approach with a single dialog-like flow. Added MODES/MODE_BUTTONS, keyboard navigation state (focusedSection, focusedIndex, isKeyboardNav), refs for mode and theme items, renderModeButtons/renderThemeList, system-mode two-column rendering, focus management effects, and full keyboard handling (Esc, Arrow keys, Enter/Space, Tab). Open/close and tooltip behavior updated.

Sequence Diagram

sequenceDiagram
    participant User
    participant ThemeDropdown
    participant FocusManager
    participant AppState

    rect rgba(135,206,250,0.12)
    User->>ThemeDropdown: click trigger / open
    ThemeDropdown->>AppState: determine isSystemMode, load selections
    ThemeDropdown->>FocusManager: init focus (mode button or first theme)
    FocusManager-->>ThemeDropdown: apply focusedClass
    end

    rect rgba(144,238,144,0.10)
    User->>ThemeDropdown: press Arrow / Tab
    ThemeDropdown->>FocusManager: compute target ref (section/index)
    FocusManager-->>ThemeDropdown: move DOM focus, update focusedIndex
    end

    rect rgba(255,228,181,0.10)
    User->>ThemeDropdown: press Enter/Space
    ThemeDropdown->>AppState: select mode/theme, persist storedTheme
    AppState-->>ThemeDropdown: confirm selection
    ThemeDropdown->>User: close dropdown, re-enable tooltip
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

size/L

Suggested reviewers

  • bijin-bruno
  • naman-bruno
  • lohit-bruno
  • helloanoop

Poem

✨ A dropdown refit, neat and bright,
Keys find the focus, left and right,
Two columns hum with themes in line,
Tokens paint each hover and shine,
Small refactor, keyboard delight. 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: keyboard navigation support and improved layout for the ThemeDropdown component, which directly reflects the refactor from submenus to a keyboard-navigable, single-dialog layout.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

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
Contributor

@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: 0

🧹 Nitpick comments (2)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js (2)

29-31: Refs array initialization works but could benefit from cleanup.

The refs are initialized as useRef([]) and elements are assigned via callback refs. When themes are added/removed, stale refs could linger. Consider clearing the arrays when the dropdown opens or when theme lists change.

🔎 Optional cleanup approach
  const handleOpen = () => {
    setTooltipEnabled(false);
    setIsOpen(true);
    setFocusedSection('mode');
    setFocusedIndex(0);
    setIsKeyboardNav(false);
+   // Reset refs arrays
+   modeButtonRefs.current = [];
+   lightItemRefs.current = [];
+   darkItemRefs.current = [];
  };

266-271: Consider using role="menu" instead of role="dialog" for dropdown semantics.

A dropdown menu with selectable options typically uses role="menu" or role="listbox". The role="dialog" is more appropriate for modal dialogs. This won't break functionality but may affect screen reader announcements.

🔎 Alternative ARIA role
        <div
          ref={menuRef}
          className={`theme-menu ${isSystemMode ? 'two-columns' : ''}`}
-         role="dialog"
+         role="menu"
          aria-label="Theme selector"
        >
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b28d37 and 0ccb10c.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
🧠 Learnings (4)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any React component using the styled component

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js (2)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js (1)
  • StyledWrapper (4-149)
packages/bruno-app/src/providers/Theme/index.js (1)
  • themeVariantLight (18-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: CLI Tests
  • GitHub Check: Unit Tests
  • GitHub Check: Playwright E2E Tests
🔇 Additional comments (9)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js (3)

5-17: LGTM on container styling.

The main container uses theme tokens appropriately. One minor note: the fixed height: 325px could cause overflow issues if theme lists grow. Consider max-height with overflow handling if list size varies significantly.


37-73: Mode button states look solid.

Good use of theme tokens for all color states (hover, focused, active). The .focused outline provides clear keyboard navigation feedback, and the nested &.active.focused combination handles the edge case correctly.


111-137: Well-structured theme item styling with proper state handling.

The use of rgba() from polished for the active background variants (0.08 and 0.15 opacity) is a nice touch for visual hierarchy. The combined :hover, &.focused selector keeps mouse and keyboard interactions visually consistent.

packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js (6)

104-118: Focus effect with setTimeout(0) is a common pattern for post-render focus.

The cleanup via clearTimeout is correct. One edge case: if focusedIndex exceeds the array length (e.g., theme list shrinks), refs[focusedSection]?.current[focusedIndex] returns undefined and .focus() is safely skipped via optional chaining.


127-132: Escape handler correctly prevents default and closes menu.

Solid implementation. The e.preventDefault() ensures no unintended browser behavior.


188-193: Space and Tab handlers - consider preventing default on Tab.

Space correctly delegates to Enter. However, Tab closes the menu without e.preventDefault(), which means focus will also move to the next focusable element. This might be intentional for natural tab-out behavior, but verify this is the desired UX.


201-206: Global keydown listener is appropriate here but verify no conflicts.

Adding the listener to document captures all key events when the menu is open. The cleanup on unmount/close is correct. Ensure no parent components have competing keydown handlers that might interfere.


238-261: Mode buttons render function has good ARIA implementation.

The role="radiogroup" with aria-labelledby="mode-label" and individual role="radio" with aria-checked is correct for this use case. Clean implementation.


287-303: Tippy integration looks correct.

The interactive prop (boolean shorthand) enables interaction with dropdown content. The onClickOutside={handleClose} properly handles dismissal. The click handler on line 299 toggles state appropriately.

- Added keyboard navigation support for theme selection.
- Refactored theme selection UI to improve accessibility and user experience.
- Updated styles for better responsiveness and visual clarity.
- Consolidated theme rendering logic for light and dark themes.
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js (1)

292-292: Make boolean prop explicit.

Per coding guidelines, boolean props should explicitly specify the value for clarity.

🔎 Suggested fix
-        interactive
+        interactive={true}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ccb10c and 99bb62a.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
🧠 Learnings (2)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any React component using the styled component

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js (3)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js (1)
  • StyledWrapper (4-149)
packages/bruno-app/src/providers/Theme/index.js (1)
  • themeVariantLight (18-18)
packages/bruno-app/src/components/ToolHint/index.js (1)
  • ToolHint (5-57)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: CLI Tests
  • GitHub Check: Unit Tests
  • GitHub Check: Playwright E2E Tests
🔇 Additional comments (8)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/index.js (8)

1-15: LGTM! Clean constant extraction.

The new constants MODES and MODE_BUTTONS improve maintainability and make the mode configuration more declarative. The additional React hooks and icon imports are appropriate for the keyboard navigation features.


18-31: Well-structured state management.

The keyboard navigation state and focus management refs are logically organized. The comments help clarify the purpose of each group.


64-75: Clean open/close handlers with proper tooltip management.

The handlers correctly manage tooltip state and keyboard navigation initialization. The 100ms delay in handleClose prevents tooltip flicker.


105-118: Proper focus management with DOM update deferral.

The setTimeout with zero delay ensures the DOM has updated before attempting to focus. Good use of optional chaining for safe ref access.


192-192: Verify Tab key behavior aligns with accessibility expectations.

The Tab key currently closes the dropdown. Standard accessible dropdown behavior typically allows Tab to close the dropdown and move focus to the next element, but you should verify this matches your UX requirements. Some users might expect Tab to cycle through elements within the dropdown instead.


202-206: LGTM! Proper event listener lifecycle management.

Document-level keyboard listener is correctly added when the dropdown opens and cleaned up when it closes or the handler changes.


209-261: Excellent accessibility implementation.

Both render functions correctly implement ARIA roles and attributes. The use of tabIndex={-1} with custom keyboard navigation is the right approach. Ref management via callback refs is properly implemented.


264-285: Clean conditional rendering logic.

The dynamic layout switching between single-column and two-column modes is well-implemented. The conditional rendering correctly displays appropriate theme lists based on the selected mode.

- Removed outline styles for focused states to enhance visual clarity.
- Adjusted background and border colors for active state to improve accessibility and user experience.
Copy link
Contributor

@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 (4)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js (4)

8-8: Verify fixed height is appropriate for all content scenarios.

Line 8 sets a fixed height: 325px. Ensure this accommodates all possible theme lists without overflow or wasted space. Consider whether max-height with overflow-y: auto would be more flexible.

Line 13 removes the outline on the main container. If .theme-menu is keyboard-focusable (e.g., as a dialog root), ensure focus is visually indicated through other means.

Also applies to: 13-13


50-50: Specify transition properties instead of all.

Using transition: all can degrade performance as it animates every property change. Specify only the properties that actually transition:

🔎 Proposed fix
-    transition: all 0.15s ease;
+    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;

57-61: Consider using :focus-visible for keyboard-only focus indicators.

Lines 60 and 70 remove the native focus outline and rely entirely on the .focused class (applied via JavaScript) to show keyboard focus through background color changes. If the JS focus management fails, keyboard users may lose visual feedback.

Modern best practice is to use :focus-visible to show outlines only for keyboard navigation, preserving better accessibility without relying on class toggling.

🔎 Proposed enhancement
     &.focused {
       background: ${(props) => props.theme.dropdown.hoverBg};
       color: ${(props) => props.theme.dropdown.color};
-      outline: none;
     }
+
+    &:focus-visible {
+      outline: 2px solid ${(props) => props.theme.dropdown.selectedColor};
+      outline-offset: 2px;
+    }

Apply similar pattern to the active focused state.

Also applies to: 68-71


112-120: Ensure keyboard focus is always visible for theme items.

Line 120 removes the native outline. While the .focused class (lines 125-127) provides a background color change, this depends on JavaScript correctly managing focus. Consider adding :focus-visible as a fallback to guarantee keyboard accessibility.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99bb62a and 7bea87c.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
🧠 Learnings (4)
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Components are used as wrappers to define both self and children components style; Tailwind classes are used specifically for layout based styles

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Use styled component's theme prop to manage CSS colors and not CSS variables when in the context of a styled component or any React component using the styled component

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
📚 Learning: 2025-12-05T20:31:33.005Z
Learnt from: CR
Repo: usebruno/bruno PR: 0
File: CODING_STANDARDS.md:0-0
Timestamp: 2025-12-05T20:31:33.005Z
Learning: Applies to **/*.{jsx,tsx} : Styled Component CSS might also change layout but Tailwind classes shouldn't define colors

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.

Applied to files:

  • packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: CLI Tests
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: Unit Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: SSL Tests - Linux
🔇 Additional comments (1)
packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js (1)

1-151: Well-structured styling with proper theme token usage.

The refactored styles are well-organized into modular components that support the new keyboard-navigable, two-column layout. The use of theme tokens via props.theme is consistent and follows the project's styling patterns.

Coding guidelines are properly followed: 2-space indentation, single quotes, semicolons, and appropriate spacing.

Based on learnings, the use of styled-components theme props for colors (rather than CSS variables) and the absence of Tailwind classes in this StyledWrapper are correct for this codebase.

Comment on lines +42 to +44
width: 24px;
height: 24px;
padding: 8px 4px;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix inconsistent button dimensions.

Lines 42-43 set width: 24px; height: 24px, but line 44 adds padding: 8px 4px. With CSS box-sizing (assuming default content-box), the rendered height becomes 40px (24 + 8×2), not 24px. Either adjust padding or use box-sizing: border-box.

🔎 Proposed fix
   .mode-button {
     display: flex;
     align-items: center;
     justify-content: center;
-    width: 24px;
-    height: 24px;
-    padding: 8px 4px;
+    min-width: 24px;
+    min-height: 24px;
+    padding: 4px;
     border: 1px solid ${(props) => props.theme.dropdown.separator};

Or explicitly use box-sizing: border-box; if the intent is to include padding in the 24px dimensions.

📝 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
width: 24px;
height: 24px;
padding: 8px 4px;
.mode-button {
display: flex;
align-items: center;
justify-content: center;
min-width: 24px;
min-height: 24px;
padding: 4px;
border: 1px solid ${(props) => props.theme.dropdown.separator};
🤖 Prompt for AI Agents
In packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
around lines 42 to 44, the element sets width: 24px and height: 24px but also
padding: 8px 4px which with the default content-box makes the rendered size
larger; fix by either removing/adjusting the padding to match the intended
visual size or add box-sizing: border-box to the selector so the 24x24 includes
padding (preferred: add box-sizing: border-box and keep padding or reduce
padding if exact inner content sizing is required).

Comment on lines +139 to 142
.theme-item-label {
flex: 1;
white-space: nowrap;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Complete the text truncation implementation.

Line 141 sets white-space: nowrap, but without overflow: hidden and text-overflow: ellipsis, long theme names will overflow the container instead of being truncated with an ellipsis.

🔎 Proposed fix
   .theme-item-label {
     flex: 1;
     white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
   }
📝 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
.theme-item-label {
flex: 1;
white-space: nowrap;
}
.theme-item-label {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
🤖 Prompt for AI Agents
In packages/bruno-app/src/components/StatusBar/ThemeDropdown/StyledWrapper.js
around lines 139 to 142, the .theme-item-label currently uses white-space:
nowrap but lacks overflow: hidden and text-overflow: ellipsis, so long theme
names overflow; update the rule to add overflow: hidden and text-overflow:
ellipsis (and ensure the element is a block-level or constrained-width
inline-block so the truncation works) so overflowing text is truncated with an
ellipsis.

@bijin-bruno bijin-bruno merged commit 8b1d59f into usebruno:main Dec 30, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants