Skip to content

fix: render web menu on Windows instead of hidden native menu - #727

Merged
dcoutinho1328 merged 3 commits into
developmentfrom
fix/render-web-menu-on-windows
Apr 15, 2026
Merged

fix: render web menu on Windows instead of hidden native menu#727
dcoutinho1328 merged 3 commits into
developmentfrom
fix/render-web-menu-on-windows

Conversation

@dcoutinho1328

@dcoutinho1328 dcoutinho1328 commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • On Windows (and Linux), the native Electron menu is created with visible: false in menu.ts, but EDITOR_CAPABILITIES.hasNativeMenu was always true — preventing the web MenuBar component from rendering in the title bar.
  • Detects macOS via navigator.platform in editor-platform.ts and sets hasNativeMenu: true only on macOS, where the native menu bar is actually visible.
  • On Windows/Linux, the Radix UI MenuBar and OpenPLC icon now render in the title bar's left slot.

Test plan

  • Build and run on macOS — verify native menu bar still works, no web menu rendered
  • Build and run on Windows — verify web menu renders in the title bar with File, Edit, Display, Help menus
  • Verify menu actions (New Project, Open, Save, etc.) work correctly from the web menu on Windows
  • Verify the OpenPLC icon appears next to the web menu when a project is open

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added platform detection for macOS and exposed a new capability indicating native menu availability to the editor runtime.
    • Updated editor capabilities payload to include the native-menu flag alongside development mode and existing capability flags.
    • Improves UI behavior on macOS and ensures consistent capability reporting across environments. No direct UI changes beyond enabling features that adapt to native menus when present.

On Windows (and Linux), the native Electron menu is created with
visible: false, but hasNativeMenu was always true — preventing the
web MenuBar component from rendering. Detect macOS via navigator.platform
and only set hasNativeMenu: true on macOS where the native menu is visible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@dcoutinho1328 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9da1d698-05c0-4048-9821-429471bf27d2

📥 Commits

Reviewing files that changed from the base of the PR and between 756979b and 10bc013.

📒 Files selected for processing (2)
  • src/backend/shared/utils/default-zod-schema-values.ts
  • src/frontend/components/_features/[start]/new-project/steps/third-step.tsx

Walkthrough

Added macOS detection and exposed a hasNativeMenu boolean on editorPorts.capabilities, computed from navigator.platform.startsWith('Mac'). The new flag is combined with existing EDITOR_CAPABILITIES and isDevMode in the exported editorPorts object.

Changes

Cohort / File(s) Summary
Platform Detection Enhancement
src/middleware/editor-platform.ts
Introduce isMac via navigator.platform.startsWith('Mac') and add hasNativeMenu: boolean to editorPorts.capabilities, merged with existing EDITOR_CAPABILITIES and isDevMode.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • JoaoGSP

Poem

🐰 I sniff the platform, Mac or not,
I add a flag in one quick hop.
Native menus now I spot,
A tiny change — a joyful hop! 🍎✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The description provides a clear summary of the problem, solution, and test plan. However, it lacks several required sections from the template (References, DOD checklist details, test coverage percentage) and is incomplete in checklist items. Complete the description by adding issue references, Jira link, explicit DOD checklist completion status, test coverage metrics, and confirmation of all checklist items before merging.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: rendering the web menu on Windows instead of the hidden native menu, which aligns with the core modification shown in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/render-web-menu-on-windows

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.

dcoutinho1328 and others added 2 commits April 14, 2026 20:56
…issing file registration

getDefaultSchemaValues returned raw {} for ZodDefault wrapping ZodObject
instead of recursing into nested fields, causing a TypeError when accessing
communicationConfiguration.modbusRTU. Also replaced manual store hydration
in the create-project flow with handleOpenProjectResponse, which properly
registers files, flows, libraries, and opens the main POU tab.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dcoutinho1328
dcoutinho1328 merged commit b40774a into development Apr 15, 2026
11 of 12 checks passed
@dcoutinho1328
dcoutinho1328 deleted the fix/render-web-menu-on-windows branch April 15, 2026 00:22
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.

1 participant