Skip to content

fix: workspace home icon alignment in title bar when already fullscreen - #7967

Merged
naman-bruno merged 2 commits into
usebruno:mainfrom
gopu-bruno:fix/workspace-home-alignment
May 18, 2026
Merged

naman-bruno merged 2 commits into
usebruno:mainfrom
gopu-bruno:fix/workspace-home-alignment

Conversation

@gopu-bruno

@gopu-bruno gopu-bruno commented May 11, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes inconsistent alignment of the workspace home control ( on macOS ) when the window is already in native fullscreen when the UI loads. React previously defaulted isFullScreen to false until enter-full-screen / leave-full-screen fired, so title bar padding still assumed traffic lights were present.

Tracked in: BRU

Changes

  • On AppTitleBar mount, call ipcRenderer.invoke('renderer:window-is-fullscreen') and set isFullScreen from the result (same pattern as maximized state).
  • Add ipcMain.handle('renderer:window-is-fullscreen') returning mainWindow.isFullScreen().
  • Unit tests for initial fullscreen sync and enter/leave fullscreen behavior.

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.

  • Packages changed

    • packages/bruno-app
      • AppTitleBar: on mount queries main process via ipcRenderer.invoke('renderer:window-is-fullscreen') to initialize isFullScreen (same pattern used for maximized state). Keeps existing IPC listeners for runtime enter/leave fullscreen events. Fixes misalignment of workspace home control on macOS when the window is already in native fullscreen at UI load.
      • Tests: adds Jest tests (index.spec.js) that mock ipcRenderer to verify initial fullscreen sync and enter/leave fullscreen transitions, and assert the presence/absence of the .fullscreen class on the title bar.
    • packages/bruno-electron
      • index.js: registers an IPC handler ipcMain.handle('renderer:window-is-fullscreen') that returns mainWindow.isFullScreen() so the renderer can synchronously query the initial fullscreen state.
  • Cross-package interactions

    • Renderer (bruno-app) now depends on a new Electron IPC handler implemented in bruno-electron to obtain the initial fullscreen state at mount time. This aligns renderer behavior with the existing maximized-state pattern and prevents UI layout assumptions that depended on delayed fullscreen events.
  • Tests & Coverage

    • Unit tests added in bruno-app cover initial fullscreen state retrieval and runtime fullscreen enter/leave events. Tests mock ipcRenderer.invoke and capture ipcRenderer.on listeners to simulate main process events.
  • Notes

    • No public/exported API or signature changes detected.
    • Tracked in BRU ticket BRU-2342.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 030465fb-a0d5-4b43-936d-2ceebfa177d1

📥 Commits

Reviewing files that changed from the base of the PR and between 2819cc4 and 0035bbe.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/AppTitleBar/index.spec.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-app/src/components/AppTitleBar/index.spec.js

Walkthrough

AppTitleBar now synchronizes fullscreen state by invoking a new main-process IPC handler (renderer:window-is-fullscreen) on component mount. The handler returns the current fullscreen state; the component applies/removes a fullscreen CSS class based on the response. Existing IPC event listeners for enter/leave fullscreen transitions remain functional. Tests validate initial mount state sync and runtime transitions.

Changes

Fullscreen State Initialization via IPC

Layer / File(s) Summary
Main Process IPC Handler
packages/bruno-electron/src/index.js
Adds ipcMain.handle('renderer:window-is-fullscreen') that returns mainWindow.isFullScreen() to the renderer.
Component Fullscreen State Initialization
packages/bruno-app/src/components/AppTitleBar/index.js
Within the fullscreen-change useEffect, invokes renderer:window-is-fullscreen to fetch initial state, sets isFullScreen, and logs errors if the IPC call fails.
Tests & Validation
packages/bruno-app/src/components/AppTitleBar/index.spec.js
Jest/RTL setup, IPC stubbing helpers, tests asserting initial IPC invoke and CSS class application, and tests for main:enter-full-screen / main:leave-full-screen transitions.

Sequence Diagram

sequenceDiagram
  participant AppTitleBar as AppTitleBar<br/>(Renderer)
  participant IPC as IPC Channel
  participant MainProcess as Main Process
  AppTitleBar->>MainProcess: invoke('renderer:window-is-fullscreen')
  MainProcess->>MainProcess: check mainWindow.isFullScreen()
  MainProcess-->>AppTitleBar: return boolean state
  AppTitleBar->>AppTitleBar: setIsFullScreen(state)
  MainProcess->>AppTitleBar: emit('main:enter-full-screen')
  AppTitleBar->>AppTitleBar: setIsFullScreen(true)
  MainProcess->>AppTitleBar: emit('main:leave-full-screen')
  AppTitleBar->>AppTitleBar: setIsFullScreen(false)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: synchronizing fullscreen state on mount to correct workspace home icon alignment when already fullscreen.
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.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@packages/bruno-app/src/components/AppTitleBar/index.spec.js`:
- Around line 85-87: The test currently uses a broad assertion
expect(window.ipcRenderer.invoke).toHaveBeenCalled() which can give false
positives; change it to assert the specific fullscreen IPC channel by using
expect(window.ipcRenderer.invoke).toHaveBeenCalledWith('<FULLSCREEN_CHANNEL>',
...expectedArgs) (or use expect.stringMatching(/fullscreen/) if the exact string
is not certain) for the invocation in the waitFor block, and make the same
replacement for the other occurrences around the test (the assertions against
window.ipcRenderer.invoke in this spec) so the test verifies the fullscreen
channel call explicitly.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e3729938-e76e-470c-9cbe-8cc30029abb7

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad5118 and 2819cc4.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/bruno-app/src/components/AppTitleBar/index.spec.js
  • packages/bruno-electron/src/index.js

@naman-bruno
naman-bruno merged commit 10da27d into usebruno:main May 18, 2026
10 checks passed
lyh543 pushed a commit to lyh543/bruno that referenced this pull request May 22, 2026
sharan-bruno pushed a commit to sharan-bruno/bruno that referenced this pull request Jun 4, 2026
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.

3 participants