From 86c2390fd4e809eec86963e284b4d5a72bdcaf86 Mon Sep 17 00:00:00 2001
From: Scott Deeter <scott@expensify.com>
Date: Thu, 12 Nov 2020 16:02:23 -0800
Subject: [PATCH 1/4] Add History menu with Forward & Backward hotkeyed options

---
 desktop/main.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/desktop/main.js b/desktop/main.js
index e9842b63d23c..f90333e3e490 100644
--- a/desktop/main.js
+++ b/desktop/main.js
@@ -52,6 +52,22 @@ const mainWindow = (() => {
 
             // List the Expensify Chat instance under the Window menu, even when it's hidden
             const systemMenu = Menu.getApplicationMenu();
+            systemMenu.append(new MenuItem({
+                label: 'History',
+                submenu: [
+                    {
+                        role: 'back',
+                        label: 'Back',
+                        accelerator: process.platform === 'darwin' ? 'Cmd+[' : 'Shift+[',
+                        click: () => {console.log('Going backward!')}
+                    },
+                    {
+                        role: 'forward',
+                        label: 'Forward',
+                        accelerator: process.platform === 'darwin' ? 'Cmd+]' : 'Shift+]',
+                        click: () => {console.log('Going forward!')}
+                    }]
+            }));
             const windowMenu = systemMenu.items.find(item => item.role === 'windowmenu');
             windowMenu.submenu.append(new MenuItem({type: 'separator'}));
             windowMenu.submenu.append(new MenuItem({

From a85ce690d99e2e444fc12a35cbd0806b7c32c6dd Mon Sep 17 00:00:00 2001
From: Scott Deeter <scott@expensify.com>
Date: Thu, 12 Nov 2020 16:19:17 -0800
Subject: [PATCH 2/4] Trying to make ESLint happy

---
 desktop/main.js | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/desktop/main.js b/desktop/main.js
index f90333e3e490..c913d0b02755 100644
--- a/desktop/main.js
+++ b/desktop/main.js
@@ -54,19 +54,18 @@ const mainWindow = (() => {
             const systemMenu = Menu.getApplicationMenu();
             systemMenu.append(new MenuItem({
                 label: 'History',
-                submenu: [
-                    {
-                        role: 'back',
-                        label: 'Back',
-                        accelerator: process.platform === 'darwin' ? 'Cmd+[' : 'Shift+[',
-                        click: () => {console.log('Going backward!')}
-                    },
-                    {
-                        role: 'forward',
-                        label: 'Forward',
-                        accelerator: process.platform === 'darwin' ? 'Cmd+]' : 'Shift+]',
-                        click: () => {console.log('Going forward!')}
-                    }]
+                submenu: [{
+                    role: 'back',
+                    label: 'Back',
+                    accelerator: process.platform === 'darwin' ? 'Cmd+[' : 'Shift+[',
+                    click: () => { console.log('Going backward!'); }
+                },
+                {
+                    role: 'forward',
+                    label: 'Forward',
+                    accelerator: process.platform === 'darwin' ? 'Cmd+]' : 'Shift+]',
+                    click: () => { console.log('Going forward!'); }
+                }]
             }));
             const windowMenu = systemMenu.items.find(item => item.role === 'windowmenu');
             windowMenu.submenu.append(new MenuItem({type: 'separator'}));

From a92571841c846921f75f002c9b868084c56a37bb Mon Sep 17 00:00:00 2001
From: Scott Deeter <scott@expensify.com>
Date: Mon, 16 Nov 2020 12:25:06 -0800
Subject: [PATCH 3/4] Use menu.insert to put History before Window & Help

---
 desktop/main.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/desktop/main.js b/desktop/main.js
index c913d0b02755..e6926e1edf34 100644
--- a/desktop/main.js
+++ b/desktop/main.js
@@ -52,7 +52,7 @@ const mainWindow = (() => {
 
             // List the Expensify Chat instance under the Window menu, even when it's hidden
             const systemMenu = Menu.getApplicationMenu();
-            systemMenu.append(new MenuItem({
+            systemMenu.insert(4, new MenuItem({
                 label: 'History',
                 submenu: [{
                     role: 'back',

From 69eaaed8327e21fe999973950c254094d40abe67 Mon Sep 17 00:00:00 2001
From: Scott Deeter <scott@expensify.com>
Date: Wed, 18 Nov 2020 13:28:21 -0800
Subject: [PATCH 4/4] Wire up the Fwd & Back buttons

---
 desktop/main.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/desktop/main.js b/desktop/main.js
index e6926e1edf34..07328ab1b743 100644
--- a/desktop/main.js
+++ b/desktop/main.js
@@ -58,13 +58,13 @@ const mainWindow = (() => {
                     role: 'back',
                     label: 'Back',
                     accelerator: process.platform === 'darwin' ? 'Cmd+[' : 'Shift+[',
-                    click: () => { console.log('Going backward!'); }
+                    click: () => { browserWindow.webContents.goBack(); }
                 },
                 {
                     role: 'forward',
                     label: 'Forward',
                     accelerator: process.platform === 'darwin' ? 'Cmd+]' : 'Shift+]',
-                    click: () => { console.log('Going forward!'); }
+                    click: () => { browserWindow.webContents.goForward(); }
                 }]
             }));
             const windowMenu = systemMenu.items.find(item => item.role === 'windowmenu');
