Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
2.99k stars 2.5k forks source link

[HOLD #11768] [$16000] Desktop - The Back ⌘[ and Forward ⌘] shortcuts keys are not working as expected in LHN #4612

Closed isagoico closed 1 year ago

isagoico commented 2 years ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com 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:

  1. Open desktop app
  2. Navigate to several conversations
  3. 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?

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:

View all open jobs on Upwork


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

MelvinBot commented 2 years ago

Triggered auto assignment to @joelbettner (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot commented 2 years ago

@joelbettner Eep! 4 days overdue now. Issues have feelings too...

mallenexpensify commented 2 years ago

@joelbettner , do you think this can be worked on by a contributor? If so, can you add the External label? Thx

joelbettner commented 2 years ago

Sorry, I've been nose down in allocations. Yes, I think this can be worked on by a contributor.

MelvinBot commented 2 years ago

Triggered auto assignment to @MitchExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

parasharrajat commented 2 years ago

Proposal

Here we have two options to configure this.

  1. 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.

  1. 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-event event.
    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 commented 2 years ago

Upwork job

parasharrajat commented 2 years ago

@MitchExpensify I think this needs Exported label so that an engineer can review proposals.

MelvinBot commented 2 years ago

Triggered auto assignment to @NikkiWines (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

NikkiWines commented 2 years ago

@parasharrajat's proposal (Option 1) looks good, @MitchExpensify please hire them for this issue! 🙇

MitchExpensify commented 2 years ago

Hired!

parasharrajat commented 2 years ago

@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.

mallenexpensify commented 2 years ago

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 ?

parasharrajat commented 2 years ago

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.

  1. When the keys don't work for you?
  2. What steps you followed when the keys stop working for you? e.g. went to grab a coffee, petting the cat, and then suddenly...
  3. Keys are working but there is someting wrong with the navigation order?

etc.

mallenexpensify commented 2 years ago

went to grab a coffee, petting the cat, and then suddenly... hahahah, love it.

Here are some examples on Desktop

Example 2

ooooh, it might have to do with chat switcher, seems to work as expected when accessing chats via LHN

Need/want more examples?

parasharrajat commented 2 years ago

Thank you for the steps. I will try 'em all.

mallenexpensify commented 2 years ago

Feel free to send me test messages too

parasharrajat commented 2 years ago

I still have to dig more into this. I will update soon

kadiealexander commented 2 years ago

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.

NikkiWines commented 2 years ago

MevlinBot this isn't overdue

NikkiWines commented 2 years ago

Still not overdue

NikkiWines commented 2 years ago

(changing the label for now so that MelvinBot stops adding the overdue label as frequently)

kadiealexander commented 2 years ago

Please refer to this post for updated information on the n6 hold, we've raised the bonus to $250 for all issues where a PR is created before the N6 hold is lifted.

NikkiWines commented 2 years ago

N6-hold no longer applies - @parasharrajat you should feel free to work on this now.

NikkiWines commented 2 years ago

@parasharrajat any update on this or should we open this back up for other contributors to take on?

parasharrajat commented 2 years ago

I am sorry, I will give it a go this weekend and update you by Monday,

parasharrajat commented 2 years ago

Ok. So I am looking into this. I think the changes I did https://github.com/Expensify/App/pull/6207 here are also needed for this to work. The main issue is that history is not created correctly when we use chat switcher to change the chats. I will test it on that branch and share the updates shortly.

NikkiWines commented 2 years ago

Looks like the review for https://github.com/Expensify/App/pull/6207 is on hold while Marc is OOO, so seemsl like we should expect any progress on this to be delayed until next week

marcaaron commented 2 years ago

Does this feel like a potential react-navigation problem?

history is not created correctly when we use chat switcher to change the chats

I'd be curious to see if there are any new developments with the web implementation of react-navigation. IIRC a lot of the custom logic I added this past year to fix the history was basically just hacks to get browser history to work correctly and wasn't intended to be a long term solution.

The way I see it, we could double down on the custom navigation action path we went down - but also try to see if we can influence a change in react-navigation. Maybe there's an open issue we can add context to or create a new one (web issues).

parasharrajat commented 2 years ago

I have recently updated the react-navigation to the latest so maybe retest this issue and try out default behaviour.

marcaaron commented 2 years ago

so maybe retest this issue and try out default behaviour

Ok so, who should do this? 😄

parasharrajat commented 2 years ago

I will do this.

parasharrajat commented 2 years ago

Updated are posted on #6207 a couple of days back. Waiting for the response there.

NikkiWines commented 2 years ago

@parasharrajat any update on this one?

parasharrajat commented 2 years ago

Oops, forgot to check it due to hold on 6207 but I will look into it from now. It could take a day or two.

parasharrajat commented 2 years ago

@mallenexpensify Could you please retest it may have been resolved? I can't reproduce it. The fact that I changed the navigation in https://github.com/Expensify/App/pull/6207 to work the same as LHN and this issue not reproducible via LHN says that it is fixed.

mallenexpensify commented 2 years ago

@parasharrajat

The Back ⌘[ and Forward ⌘] shortcuts keys are not working as expected I'm still able reproduce the issue on Desktop Version 1.1.18-3.

  1. Via search/chat switcher - Jack > Monte > Deeter > Manager.
  2. CMD + [ goes to Joe G.
  3. CMD + ] goes to Manager.

Via clicking on user names in LHN seems to work better, I had one time where it navigated correctly using CMD + [ but also had other times/tests where it didn't work correctly

mallenexpensify commented 2 years ago

@parasharrajat can you do more testing based on my comment above and see what you find? I'm still on Version 1.1.18-3

parasharrajat commented 2 years ago

Ok, I think I found a strange issue similar to what you are facing. this is reproducible from LHN as well. It seems more severe from what you are facing. But unfortunately, I haven't got a solution for that and nor time to analyze this ATM.

I request to open this to the pool.

mallenexpensify commented 2 years ago

Want me to leave you assigned as Contributor-Plus @parasharrajat ?

parasharrajat commented 2 years ago

Yup, that's fine. I have some context to this problem.

MelvinBot commented 2 years ago

Current assignee @parasharrajat is eligible for the Exported assigner, not assigning anyone new.

MelvinBot commented 2 years ago

Current assignee @NikkiWines is eligible for the Exported assigner, not assigning anyone new.

mallenexpensify commented 2 years ago

Price doubled! I need to update the Upwork job, they're having some issues. Update 12/29 - Price updated in Upwork.

MelvinBot commented 2 years ago

Current assignee @parasharrajat is eligible for the Exported assigner, not assigning anyone new.

MelvinBot commented 2 years ago

Triggered auto assignment to @AndrewGable (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

mallenexpensify commented 2 years ago

Doubled price to $2000 https://www.upwork.com/jobs/~01a4e8881ff6937bae This job is open to proposals, @parasharrajat is currently assigned as the contributor-plus

mallenexpensify commented 2 years ago

Doubled price to $4000 https://www.upwork.com/jobs/~01a4e8881ff6937bae

murataka commented 2 years ago

Hello,

Currently the shourtcuts seem to be not configured in this version already :

CONST.js

KEYBOARD_SHORTCUTS: {
        SEARCH: {
            descriptionKey: 'search',
            shortcutKey: 'K',
            modifiers: ['CTRL'],
        },
        NEW_GROUP: {
            descriptionKey: 'newGroup',
            shortcutKey: 'K',
            modifiers: ['CTRL', 'SHIFT'],
        },
        SHORTCUT_MODAL: {
            descriptionKey: 'openShortcutDialog',
            shortcutKey: 'I',
            modifiers: ['CTRL'],
        },
        ESCAPE: {
            descriptionKey: 'escape',
            shortcutKey: 'Escape',
            modifiers: [],
        },
        ENTER: {
            descriptionKey: null,
            shortcutKey: 'Enter',
            modifiers: [],
        },
        COPY: {
            descriptionKey: 'copy',
            shortcutKey: 'C',
            modifiers: ['CTRL'],
        },
    },

Is someone working on this and does some older version include those configuration ? @parasharrajat I see that you already worked on that. I think I can solve that issue.

parasharrajat commented 2 years ago

We are open to proposals. Great to hear you can solve it. Let's see your approach.