Skip to content

fix: unify hover and keyboard focus styles for collection component#6544

Merged
bijin-bruno merged 1 commit intousebruno:mainfrom
gopu-bruno:fix/collection-hover-keyboard-focus
Dec 29, 2025
Merged

fix: unify hover and keyboard focus styles for collection component#6544
bijin-bruno merged 1 commit intousebruno:mainfrom
gopu-bruno:fix/collection-hover-keyboard-focus

Conversation

@gopu-bruno
Copy link
Collaborator

@gopu-bruno gopu-bruno commented Dec 29, 2025

Description

Unify hover and keyboard focus styles for collection component

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

  • Style
    • Enhanced focus indicators on collection items with improved border styling and visual consistency.
    • Refined hover state styling to ensure consistent visual feedback across interactions in the sidebar.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

Walkthrough

CSS styling refinement for collection element focus and hover states. Updates apply theme-based background and border styling to .collection-keyboard-focused state, adjusts nested hover behavior within that state, and maintains existing general hover styling.

Changes

Cohort / File(s) Change Summary
Collection Component Styling
packages/bruno-app/src/components/Sidebar/Collections/Collection/StyledWrapper.js
Extended .collection-keyboard-focused state with theme background color, top/bottom border styling using focusBorder, and adjusted nested hover to apply keyboard-focus background when hovered. Preserves existing &:hover state behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • chore: playwright fix #6507 — Updates Playwright tests to hover the entire collection element rather than .collection-actions, complementing the CSS hover/focus behavior changes in this PR.

Suggested labels

size/S

Suggested reviewers

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

Poem

✨ A dash of focus, a hint of blur,
Borders and backgrounds now gently stir,
Keyboard and hover in perfect sync,
CSS polish—refined to the brink! 🎨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: unifying hover and keyboard focus styles in the collection component, which matches the file modifications shown in the raw summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Caution

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

⚠️ Outside diff range comments (2)
packages/bruno-app/src/components/Sidebar/Collections/Collection/StyledWrapper.js (2)

18-27: Comment claim contradicts actual implementation.

The comment states "Single source of truth for hover/focus states" but:

  1. Lines 34-36 duplicate the hover background rule
  2. The keyboard-focused state receives different backgrounds depending on hover state (line 22: hoverBg vs line 88: keyboardFocusBg)

This undermines the "single source of truth" principle. Consider either removing the duplicate hover rule or revising the comment to accurately reflect the intended behavior.


34-36: Remove duplicate hover rule.

This hover rule duplicates the background styling already defined on lines 19-22, violating DRY principles and contradicting the "single source of truth" comment.

🔎 Proposed fix
-    &:hover {
-      background: ${(props) => props.theme.sidebar.collection.item.hoverBg};
-    }
-
🧹 Nitpick comments (1)
packages/bruno-app/src/components/Sidebar/Collections/Collection/StyledWrapper.js (1)

82-90: Consider removing !important and addressing specificity properly.

The !important flag on line 88 suggests a specificity conflict. While the current cascade works (.collection-keyboard-focused:hover naturally has higher specificity than .collection-name:hover), the !important is unnecessary and should be avoided.

Additionally, verify the intentional differentiation: keyboard-focused state uses hoverBg (line 22) but keyboard-focused + hover uses keyboardFocusBg (line 88). This creates two different visual states for keyboard focus depending on mouse position, which may conflict with the PR's goal to "unify hover and keyboard focus styles."

🔎 Proposed fix to remove !important
-       &:hover {
-        background: ${(props) => props.theme.sidebar.collection.item.keyboardFocusBg} !important;
-      }
+      &:hover {
+        background: ${(props) => props.theme.sidebar.collection.item.keyboardFocusBg};
+      }
📜 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 63d3182 and 1c1b216.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/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/Sidebar/Collections/Collection/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/Sidebar/Collections/Collection/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/Sidebar/Collections/Collection/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/Sidebar/Collections/Collection/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/Sidebar/Collections/Collection/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: Playwright E2E Tests
  • GitHub Check: Unit Tests
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - Windows

@bijin-bruno bijin-bruno merged commit 9a78432 into usebruno:main Dec 29, 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