App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2022-09-16] [$1000] - Unable to add attachment or request money using keyboard navigation

Open mvtglobally opened this issue 4 years ago β€’ 75 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. With cursor in compose box Type cmd+tab to navigate to :heavy_plus_sign:
  2. Tap return to open Request Money and Add Attachment menu
  3. Attempt to select one via the arrow keys

Expected Result:

Ability to navigate to Request Money or Add Attachment and to tap return to select.

Actual Result:

Can not navigate with arrow keys nor select Request Money or Add Attachment

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Desktop App

Version Number: 1.1.30-0 Reproducible in staging?: Y Reproducible in production?: Y Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation

https://user-images.githubusercontent.com/43995119/150068401-0b9222c7-cd19-4fcf-b979-60b2239cc05b.mp4

Expensify/Expensify Issue URL: Issue reported by: @mallenexpensify Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1642453579084400

View all open jobs on GitHub

mvtglobally avatar Jan 19 '22 05:01 mvtglobally

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

MelvinBot avatar Jan 19 '22 05:01 MelvinBot

Frontend only issue, can easily go external! Thanks for the report @mallenexpensify

alex-mechler avatar Jan 19 '22 23:01 alex-mechler

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

MelvinBot avatar Jan 19 '22 23:01 MelvinBot

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (Exported)

MelvinBot avatar Jan 21 '22 14:01 MelvinBot

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

MelvinBot avatar Jan 21 '22 14:01 MelvinBot

Upwork post here

bfitzexpensify avatar Jan 21 '22 14:01 bfitzexpensify

Hi there,

I am here routed from Upwork to make a proposal for this issue. My implementation would consist on keyboard listeners that trigger specifically when that menu is open.

The steps to solve this are:

  • Identify if menu (request/attachment) is open.
  • When it is open add keyboard listeners in order to change the active status of each menu item.
  • Another listener on key enter will activate the desired tab while the menu is opened, and close it after it is pressed.

Best,

Nils

nlundgren avatar Jan 21 '22 16:01 nlundgren

@nlundgren Thanks for your proposal. Although the steps are clear, you need to add more information.

  1. Where will you make these changes?
  2. How will you do that?
  3. Code samples?

parasharrajat avatar Jan 21 '22 20:01 parasharrajat

These changes will be made on the on the chat view. I will create a handleKeyboardInput() function and pass it down to the chat component. Once the user opens the + sign while using the keyboard I will use this function to perform the mentioned actions.

In order to know exactly where, I need to spend some more time learning the structure of the project. The main components I saw when going over it are from the React Native application, as I understand this is an accessibility issue in the web app. I would happily spend the necessary time on it if we create a project proposal through Upwork and establish some deliverables.

nlundgren avatar Jan 22 '22 03:01 nlundgren

Ok. I would suggest you take your time to understand the codebase and layout a proper proposal to the problem.

You can head over to README.md file to understand the project structure and contribution guidelines.

Copied from one of core team member

Our approach on all our open source issues is to first discuss the solution with the contributors in order to make sure we all agree on the solution and that it is the best solution we can find. So we do not hire anyone before we can evaluate the solution. I know this is in contrast to other job offers published in upwork, but it allows us to ensure the level of quality we want for our app and code while also diminishing the work thrown out by contributors. ie: if we waited till contributors submit a PR and then found out the solution is not acceptable or has some drawbacks, then that code would need to be thrown out, which is frustrating for contributors.

parasharrajat avatar Jan 22 '22 03:01 parasharrajat

Not much action here so far β€” doubled the price to $500

bfitzexpensify avatar Jan 31 '22 14:01 bfitzexpensify

No progress again for 7 days, doubling again to $1000. Upwork job

bfitzexpensify avatar Feb 07 '22 12:02 bfitzexpensify

Proposal I'll add a keyboard handler to BasePopoverMenu.

  1. We store the active menu in the state: this.state = { activeMenuIndex: -1 }
  2. On componentDidMount, we set up the events, this event will be subject to a prop: allowKeyboardEvents. So that these handlers are added to limited Popover.
if (keyBoardEvent.key.startsWith('Arrow')) {
    this.highlightActiveMenu(keyBoardEvent.key);
    return;
}
if (keyBoardEvent.key === 'Enter' && this.state.activeMenuIndex !== -1) {
    this.props.onItemSelected(this.props.menuItems[this.state.activeMenuIndex]);
}
  1. We add cleanUpHandlers, which will remove keyboard handlers on componentWillUnmount.
  2. Our highlightActiveMenu will look like this:
highlightActiveMenu(arrowKey) {
       console.log('Activate', arrowKey);
       let updatedActiveMenuIndex = this.state.activeMenuIndex;
       if (arrowKey !== 'ArrowDown' && arrowKey !== 'ArrowUp') {
           return;
       }


       if (arrowKey === 'ArrowDown') {
           if (updatedActiveMenuIndex === -1 || updatedActiveMenuIndex === this.props.menuItems.length - 1) {
               updatedActiveMenuIndex = 0;
           } else {
               updatedActiveMenuIndex += 1;
           }
       }

       if (arrowKey === 'ArrowUp') {
           if (updatedActiveMenuIndex === -1 || updatedActiveMenuIndex === 0) {
               updatedActiveMenuIndex = this.props.menuItems.length - 1;
           } else {
               updatedActiveMenuIndex -= 1;
           }
       }

       console.log('Updated Value', updatedActiveMenuIndex);
       this.setState({activeMenuIndex: updatedActiveMenuIndex});
   }


  1. We add a focused={index === this.state.activeMenuIndex} prop to MenuItems

mananjadhav avatar Feb 07 '22 20:02 mananjadhav

@mananjadhav 's Proposal looks good to me. I like that it is generic and can be applied to other menus easily.

A few points:

  1. Menu should be highlighted with a blue border to indicate focus like TextInput.
  2. I am fine with Circular navigation but @puneetlath do we want to have that? When the last item is highlighted, next arrow down will highlight the first in the menu.

cc: @puneetlath

:ribbon: :eyes: :ribbon: C+ reviewed

parasharrajat avatar Feb 08 '22 03:02 parasharrajat

That proposal also seems good to me.

@stitesExpensify are we ok going forward with this or is this being handled as part of the broader accessibility project?

puneetlath avatar Feb 08 '22 18:02 puneetlath

Hmm @mvtglobally would arrow keys be the way that most visually/mobility impaired users try to access that menu (as opposed to something like tabbing through)? cc: @ogumen

stitesExpensify avatar Feb 08 '22 21:02 stitesExpensify

Hmm @mvtglobally would arrow keys be the way that most visually/mobility impaired users try to access that menu (as opposed to something like tabbing through)? cc: @ogumen

Up/down arrow keys (and the circular navigation) is the expected keyboard navigation pattern for the menu options. Pressing Tab key when the popover menu is expanded should collapse it and move focus to the next interactive element (visually it is the "Write something" text field). A good example of the popover menu implementation can be found here: https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-links.html It is for web, but you can check the keyboard interaction.

ogumen avatar Feb 08 '22 23:02 ogumen

@stitesExpensify i would probably have to defer to @ogumen to confirm the best practices when it comes to accessibility issues

mvtglobally avatar Feb 08 '22 23:02 mvtglobally

Ok cool. In that case @mananjadhav's proposal sounds good to me too.

puneetlath avatar Feb 10 '22 19:02 puneetlath

πŸ“£ @mananjadhav You have been assigned to this job by @puneetlath! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

MelvinBot avatar Feb 10 '22 19:02 MelvinBot