-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2024-06-20] [HOLD for payment 2024-06-18] [$250] Compose box - Browser's back arrow do not focus composer if first image preview open #42368
Comments
Triggered auto assignment to @jliexpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~013929a859819a7038 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Can repro, adding |
ProposalPlease re-state the problem that we are trying to solve in this issueBrowser back button open other images when user opens first attachment image in attachment view (and won't close attachment view) and press the back button. What is the root cause of the problem?In here: App/src/libs/Navigation/AppNavigator/AuthScreens.tsx Lines 152 to 157 in e8ae3c5
When back button is pressed, the App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Lines 283 to 284 in e8ae3c5
App/src/components/Composer/index.tsx Line 324 in e8ae3c5
autofocus to be true. More info about image changes in attachment view@DylanDylann Focus event catch by react native modal The function of this file based on the comment is to trap focus so the focus won't leave modal, if the focus is outside of modal, the trap focus will focus last element inside modal. The code flow is: Composer focused (from autofocus of RNMarkdownTextInput)-> focus event triggered -> catch by trapFocus (which will try to focus child or last descendant element of the modal -> trap focus looping through descendant element -> until last element of the initial rendered image (initialNumToRender is 3 in AttachmentCarousel) list reached : App/src/pages/home/report/ReportAttachments.tsx Lines 21 to 25 in 8375abe
which is navigate back to the attachment modal. Focus event catch by react native modal The function of this file based on the comment is to trap focus so the focus won't leave modal, if the focus is outside of modal, the trap focus will focus last element inside modal. The code flow is: Composer focused (from autofocus of RNMarkdownTextInput)-> focus event triggered -> catch by trapFocus (which will try to focus child or last descendant element of the modal -> trap focus looping through descendant element -> until last element of the initial rendered image (initialNumToRender is 3 in AttachmentCarousel) list reached : App/src/pages/home/report/ReportAttachments.tsx Lines 21 to 25 in 8375abe
which is navigate back to the attachment modal. What changes do you think we should make in order to solve the problem?So basically we prevent set modal visibility too early, in here we should add a condition: App/src/libs/Navigation/AppNavigator/AuthScreens.tsx Lines 155 to 156 in e8ae3c5
the code could be:
This will check whether all modals is hidden completely. App/src/components/Modal/BaseModal.tsx Line 76 in e8ae3c5
The modal already use it and so the if check above is sufficient to fix this issue. To solve the closed issue that reappears above, in baseModal, we should call hide modal only in here: App/src/components/Modal/BaseModal.tsx Line 244 in e8ae3c5
so we add hideModal inside Result:back.button.issue.fix.mp4Fix result for the other issue that reappears:other.issue.fix.result.mp4 |
ProposalPlease re-state the problem that we are trying to solve in this issue.When an image attachment is opened inside a chat, pressing the browser back button will result in another image displaying, rather than being navigated back to the chat. What is the root cause of that problem?Inside the AttachmentCarousel component, the updatePage function is unexpectedly being called when the browser back button is pressed (due to how What changes do you think we should make in order to solve the problem?We should detect when the back button is pressed (potentially using a ref) and then return early inside the updatePage function. This will ensure that we're not unnecessarily fetching a different image and navigating the user to it. It will allow the user to go back to the chat What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Compose box - Browser's back arrow do not focus composer if first image preview open This issue is reproducible for video attachments as well. What is the root cause of that problem?In What changes do you think we should make in order to solve the problem?We should add What alternative solutions did you explore? (Optional) |
📣 @CleverWolf1220! 📣
|
@jliexpensify, I won't be able to review this soon. Please reassign. |
I would love to take over this issue as C+ |
📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
All yours @DylanDylann! EDIT: Still considering proposals! |
@tsa321 Could you detail this point? Which logic does that?
|
@arjun-dureja Could you deep dive into this point and explain why the updatePage is called? Is there any reference, document that explain why onViewableItemsChanged is triggered?
|
@CleverWolf1220 Why waitForInteraction will resolve this problem? |
@DylanDylann Focus event catch by react native modal The function of this file based on the comment is to trap focus so the focus won't leave modal, if the focus is outside of modal, the trap focus will focus last element inside modal. The code flow is: Composer focused (from autofocus of RNMarkdownTextInput)-> focus event triggered -> catch by trapFocus (which will try to focus child or last descendant element of the modal -> trap focus looping through descendant element -> until last element of the initial rendered image (initialNumToRender is 3 in AttachmentCarousel) list reached : App/src/pages/home/report/ReportAttachments.tsx Lines 21 to 25 in 8375abe
which is navigate back to the attachment modal. |
@dangrous yes, my previous PR caused a regression. But in latest main, after bumping the latest version of |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-06-18. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
Thanks for confirming everyone - so given that this is a regression, but also isn't (?), how should we handle payments here? Is it $125, or are we keeping at $250? |
seems sorta weird that Not sure about payment, if we're able to still use this to fix a bug I think maybe it's fine? |
@tsa321 Could you detail the problem mentioned in the new PR? (please attach a video for new bugs) |
@DylanDylann same issue as this issue but in edit composer box macos-web-d.mp4 |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-06-20. 🎊 For reference, here are some details about the assignees on this issue:
|
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:
|
@jliexpensify Let's remove the awaiting payment label. The PR is in the reviewing stage |
@dangrous The original issue still reproduces in other places. Give me a bit of time to deep dive into the new PR |
@tsa321 I can't reproduce your bug Screen.Recording.2024-06-17.at.18.37.26.mov |
@DylanDylann you are right. I think the behavior changed, maybe after FocusTrap implemented. Should I close my PR? |
@DylanDylann removed, does this mean that I'm not paying on the 20th? If so, will remove that from the title as well. |
Summary: we have worked on this issue for a long time. After the original PR was merged, It caused a regression then we reverted the PR. Fortunately, while creating a new PR, we discovered that this issue was fixed by the new FocusTrap implementation. |
@jliexpensify @dangrous I am unsure how we handle the compensation for this case. Maybe half of the compensation might be a decent solution |
Thanks for the summary. Hmm yeah, this is interesting - a regression would usually mean half the standard payout, which would be $125. But the solution wasn't actually used in the end. I feel like we shouldn't compensate since another PR fixed the issue, but honestly I'm fine with $125 for each of you since there was some work involved. @dangrous , thoughts? |
So given that another PR fixed the issue, I think typically in case we don't move forward with payment. But would love to work with y'all on future issues! |
Thanks Daniel. I've cancelled the contracts and removed the job. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.74-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: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Precondition: upload multiple images in chat
Expected Result:
Composer gets focused
Actual Result:
Last uploaded image preview opened
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6481495_1715770820384.multiple_image.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jliexpensifyThe text was updated successfully, but these errors were encountered: