Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-06-21] [$1000] Web - Attachment - The attachments carousel repeats the same image if press the Next key after clicking on any attachment #19484

Closed
2 of 6 tasks
kbecciv opened this issue May 23, 2023 · 48 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented May 23, 2023

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. Open App
  2. Go to any Chat and send a few attachments (images, videos)
  3. Press on any attachments, and now press the Right Arrow key from the keyboard. It will load the next attachment.
  4. Now Press the Arrow left key from the keyboard to load the previous attachment.
  5. Now click on anywhere on the attachment
  6. Now Press either the Left Arrow or Right Arrow key again

Expected Result:

It should load the next attachment in the carousel

Actual Result:

It will load the same and the same attachment again

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.17.0

Reproducible in staging?: yes

Reproducible in production?: yes

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

Recording.2797.mp4
carousel-loads-same-image-again-again.1.mov

Expensify/Expensify Issue URL:

Issue reported by: @jayeshmangwani

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684419981493959?thread_ts=1684419948.108039&cid=C049HHMV9SM

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011bb3ee21de3f842b
  • Upwork Job ID: 1661231781339181056
  • Last Price Increase: 2023-05-31
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 23, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@kadiealexander
Copy link
Contributor

Reproduced!

2023-05-24_16-42-36.mp4

Observed the same experience on the desktop app.

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label May 24, 2023
@melvin-bot melvin-bot bot changed the title Web - Attachment - The attachments carousel repeats the same image if press the Next key after clicking on any attachment [$1000] Web - Attachment - The attachments carousel repeats the same image if press the Next key after clicking on any attachment May 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011bb3ee21de3f842b

@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

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

@akinwale
Copy link
Contributor

The videos included do not match the issue description.

@bhrvarsani22
Copy link

The video and Upwork requirement does not match.

@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

📣 @bhrvarsani22! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@bhrvarsani22
Copy link

Contributor details
Your Expensify account email: bhargesh.infoguru@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~014aa84acf8e86d3f6

@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@bhrvarsani22
Copy link

The video and Upwork requirement does not match.

@tienifr
Copy link
Contributor

tienifr commented May 24, 2023

Proposal

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

It will load the same and the same attachment again when we zoom an attachment and click ArrowLeft

What is the root cause of that problem?

The root cause is that we have AttachmentCarousel as a horizontal FlatList here

, when we focus on the list element (by clicking on it to zoom) and press ArrowLeft, by default the behavior of the horizontal list will be to scroll to the left, which will cycle to the last element (before the first element).

We already have our own 'ArrowLeft' event listener here https://github.com/Expensify/App/blob/e9f6a373e70a75d49dda333233ff952ea65e7cb3/src/components/AttachmentCarousel/CarouselActions/index.js#LL19C3-L19C3 which will not cycle to the last element if currently we're on the first element.

But it will still scroll due to default list behavior.

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

We need to add e.preventDefault here

props.onCycleThroughAttachments(-1);
and here
props.onCycleThroughAttachments(1);
so that the list will follow our custom ArrowLeft and ArrowRight behavior rather than using the default behavior.

What alternative solutions did you explore? (Optional)

NA

@kadiealexander
Copy link
Contributor

@bhrvarsani22 and @akinwale, the videos in the OP have been updated, please take another look.

@bhrvarsani22
Copy link

Checking...

@melvin-bot melvin-bot bot added the Overdue label May 29, 2023
@kadiealexander
Copy link
Contributor

@aimane-chnaif any thoughts on the proposal here? #19484 (comment)

@melvin-bot melvin-bot bot removed the Overdue label May 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@situchan
Copy link
Contributor

Proposal

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

The attachments carousel repeats the same image if press the Prev/Next key after focusing on it

What is the root cause of that problem?

The default behavior of FlatList is applied. As scroll is horizontal, arrow left/right controls scroll position as default.

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

We can fully deprecate current /CarouselActions/index.js (document event listener) and use native code in /CarouselActions/index.native.js (our own keyboard shortcut handler) which already prevents default behavior (8th param in subscribe function - default value is true)

@aimane-chnaif
Copy link
Contributor

Thanks for proposals.

Both @tienifr and @situchan explained the root cause correctly and provided working solution.
@tienifr proposed first but I like consistent code between web and native which is @situchan's solution.
Our keyboard shortcut handler is using react-native-key-command library which is already responsive to all platforms perfectly.

I will let @thienlnam decide who to assign. Anyway I will request web code deprecation in PR whoever assigned.
🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

Current assignee @kadiealexander is eligible for the Bug assigner, not assigning anyone new.

@kadiealexander kadiealexander removed their assignment Jun 19, 2023
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 19, 2023
@Expensify Expensify deleted a comment from melvin-bot bot Jun 19, 2023
@kadiealexander kadiealexander added Weekly KSv2 External Added to denote the issue can be worked on by a contributor and removed External Added to denote the issue can be worked on by a contributor Daily KSv2 labels Jun 19, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 19, 2023
@kadiealexander kadiealexander removed Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.

@kadiealexander
Copy link
Contributor

kadiealexander commented Jun 19, 2023

@sakluger I'm going OOO so I'm reassigning this for payment. I've sent offers to @aimane-chnaif and @situchan, but I couldn't proactively find @jayeshmangwani on Upwork. You can find them all here. Thanks for your help!!

@jayeshmangwani please apply on Upwork so we can issue your reporting bonus: upwork.com/jobs/~011bb3ee21de3f842b

@jayeshmangwani
Copy link
Contributor

@kadiealexander applied on Upwork

@melvin-bot melvin-bot bot added the Monthly KSv2 label Jun 19, 2023
@sakluger
Copy link
Contributor

@sakluger sakluger added Daily KSv2 and removed Monthly KSv2 labels Jun 21, 2023
@aimane-chnaif
Copy link
Contributor

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

Regression Test Proposal

  1. Go to any chat room
  2. Send multiple images
  3. Click any image to open preview modal
  4. Click anywhere on the attachment
  5. Press the Left/Right Arrow key many times
  6. Verify that it loads prev/next attachments correctly

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Jun 21, 2023
@sakluger
Copy link
Contributor

Thanks! Those proposed steps look good to me. 👍

All paid up, ready to close!

@jayeshmangwani
Copy link
Contributor

@sakluger Can you please release Milestone at Upwork its showing In Progress to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests