[HOLD #11768] [$16000] Desktop - The Back ⌘[ and Forward ⌘] shortcuts keys are not working as expected in LHN
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
This issue has been split in two. This one is solely focused on the back/forward actions in LeftHandNav (LHN), the other https://github.com/Expensify/App/issues/8657 is focused on back/forward actions in the main chat window.
Action Performed:
- Open desktop app
- Navigate to several conversations
- Use the back
⌘[and Forward⌘]shortcuts
Expected Result:
Back ⌘[ and Forward ⌘] shortcuts should work and navigate through the previously navigated conversations and show correctly in LHN.
Actual Result:
Shortcuts are not working as expected.
Workaround:
User has to manually navigate through the conversations.
Platform:
Where is this issue occurring?
- Desktop App
Version Number: 1.0.82-7
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation Unable to get a video atm. Will update with video later. Other issue for back/forward working correctly in the main chat window https://github.com/Expensify/App/issues/8657
Expensify/Expensify Issue URL:
From @mallenexpensify https://expensify.slack.com/archives/C01GTK53T8Q/p1628722621224600
The Back ⌘[ and Forward ⌘] shortcuts keys don't work properly on Desktop Version 1.0.82-7
Triggered auto assignment to @joelbettner (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
@joelbettner Eep! 4 days overdue now. Issues have feelings too...
@joelbettner , do you think this can be worked on by a contributor? If so, can you add the External label? Thx
Sorry, I've been nose down in allocations. Yes, I think this can be worked on by a contributor.
Triggered auto assignment to @MitchExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Proposal
Here we have two options to configure this.
- the First Option is to register the keyboard short to with these keys to navigate back/forth in history using the
History API's back and forward methods.
for this, we have KeyboardShortcut lib. https://github.com/Expensify/App/blob/2b57f0fac59d007441fb170fd05445d83392ed86/src/libs/KeyboardShortcut/index.js
but we only have to activate these shortcuts for the desktop.
- the second option is to handle these shortcuts from the Main.js desktop file, it is a little involved but does the same this.
First, we have to tap the keyboard events from the browserWindow using
before-input-eventevent.
win.webContents.on('before-input-event', (event, input)
Then we have to call web-contents#contentsgoback and web-contents#contentsgoforward to navigate. https://www.electronjs.org/docs/api/web-contents#contentsgoback
I think the first one is going to be easier.
@MitchExpensify I think this needs Exported label so that an engineer can review proposals.
Triggered auto assignment to @NikkiWines (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@parasharrajat's proposal (Option 1) looks good, @MitchExpensify please hire them for this issue! 🙇
Hired!
@mallenexpensify Since you faced this issue. I would like to ask about your experience with it. I found out that the app already has these shortcuts in place.
I don't know why it doesn't work consistently for me on desktop. It's via the keyboard shortcuts and also my back/forth keys on my logitech trackbacll, when don't have issues in other applications, mainly Chrome.
Any thoughts why that might be the case @parasharrajat ?
There was a misunderstanding here. The app is already configured with these shortcuts in main.js so my proposal is invalid now. But, I would like to request @mallenexpensify to provide more concrete reproduction steps or information.
- When the keys don't work for you?
- What steps you followed when the keys stop working for you? e.g. went to grab a coffee, petting the cat, and then suddenly...
- Keys are working but there is someting wrong with the navigation order?
etc.
went to grab a coffee, petting the cat, and then suddenly... hahahah, love it.
Here are some examples on Desktop
- ⌘+k to chat with Mitch, type nothing
- ⌘+k to go to chat with Scott, type nothing
- ⌘[ goes back to a chat with Michelle, type nothing
- ⌘] does nothing
Example 2
- in chat with James, sending messages back/forth
- ⌘+k to chat with my test account, type a message
- ⌘[ goes back to chat with Michelle
- ⌘] goes to chat with my test account
- ⌘[ does nothing
ooooh, it might have to do with chat switcher, seems to work as expected when accessing chats via LHN
- click Rajat in LHN
- click Mitch in LHN
- click Monte in LHN
- ⌘[ goes to Mitch
- ⌘[ goes to Rajat.
- ⌘] goes to Mitch
- ⌘] goes to Monte
- ⌘[ goes nowhere (hahahhahahah)
Need/want more examples?
Thank you for the steps. I will try 'em all.
Feel free to send me test messages too
I still have to dig more into this. I will update soon
Hi @parasharrajat, I've placed this issue on hold as per this update, as we are prioritising issues related to a feature release scheduled for 9/24. As an apology for the delay, we will add a $100 bonus as a thank you for waiting.
MevlinBot this isn't overdue