Skip to content

fix: linux titlebar#6483

Merged
bijin-bruno merged 1 commit intousebruno:mainfrom
naman-bruno:fix/linux-titlebar
Dec 23, 2025
Merged

fix: linux titlebar#6483
bijin-bruno merged 1 commit intousebruno:mainfrom
naman-bruno:fix/linux-titlebar

Conversation

@naman-bruno
Copy link
Collaborator

@naman-bruno naman-bruno commented Dec 22, 2025

Description

image (3) image (2)

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
    • Added Linux platform support with native window controls (minimize, maximize, close buttons) and proper application titlebar styling.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

Walkthrough

Linux platform support is added to Bruno's window management system. Changes include a new Linux OS detection utility, CSS styling rules for Linux titlebar chrome, extended window control IPC handlers for Linux, and frameless window creation on Linux matching Windows behavior.

Changes

Cohort / File(s) Summary
Platform Detection
packages/bruno-app/src/utils/common/platform.js
New isLinuxOS() utility function added to detect Linux distributions (linux, ubuntu, debian, fedora, centos, arch) following existing OS detection patterns
App Title Bar Styling
packages/bruno-app/src/components/AppTitleBar/StyledWrapper.js
Linux-specific CSS rules added: titlebar-content padding set to 0 on os-linux class and titlebar-left margin set to 6px, mirroring Windows behavior
App Title Bar Logic
packages/bruno-app/src/components/AppTitleBar/index.js
Window controls logic extended to support Linux; showWindowControls now true for Windows or Linux; OS class mapping updated to include os-linux; effects and rendering guarded by showWindowControls instead of isWindows
Electron Main Process
packages/bruno-electron/src/index.js
Window creation modified: frame set to false on Linux, titleBarStyle undefined on non-Mac/Windows; IPC window control handlers (minimize, maximize, close, is-maximized) extended to operate on Windows or Linux

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • The component logic changes extend existing Windows patterns to Linux with straightforward conditional guards
  • Utility function and CSS additions are minimal and follow established conventions
  • Verify IPC handler interactions in Electron main process correctly guard new Linux behavior
  • Confirm dependency array change in effect (ShowWindowControls vs isWindows) maintains correct reactivity

Possibly related PRs

  • PR #6437: Adds Windows custom titlebar support—this PR extends those same AppTitleBar styling, OS-detection, and IPC window-control patterns to Linux

Suggested labels

size/L

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

🐧 Linux joins the window chrome party,
Titlebar controls now oh-so-hearty,
Frameless frames and handlers aligned,
Three platforms blessed, by code refined.
Click, drag, maximize with glee!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix: linux titlebar' directly matches the core change: adding Linux-specific titlebar handling across multiple components and electron configuration.
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

🧹 Nitpick comments (2)
packages/bruno-app/src/components/AppTitleBar/StyledWrapper.js (1)

204-211: LGTM - Linux styling mirrors Windows as intended.

The Linux-specific styles correctly replicate the Windows adjustments for frameless window chrome. Minor observation: these rules are identical to lines 195-202 (Windows). You could consolidate them with a combined selector if desired:

Optional: Combined selector
-  /* Windows-specific styles */
-  &.os-windows .titlebar-content {
+  /* Windows and Linux-specific styles */
+  &.os-windows .titlebar-content,
+  &.os-linux .titlebar-content {
     padding-right: 0px;
     padding-left: 0px;
   }

-  &.os-windows .titlebar-left {
+  &.os-windows .titlebar-left,
+  &.os-linux .titlebar-left {
     margin-left: 6px;
   }
-
-  &.os-linux .titlebar-content {
-    padding-right: 0px;
-    padding-left: 0px;
-  }
-
-  &.os-linux .titlebar-left {
-    margin-left: 6px;
-  }
packages/bruno-app/src/utils/common/platform.js (1)

36-41: Works correctly, but consider extracting distro list for maintainability.

The function follows the established pattern. The long condition on line 40 is hard to scan and extend. Consider:

Optional: Extract distro list
 export const isLinuxOS = () => {
   const os = platform.os;
   const osFamily = os.family.toLowerCase();
-
-  return osFamily.includes('linux') || osFamily.includes('ubuntu') || osFamily.includes('debian') || osFamily.includes('fedora') || osFamily.includes('centos') || osFamily.includes('arch');
+  const linuxFamilies = ['linux', 'ubuntu', 'debian', 'fedora', 'centos', 'arch'];
+  return linuxFamilies.some((family) => osFamily.includes(family));
 };
📜 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 cba164b and 2698f8f.

📒 Files selected for processing (4)
  • packages/bruno-app/src/components/AppTitleBar/StyledWrapper.js
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/bruno-app/src/utils/common/platform.js
  • packages/bruno-electron/src/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-electron/src/index.js
  • packages/bruno-app/src/utils/common/platform.js
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/bruno-app/src/components/AppTitleBar/StyledWrapper.js
🧠 Learnings (3)
📚 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-electron/src/index.js
  • packages/bruno-app/src/utils/common/platform.js
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/bruno-app/src/components/AppTitleBar/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 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/AppTitleBar/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/AppTitleBar/StyledWrapper.js
🧬 Code graph analysis (1)
packages/bruno-app/src/utils/common/platform.js (1)
packages/bruno-app/src/utils/common/path.js (2)
  • os (5-5)
  • osFamily (6-6)
⏰ 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 - Linux
  • GitHub Check: Unit Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - macOS
🔇 Additional comments (8)
packages/bruno-app/src/components/AppTitleBar/index.js (5)

23-23: LGTM - Clean import addition.


28-29: LGTM - OS class detection extended correctly.


38-39: Good abstraction with showWindowControls.

Clean DRY improvement - consolidates the Windows/Linux check into a single boolean for reuse throughout the component.


60-85: LGTM - Effect guard and dependency array correctly updated.

The showWindowControls guard at line 61 and its inclusion in the dependency array at line 85 ensures the effect only runs on Windows/Linux and re-evaluates if the condition changes.


302-326: LGTM - Window controls rendering guard updated.

The showWindowControls condition correctly enables window control buttons for both Windows and Linux platforms.

packages/bruno-electron/src/index.js (3)

88-88: LGTM - Linux platform constant added.


171-193: LGTM - IPC handlers correctly extended for Linux.

All four window control IPC handlers (minimize, maximize, close, is-maximized) now properly gate on isWindows || isLinux. The guards are consistent and allow Linux to share the same IPC control path as Windows.


159-161: Approve—window frame configuration correct; consider style improvement.

The logic correctly sets frame: false only for Linux since titleBarStyle: 'hidden' has no effect there. The current implementation properly handles each platform: titleBarStyle: 'hiddenInset' for macOS, 'hidden' for Windows, and undefined for Linux with frame: false.

Minor suggestion: Simplify isLinux ? false : true to !isLinux for brevity.

@bijin-bruno bijin-bruno merged commit 49ffdd1 into usebruno:main Dec 23, 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