-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 ON #35977] [$500] [MEDIUM] Attachment
shown in the LHN when sending a message with image
#37191
Comments
Attachment
shown in the LHN when sending a message with imageAttachment
shown in the LHN when sending a message with image
Job added to Upwork: https://www.upwork.com/jobs/~01a1ad1258cf6daa29 |
Triggered auto assignment to @kevinksullivan ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Attachment shown in the LHN when sending a message with image What is the root cause of that problem?We don't pass text to What changes do you think we should make in order to solve the problem?We need to pass the Lines 2720 to 2729 in 89d5689
const isAttachment = file !== undefined;
const textForNewComment = isAttachment && !text ? CONST.ATTACHMENT_MESSAGE_TEXT : parser.htmlToText(htmlForNewComment); ResultAlternativePass comment text along with the file to the backend and let backend handle the required changes. |
Updated ProposalPlease re-state the problem that we are trying to solve in this issue.The issue is that when a message with an attachment is sent in the chat, the Left Hand Navigation (LHN) displays "[Attachment]" instead of the first line of the actual message text. This behavior is not consistent with the expected result where the LHN should display the first line of the message text, providing a quick preview of the conversation content. Confirmed this issue happens on all platforms. What is the root cause of that problem?I'd like to keep my original proposal in, but based on some recent comments here, I'd also like to address the separation of attachment and comments mentioned by others on this thread. It's stated that you cannot send a text comment along with an attachment (and that it is not supported by the BE). This is simply, not true. We already support sending a text comment along with the attachment as you can see here: App/src/libs/actions/Report.ts Line 418 in 1269110
As such, if we want to truly update the LHN from saying That said, this can be fixed on the FE only. What changes do you think we should make in order to solve the problem?To solve this issue, we should fix the function addActions(reportID: string, text = '', file?: File) {
// variables
if (text) {
// same code
}
if (file) {
// When adding an attachment with an optional comment, use AddAttachment command.
commandName = WRITE_COMMANDS.ADD_ATTACHMENT;
// Include the text comment in the attachment action if present. <--- important change to fix
const attachment = ReportUtils.buildOptimisticAddCommentReportAction(text, file);
attachmentAction = attachment.reportAction;
reportCommentText = text; // Include the text in the report comment.
} With this version of the addActions function, when both a text comment and a file attachment are provided, the text comment is included in the attachment action. This ensures that the attachment and the accompanying text are sent together in a single report action. The reportCommentText variable is updated to include the text comment, and the parameters object for the API call includes both the comment and the file. This should address the issue where the attachment is shown in the LHN instead of the first line of the message. |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)Alternative solution
|
I think this should be held on #35977. We currently send two messages separately, so the second message is an attachment, and on the LHN is showing |
This comment has been minimized.
This comment has been minimized.
@brandonhenry You can't post more than one proposal. Please update your latest solution in the first proposal, and hide the second proposal.
Could you proof this? I tried to send an attachment while having drafted text in the composer, and yes both of them are sent from the Screen.Recording.2024-02-27.at.16.46.28.mp4 |
@mollfpr pretty positive. And even if they are received separately, the BE supports tying a Text action to Attachment. If you were to apply the changes I proposed, you'll see that instead of them being retrieved separately, the text is applied directly to the attachment comment (instead of the text being "[Atttachment]". If the BE is sending two responses, I think that should be changed but as I look and understand the code now, we can definitely tie the draft comment to the attachment from the FE and display only that text included (as original post is wanting) |
Can upload a video a little later showing it working with my changes (and what the BE is sending) - if needed |
@brandonhenry You might be right that the FE already implemented the send attachment with the message, but still if the @dukenv0307 Your proposal seems to have the right path, but we have ongoing discussions about implementing the inline image here https://expensify.slack.com/archives/C01GTK53T8Q/p1707270017261459 @tgolen Do you mind confirming if this needs to hold for #35977 or #37246? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@kevinksullivan, @mollfpr Eep! 4 days overdue now. Issues have feelings too... |
@kevinksullivan, @mollfpr Huh... This is 4 days overdue. Who can take care of this? |
@kevinksullivan, @mollfpr 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@kevinksullivan @mollfpr 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! |
@kevinksullivan, @mollfpr 10 days overdue. I'm getting more depressed than Marvin. |
I'll bring this to the Slack channel 👀 |
I'm sorry for misunderstanding the issue. Looking at the original bug report, the issue is with the message from the Concierge where they can send a text with an image in a single comment. The feature to send text and inline images is currently under development. So it's not reproducible from user perspective. Here's a report action example from the Concierge that sends a text with an inline image.
The problem now is hard to reproduce like the screenshot from @quinthar on the bug report, because not all users get the same message from the Concierge which is a text with the inline image. |
@mollfpr I can reproduce this bug in the normal chat |
@dukenv0307 Is the message have the text and inline message on 1 report action? |
No. When sending an attachment with text, BE returns the attachment and text actions separately |
I think that's the same as sending a text first and then the image on the second message. So the LHN is expected to show the last message I haven't confirmed if we have the last message of an inline image that will show the |
I think we should hold for #35977, which we will display the attachment with text as only one action |
Moving to VIP-VSB as this is tried to chat. |
Attachment
shown in the LHN when sending a message with imageAttachment
shown in the LHN when sending a message with image
Also agree with the proposal to hold this |
still held |
I've started working on this today. When there is a message that contains both text and an attachment, what should the LHN show? I am not super opinionated about it but I think it should probably show the text of the comment and not show
Does that sound right? |
@tgolen What about the situation: "Text + Attachment + Text" or "Attachment + Text"? |
We'll eventually have to cover those I guess, but those aren't possible right now (or with my changes in #35977). Maybe we could:
|
Taking this off hold @mollfpr |
going to test this now actually. |
@kevinksullivan I can't reproduce the issue in production. I think we can close this. |
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.13-14
Reproducible in staging?: y
Reproducible in production?: y
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
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1708811957655339
Action Performed:
Expected Result:
In the LHN first line of the message should display
Actual Result:
Attachment
is displayedWorkaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/38435837/45c13785-4037-41d3-addd-7d17341bab4a

View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: