-
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
fix: use lazy loading for the IOU Report previews #33981
fix: use lazy loading for the IOU Report previews #33981
Conversation
# Conflicts: # src/libs/PersonalDetailsUtils.ts
88dbc3f
to
1d1bf14
Compare
While working on this PR, I've noticed the following: Since this account is hidden, we have no info about their personal details (no login to replace), and this brings a little complication to the current implementation: I've seen in #32613 that there are plans to make all 1:1 contacts visible. |
Interesting findings. What if we pivoted slightly? I wanted to suggest it earlier, just because I'm not super excited about purely textual search & replace, but now we have another reason. function getLastMessageTextForReport(report: Report): string | null {
// Mostly untouched, but...
// - Return lastReportAction.message[0].text if lastReportAction is defined
// - null otherwise (don't rely on lastMessageText in as fallback)
throw new Error("TODO: Implement");
}
function getLastMessageForReport(report: Report | undefined): LastMessage {
if (!report) {
return {
format: 'text',
content: '',
};
}
const customText = getLastMessageTextForReport(report);
if (customText !== null) {
return {
format: 'text',
content: customText,
};
} else {
return {
format: 'html',
content: report?.lastMessageHtml ?? '',
};
}
} On top of this, we could render For |
@cubuspl42 I don't see a major benefit of this approach, could you please elaborate on why it's better for this case? Unfortunately, the IOU summary from BE contains the same string for both Maybe I'm missing the point though... |
@paultsimura I was confused, this message type indeed doesn't use the |
@cubuspl42 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] |
Eventually, we've come to an agreement in Slack to use the Please note: for now, such messages will contain users' logins and will not be localizable – that's expected (Slack thread has more details about it). |
Have you tested a case with the "Pay elsewhere" button, mentioned in the issue description? |
IMO, this falls more into #33766. @mountiny @youssef-lr WDYT? |
@paultsimura If this is a known separate problem, then it should be fine! I didn't mean to add you extra work, I just thought that the other thing might not be tracked anywhere. |
@paultsimura Bump on this |
@cubuspl42 please check this: #32658 (comment) It was decided to make it a separate issue. And apparently, the screenshot we've discussed earlier is also planned to be in that issue. |
Hey @cubuspl42, considering the discussion above, would you be able to finish with the review here, please? |
Of course, it's due. Please merge |
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeMacOS: Desktop |
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.
Please merge main,
and we're good
✋ 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 production by https://github.com/marcaaron in version: 1.4.26-2 🚀
|
Details
Use
report.lastMessageText
in LHN as a fallback for the reports where an IOU Preview is the last action.Fixed Issues
$ #32658
PROPOSAL: #32658 (comment)
Tests
Same as QA
Offline tests
Same as QA
QA Steps
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
android-compressed.mp4
Android: mWeb Chrome
chrome-compressed.mp4
iOS: Native
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-11.at.18.13.01.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-11.at.18.10.11.mp4
MacOS: Chrome / Safari
MacOS: Desktop