Repository: oliverschwendener/ueli
Pull request #1394 (2025-03-11 12:28:14)

Reordered tray menu and introduced seperators
![image](https://github.com/user-attachments/assets/5b0dff0b-0f98-44f4-adde-8fe1a9b84667)

Reordered menu and added seperators (Show / Settings-related / Quit)


Patch:
diff --git a/src/main/Core/TrayIcon/ContextMenuTemplateProvider.ts b/src/main/Core/TrayIcon/ContextMenuTemplateProvider.ts
index e3a7123f..69086412 100644
--- a/src/main/Core/TrayIcon/ContextMenuTemplateProvider.ts
+++ b/src/main/Core/TrayIcon/ContextMenuTemplateProvider.ts
@@ -24,16 +24,7 @@ export class ContextMenuTemplateProvider {
                 click: () => this.ueliCommandInvoker.invokeUeliCommand("show"),
             },
             {
-                label: t("trayIcon.contextMenu.settings"),
-                click: () => this.ueliCommandInvoker.invokeUeliCommand("openSettings"),
-            },
-            {
-                label: t("trayIcon.contextMenu.about"),
-                click: () => this.ueliCommandInvoker.invokeUeliCommand("openAbout"),
-            },
-            {
-                label: t("trayIcon.contextMenu.quit"),
-                click: () => this.ueliCommandInvoker.invokeUeliCommand("quit"),
+                type: "separator",
             },
             {
                 label: t("trayIcon.contextMenu.hotkey"),
@@ -45,6 +36,21 @@ export class ContextMenuTemplateProvider {
                         ? this.ueliCommandInvoker.invokeUeliCommand("disableHotkey")
                         : this.ueliCommandInvoker.invokeUeliCommand("enableHotkey"),
             },
+            {
+                label: t("trayIcon.contextMenu.settings"),
+                click: () => this.ueliCommandInvoker.invokeUeliCommand("openSettings"),
+            },
+            {
+                label: t("trayIcon.contextMenu.about"),
+                click: () => this.ueliCommandInvoker.invokeUeliCommand("openAbout"),
+            },
+            {
+                type: "separator",
+            },
+            {
+                label: t("trayIcon.contextMenu.quit"),
+                click: () => this.ueliCommandInvoker.invokeUeliCommand("quit"),
+            },
         ];
     }
 }


Test patch:
diff --git a/src/main/Core/TrayIcon/ContextMenuTemplateProvider.test.ts b/src/main/Core/TrayIcon/ContextMenuTemplateProvider.test.ts
index 4f771080..15259a0b 100644
--- a/src/main/Core/TrayIcon/ContextMenuTemplateProvider.test.ts
+++ b/src/main/Core/TrayIcon/ContextMenuTemplateProvider.test.ts
@@ -27,9 +27,7 @@ describe(ContextMenuTemplateProvider, () => {
 
             const expected: MenuItemConstructorOptions[] = [
                 { label: "translation[trayIcon.contextMenu.show]", click: () => null },
-                { label: "translation[trayIcon.contextMenu.settings]", click: () => null },
-                { label: "translation[trayIcon.contextMenu.about]", click: () => null },
-                { label: "translation[trayIcon.contextMenu.quit]", click: () => null },
+                { type: "separator" },
                 {
                     label: "translation[trayIcon.contextMenu.hotkey]",
                     click: () => null,
@@ -37,6 +35,10 @@ describe(ContextMenuTemplateProvider, () => {
                     type: "checkbox",
                     toolTip: "translation[trayIcon.contextMenu.hotkey.tooltip]",
                 },
+                { label: "translation[trayIcon.contextMenu.settings]", click: () => null },
+                { label: "translation[trayIcon.contextMenu.about]", click: () => null },
+                { type: "separator" },
+                { label: "translation[trayIcon.contextMenu.quit]", click: () => null },
             ];
 
             expect(createTMock).toHaveBeenCalledWith(resources);