-
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
Improve Attachment Carousel State Management in AttachmentModal and ReportAttachments #22179
Improve Attachment Carousel State Management in AttachmentModal and ReportAttachments #22179
Conversation
- Added a new prop `onCarouselAttachmentChange` to `AttachmentModal` component that is called whenever the carousel attachment changes. - This new prop is a function that is called with the current attachment object as its argument. - Also, a corresponding function is passed in `ReportAttachments` to navigate to the respective route for each attachment whenever the carousel attachment changes.
Details: - Modified the `onNavigate` function in `AttachmentModal` component to set the state of `isAuthTokenRequired` depending on the attachment navigated to. - This change allows the component to correctly update whether an auth token is required or not for each attachment in the carousel.
@Santhosh-Sellavel Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
This Pull Request is now ready for review ✅ I regret to inform you that I'm currently traveling and will not have access to my Desktop until next week, thereby hindering my ability to test and record videos on Android. Given the circumstances, if it's amenable to you, I would greatly appreciate the use of any test videos you might generate during the review process. I would then incorporate them to update the PR description accordingly. Thank you for your understanding. |
NoteThis PR incorporates 2 small changes as noted by the description:
|
Lets assign @allroundexperts once it's ready for review |
The PR is ready for review with the android caveat mentioned here: #22179 (comment) |
Reassigned @Santhosh-Sellavel for review |
Reviewer Checklist
Screenshots/VideosWeb & DesktopScreen.Recording.2023-07-07.at.3.00.13.AM.movMobile Web - Chrome & Mobile Web - SafariScreen.Recording.2023-07-07.at.3.04.19.AM.moviOS & AndroidScreen.Recording.2023-07-07.at.3.02.07.AM.mov |
Tested web alone works well so far, will continue and complete the reviewer checklist tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM tests well!
All yours @Julesssss!
@kidroca Please complete the author checklist, my recording should be enough here, thanks! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.38-0 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 1.3.38-7 🚀
|
Details
Added a new optional callback
onCarouselAttachmentChange
prop to theAttachmentModal
component. This prop is a function that gets called whenever the carousel attachment changes, providing the current attachment object as an argument. This change will ensure the correct state is maintained for the modal during the interaction with the carousel.Updated the
onNavigate
function in theAttachmentModal
component. This function is now responsible for setting the state ofisAuthTokenRequired
, which can change depending on the current attachment.Added a corresponding function to the
ReportAttachments
page that utilizes theonCarouselAttachmentChange
callback. This function navigates to the respective route for each attachment when the carousel attachment changes.Fixed Issues
$ #18451
PROPOSAL: #18451 (comment)
$ #22133
PROPOSAL: #22133 (comment)
Tests
On web and mobile web
Other platforms
Offline tests
N/A
Opening an attachment while offline should have the same behavior as it did before - the attachment appears to load indefinitely. We can close the attachment view and return to the chat.
QA Steps
On web and mobile web
Other platforms
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
#22179 "Mobile Web - Chrome & Mobile Web - Safari"
(from this comment: #22179 (comment))
Mobile Web - Safari
mobile.Safari.mov
Desktop
desktop.mov
iOS
ios.mov
Android
https://github.com/Expensify/App/pull/22179#:~:text=Screen.Recording.2023%2D07%2D07.at.3.04.19.AM.mov-,ios%20%26%20android,-Screen.Recording.2023%2D07%2D07.at.3.02.07.AM.mov "iOS & Android" (from this comment: #22179 (comment))