-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] Don't hyperlink descriptions that show in expense previews #40173
Comments
Triggered auto assignment to @kevinksullivan ( |
Can you upload the videos again @JmillsExpensify , the current ones aren't visible |
ProposalPlease re-state the problem that we are trying to solve in this issue.We don't want to hyperlink the money request description anymore. What is the root cause of that problem?We convert the text to markdown for every type of markdown, including link. What changes do you think we should make in order to solve the problem?If we don't want to hyperlink it, then we need to exclude link/autolink rule from the expensimark replace logic. We can do that by passing App/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx Lines 297 to 301 in ed34d59
to
We need to do this in ReportPreview too.
What alternative solutions did you explore? (Optional)If we don't want to render any markdown, we can remove the RenderHTML usage and use the merchant Text component to show the description too. App/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx Lines 297 to 302 in 10fc359
|
@kevinksullivan Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@kevinksullivan Huh... This is 4 days overdue. Who can take care of this? |
Job added to Upwork: https://www.upwork.com/jobs/~0135edc95715d2d0f1 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale ( |
@GandalfGwaihir what videos are you referring to? |
@akinwale, @kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@bernhardoj's proposal makes sense here. 🎀👀🎀 C+ reviewed. |
Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Hmm, interesting.
So @JmillsExpensify we want to support all other markdown except hyperlinks in the preview? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Huh, good question. I think the idea is that we don't show markdown anywhere in the preview. That allows us to always be in control of consistently showing information in the preview. e.g. We don't support markdown for the merchant, so it's inconsistent to show it one place and not the other. |
Ok, cool, makes sense. @akinwale @bernhardoj is that what the proposal does? |
@puneetlath @akinwale @kevinksullivan this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
ProposalPlease re-state the problem that we are trying to solve in this issue.We should not support markdown / html for description in money request preview What is the root cause of that problem?We show App/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx Lines 297 to 302 in addcbfb
For this issue we need to remove the markdown from the description as well What changes do you think we should make in order to solve the problem?We should remove the HTML parsing over here, and now that description supports But before that, we receive the text of description without any parsing from the backend: So first if we decide to show description then we need to parse the diff --git a/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx
index 7f70a3e538..1dba2b9a2c 100644
--- a/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx
+++ b/src/components/ReportActionItem/MoneyRequestPreview/MoneyRequestPreviewContent.tsx
@@ -113,7 +113,7 @@ function MoneyRequestPreviewContent({
let merchantOrDescription = requestMerchant;
if (!shouldShowMerchant) {
- merchantOrDescription = description || '';
+ merchantOrDescription = ReportUtils.getParsedComment(description) || '';
}
const receiptImages = hasReceipt ? [ReceiptUtils.getThumbnailAndImageURIs(transaction)] : [];
@@ -296,7 +296,7 @@ function MoneyRequestPreviewContent({
)}
{shouldShowDescription && (
<View style={[styles.breakWord, styles.preWrap]}>
- <RenderHTML html={`<muted-text>${parser.replace(merchantOrDescription)}</muted-text>`} />
+ {parser.htmlToText(merchantOrDescription)}
</View>
)}
{shouldShowMerchant && <Text style={[styles.textLabelSupporting, styles.textNormal]}>{merchantOrDescription}</Text>}
Result Video:Screen.Recording.2024-04-27.at.12.46.54.AM.movNote: The same can be done for |
have posted my proposal according to the latest comments, do let me know what you think of that @puneetlath @akinwale |
@puneetlath if I understand correctly, we don't want to render the markdown at all in the preview, so it will look like this If that's correct, then that's what my alternative proposal suggests. I have updated the alternative proposal to show the code too. |
@akinwale what do you think? |
@puneetlath I think we can move forward with @bernhardoj's alternate solution which renders just plain text for the preview. |
📣 @akinwale 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR is ready cc: @akinwale |
This issue has not been updated in over 15 days. @puneetlath, @akinwale, @kevinksullivan, @bernhardoj eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Automation missed this one, sorry for the delay. All set on payment |
We added hyperlinking to the description field sometime last year, though this creates the confusing situation that an expense preview is sometimes hyperlinked (specifically when an expense has no merchant, but a description), and then sometimes not (when an expense has a merchant). Example below.
To resolve this confusion we've decided to:
As a result, this issue is focused on step one, and no longer showing hyperlinks specifically in the expense preview. It's technically a bug due to the lack of consistency so I'll put this one through the BZ team. Feel free to file in #wave-control.
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: