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
3.36k stars 2.78k forks source link

[$500] Workspace - Invite member - Member highlights on deselect all members #27377

Closed kbecciv closed 12 months ago

kbecciv commented 1 year 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!


Action Performed:

  1. Go to settings> workspace
  2. Create new workspace if not created
  3. Go to members
  4. Invite any 2 members
  5. Click on select all check box
  6. Deselect last selected member
  7. Deselect second selected member

Expected Result:

Member should not be highlights

Actual Result:

Member highlights

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Version Number: 1.3.69.0 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation

https://github.com/Expensify/App/assets/93399543/75dc0bd5-e066-40c2-b3fc-5bdf71e0774b

https://github.com/Expensify/App/assets/93399543/c5ed47cf-13a6-4eb6-ae8d-ec7a49295e10

Expensify/Expensify Issue URL: Issue reported by: @gadhiyamanan Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694422514518809

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f0d617af5beeb293
  • Upwork Job ID: 1702003634763894784
  • Last Price Increase: 2023-09-13
  • Automatic offers:
    • s77rt | Reviewer | 26724768
    • akamefi202 | Contributor | 26724771
    • gadhiyamanan | Reporter | 26724774
melvin-bot[bot] commented 1 year ago

Triggered auto assignment to @Christinadobrzyn (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~01f0d617af5beeb293

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

joekaufmanexpensify commented 1 year ago

@Christinadobrzyn I was duplicate assigned here, so un-assigning as this doesn't need two BZ members. We are fixing this here.

akamefi202 commented 1 year ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Member highlights on deselect all members in workspace members page.

What is the root cause of that problem?

https://github.com/Expensify/App/blob/7deca7a02a4f58bb1bb47b0689d478525558898f/src/components/SelectionList/BaseSelectionList.js#L173-L177

If the user select/deselect a member, selectRow function is called and the function focuses the next member in the list.

https://github.com/Expensify/App/blob/7deca7a02a4f58bb1bb47b0689d478525558898f/src/components/SelectionList/BaseSelectionList.js#L192-L200

This is implemented for continuous selection & deselection by Enter keyboard shortcut. The code is written inside selectRow function and it will be called from selectFocusedOption.

But selectRow function is also called if the user select/deselect by click/press. So the next member will be focused too and we see current issue.

What changes do you think we should make in order to solve the problem?

https://github.com/Expensify/App/blob/4ff85db3bd2f6f30cd76a249eed82065d397f766/src/components/SelectionList/BaseSelectionList.js#L253-L259

I think we need to call onSelectRow function directly instead of calling selectRow function if the user select/deselect by click/press. So the app will only toggle the item without moving focus to the next item.

What alternative solutions did you explore? (Optional)

N/A

DylanDylann commented 1 year ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

What is the root cause of that problem?

What changes do you think we should make in order to solve the problem?

- Based on ```DeviceCapabilities.canUseTouchScreen()```, we maybe can check if the device is desktop or not
### What alternative solutions did you explore? (Optional)
- Also we can just apply the auto-focus next item in case user press the ENTER key to select the items like: 

const selectRow = (item, index, isPressingEnter) => { if(isPressingEnterKey) { // Logic auto-focus here} onSelectRow(item) }


- The isPressingEnter `s default value is false. So the clicking item does not auto-focus on next available item. In the callback function to handle ENTER press -  ```selectFocusedOption```, we will call selectRow with isPressingEnter is true

### Result
- First proposal: Mobile web

[Screencast from 14-09-2023 12:25:47.webm](https://github.com/Expensify/App/assets/141406735/7fd32001-a761-44c9-a6e3-7e23215f544a)
s77rt commented 1 year ago

@akamefi202 Thanks for the proposal. Your RCA is correct and the solution looks good to me.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed Link to proposal

melvin-bot[bot] commented 1 year ago

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

s77rt commented 1 year ago

@DylanDylann Thanks for the proposal. Your RCA is correct. The first solution i.e. the use of DeviceCapabilities.canUseTouchScreen does not seem correct for this case (the feature is related to keyboard not touchscreen) and the second solution is a pretty much the same as the one proposed by @akamefi202.

DylanDylann commented 1 year ago

@s77rt I think based on DeviceCapabilities.canUseTouchScreen and maybe any additional conditions in the detail PR, we can know that whether the device is desktop or not. So only desktop device can use the keyboard in this case, right? The main idea from my proposal is that: We will disable the auto-focus logic with the devices that do not have ENTER button

Christinadobrzyn commented 1 year ago

Hey @techievivek can you take a peek at this https://github.com/Expensify/App/issues/27377#issuecomment-1719886245

s77rt commented 1 year ago

@DylanDylann The !DeviceCapabilities.canUseTouchScreen() condition would be true on Web/Desktop, this won't change anything and the issue would be still reproducible on those platforms.

DylanDylann commented 1 year ago

@s77rt why "this won't change anything and the issue would be still reproducible on those platforms."? In mobile, !DeviceCapabilities.canUseTouchScreen() will be false so the auto-focus logic is not applied based on my proposal. Please help give me more detail

DylanDylann commented 1 year ago

Also, should we need to confirm whether the auto-focus on the item when deselecting item is intention or not @s77rt

s77rt commented 1 year ago

@DylanDylann

why "this won't change anything and the issue would be still reproducible on those platforms."? In mobile, !DeviceCapabilities.canUseTouchScreen() will be false so the auto-focus logic is not applied

Right, but on Web/Desktop the issue would be still there. We need to fix the bug for all the platforms.

should we need to confirm whether the auto-focus on the item when deselecting item is intention or not

It's intentional based on the code comments

melvin-bot[bot] commented 1 year ago

πŸ“£ @s77rt πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 1 year ago

πŸ“£ @akamefi202 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer 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 πŸ“–

melvin-bot[bot] commented 1 year ago

πŸ“£ @gadhiyamanan πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reporter role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

akamefi202 commented 1 year ago

Thank you. The PR will be ready by tomorrow.

akamefi202 commented 1 year ago

@s77rt I closed the PR.

Christinadobrzyn commented 1 year ago

Reached out to BZ about payment - https://expensify.slack.com/archives/C01SKUP7QR0/p1695743819720659

Christinadobrzyn commented 1 year ago

Follow up from the team is to do a case-by-case evaluation of the work done on the GH and PR.

@s77rt @akamefi202 @techievivek what do you think is fair payment for the work on this job/PR?

s77rt commented 1 year ago

I think 50% would be fair for this case.

Christinadobrzyn commented 12 months ago

Sounds good! Sorry, I'm a little lost here... The job was fixed elsewhere and we can close this, right?

How's this for payouts due:

Issue Reporter: $50 @gadhiyamanan Contributor: $250 @akamefi202 Contributor+: $250 @s77rt

Eligible for 50% #urgency bonus? N

Upwork job is here.

akamefi202 commented 12 months ago

@s77rt @Christinadobrzyn @techievivek Can we please close this issue soon if everything is clear here?

s77rt commented 12 months ago

@Christinadobrzyn Sorry I missed the question

The job was fixed elsewhere and we can close this, right?

Yes. it was fixed here https://github.com/Expensify/App/pull/27246

Christinadobrzyn commented 12 months ago

Thanks! Paid this out in Upwork based on https://github.com/Expensify/App/issues/27377#issuecomment-1741549948

Closing!