# Remove the window menu on electron

**URL:** <https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013>\
**Category:** Cristal\
**Tags:** proposal\
**Created:** [November 28, 2024, 1:26pm UTC](https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013 "2024-11-28T13:26:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [November 28, 2024, 1:26pm UTC](https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013/1 "2024-11-28T13:26:48Z")

</div>

Hello,

currently, when using the reload action from the menu in electron, the user ends up in a blank page ([Loading...](https://jira.xwiki.org/browse/CRISTAL-182)).  
When investigating this issue, I noticed that no menu entry are currently useful.

Here is an exhaustive list of all the menu entries and the consequence of not having them on the menu.

- File
  - Quit (Ctrl+Q): Does not work without the menu, but the native way to quit an app (e.g., Alt+F4 on Linux) is working

- Edit
  - Undo: works when no menu
  - Redo: works when no menu
  - Cut: works when no menu
  - Copy: works when no menu
  - Paste: works when no menu
  - Delete: apparently does nothing
  - Select all: works when no menu

- View
  - Reload (Ctrl+R): **no need for it**
  - Forced reload (Ctrl+Shift+R): **no need for it**
  - Toggle developer tool (Ctrl+Shift+I): **useful, at least when developing**
  - Actual size (Ctrl+0): **does not work without the menu**
  - Zoom in (Ctrl±): **does not work without the menu**
  - Zoom out (Ctrl++): **does not work without the menu**
  - Toggle full screen (F11): **TODO** test without menu

- Windows
  - Minimize (Ctrl+M): Does not work without menu, but the native way to minimize a window is working (e.g., Win+H on Gnome)
  - zoom: apparently does nothing when the menu is activated
  - Close (Ctrl+W): Does not work without the menu, but the native way to quit an app (e.g., Alt+F4 on Linux) is working

- Help
  - Learn more: lead to [https://www.electronjs.org/](https://www.electronjs.org/)
  - Documentation: lead to [electron/docs at v33.2.0 · electron/electron · GitHub](https://github.com/electron/electron/tree/v33.2.0/docs#readme)
  - Community discussions: lead to [electronjs.org](https://discord.com/invite/electronjs)
  - Search issues: lead to [GitHub · Where software is built](https://github.com/electron/electron/issues)

Most of them can be removed, but I think a minimal set of actions must be preserved:

- useful for devs and debug:
  - Toggle developer tool (Ctrl+Shift+I)

- useful for accessibility
  - Actual size (Ctrl+0)
  - Zoom in (Ctrl±)
  - Zoom out (Ctrl++)
  - Toggle full screen (F11)

Then, we have two options:

- **Option 1** : redefine a menu with the minimal set of actions
- **Option 2.1** : only bind the shortcuts for useful features
- **Option 2.2** : bind the shortcuts but also provide a section about help (this is more work as we’d need to introduce a help UI, and provide a way to inject electron specific details, and maybe also a notion of shortcuts and shortcuts definition)

I’m +1 for option 2.1, and create the improvements to do 2.2 later.

WDYT?

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [December 2, 2024, 8:44am UTC](https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013/2 "2024-12-02T08:44:35Z")

</div>

> [@mleduc](#):
>
> **Option 2.1** : only bind the shortcuts for useful features

Doesn’t this mean we keep the menu entries that are not working? Even without a shortcut key associated, the user can still open the menu and try those entries, no? If so, then I’d be more in favor of keeping only the entries that make sense for us, which is option 1.

Thanks,  
Marius

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [December 2, 2024, 8:51am UTC](https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013/3 "2024-12-02T08:51:28Z")

</div>

> [@mflorea](#):
>
> Doesn’t this mean we keep the menu entries that are not working?

No, in option 2.1 there is no menu in the UI anymore. We simply define the keyboard shortcuts for the important actions. The entries that are not working are not accessible anymore.

---

<div class="post-metadata">

**Author:** ![mflorea](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mflorea/32/49_2.png) [@mflorea](https://forum.xwiki.org/u/mflorea)\
**Post date:** [December 2, 2024, 9:27am UTC](https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013/4 "2024-12-02T09:27:31Z")

</div>

Ah, I see, so option 2 is about hiding / removing the menu and exposing some of its features (that would stop being available otherwise) through shortcut keys. I’m fine with this. And yes, ideally we need a UI to discover the shortcut key bindings, but that can be implemented later.

Thanks,  
Marius

---

<div class="post-metadata">

**Author:** ![tkrieck](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tkrieck/32/6019_2.png) [@tkrieck](https://forum.xwiki.org/u/tkrieck)\
**Post date:** [December 2, 2024, 9:54am UTC](https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013/5 "2024-12-02T09:54:54Z")

</div>

> [@mleduc](#):
>
> - **Option 2.1** : only bind the shortcuts for useful features
> - **Option 2.2** : bind the shortcuts but also provide a section about help (this is more work as we’d need to introduce a help UI, and provide a way to inject electron specific details, and maybe also a notion of shortcuts and shortcuts definition)

+1 for this plan

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [December 11, 2024, 7:59am UTC](https://forum.xwiki.org/t/remove-the-window-menu-on-electron/16013/6 "2024-12-11T07:59:04Z")

</div>

Thanks for your answers, I’m going to opt for option 2.1.
