App icon indicating copy to clipboard operation
App copied to clipboard

LHN - Display chats with an existing draft under pinned chats in LHN

Open isagoico opened this issue 5 years ago β€’ 34 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Navigate to a conversation that's not on the top of LHN
  2. Write something in the compose box.
  3. Navigate away from the chat

Expected Result:

Conversation with a draft message should be displayed on the top of LHN for visibility

Actual Result:

Conversation is not displayed on the top and can be easily lost in the LHN conversation list.

Workaround:

User can manually look for the conversation with the drafted message.

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.0.85-0

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos:

image

Expensify/Expensify Issue URL:

View all open jobs on Upwork


From @rafecolton https://expensify.slack.com/archives/C01GTK53T8Q/p1628786564265600

Chats with draft messages no longer show at the top of the LHN below pinned chats. Unless I missed a conversation somewhere, this is a regression. Edit: I'm on macOS desktop 1.0.82-7

isagoico avatar Aug 12 '21 18:08 isagoico

Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Aug 12 '21 18:08 MelvinBot

By looking at the code in https://github.com/Expensify/App/blob/ff62078baf05801bce5a5c3ebffb20f89b25bf0d/src/libs/OptionsListUtils.js#L387-L428

I can see that we have to choose one option to prioritize: iou debt or pinned, and now we are adding with draft comment. The way it is implemented now, looks like the prioritized is exclusive, if I prioritize by pinned, then 'iou debt' won't be prioritized.

How do we want the reports with draft comment to appear? if it is prioritized by 'iou debt', then the chat with draft comments should be right below the 'iou debt'? or on top?

Wouldn't it be better to be able to have also a way of keeping things in a prioritization like:

  1. pinned
  2. iou debt
  3. drafts
  4. all the rest

And then the user, in the settings, can check or uncheck if they want to have categories like iou debt prioritized or not. If a user uncheck iou debt as a priority, then these reports get mixed git 'all the rest', leaving the reports in the following order:

  1. pinned
  2. drafts
  3. all the rest

aldo-expensify avatar Aug 12 '21 20:08 aldo-expensify

Triggered auto assignment to @JmillsExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Aug 23 '21 16:08 MelvinBot

In my opinion, this can be performed by an external because it seems to be only UI stuff

aldo-expensify avatar Aug 23 '21 16:08 aldo-expensify

Forgot to un-assign myself

aldo-expensify avatar Aug 25 '21 19:08 aldo-expensify

Upwork job is here: https://www.upwork.com/jobs/~01b019518a683d87cf. Please post your solution in this issue and someone from our team will approve before we move forward. Thank you!

JmillsExpensify avatar Aug 26 '21 16:08 JmillsExpensify

Triggered auto assignment to @iwiznia (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

MelvinBot avatar Aug 26 '21 16:08 MelvinBot

@aldo-expensify but I think the prioritization really happens here and it can indeed prioritize many things.

iwiznia avatar Aug 26 '21 16:08 iwiznia

Yes, I think the current order is Pinned > IOUs > everything else if respective prioritizing is set.

Proposal

  1. Add a new argument prioritizeReportsWithDraftComments https://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L321-L343

  2. Add a new array of reports with draft comments here draftReportOptions by filtering with hasDraftComment https://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L455-L461

  3. Conditionally concat that array after IOUs, Pinned so the order becomes Pinned > IOUs > Drafts > everything else(or whatever is the new priority we want to set). https://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L470-L486

meetmangukiya avatar Aug 26 '21 16:08 meetmangukiya

Ah, yes, that looks better. I am missing:

  • What will the default of the new param be? I assume false
  • From what call are we going to pass it as true?

iwiznia avatar Aug 26 '21 16:08 iwiznia

  1. I think that needs to be discussed and decided
  2. I believe we will pass the param from getSidebarOptions calling getOptions. https://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L707-L715 I am not sure what GSD stands for, but we could conditionally change that with that priorityMode or hardcode the priority value https://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L695-L705

meetmangukiya avatar Aug 26 '21 16:08 meetmangukiya

I think that needs to be discussed and decided

Let's do that then πŸ˜„ I think since the only place we want to prioritize the drafts is the LHN, the default should be false.

I am not sure what GSD stands for, but we could conditionally change that with that priorityMode or hardcode the priority value

That's the Get Shit Done mode (renamed to #focus mode in the UI), which you can toggle from the preferences. I think that the proper behavior for GSD mode is to also show any chat with a draft.

iwiznia avatar Aug 26 '21 16:08 iwiznia

@aldo-expensify but I think the prioritization really happens here and it can indeed prioritize many things.

~~It looks like it will prioritize all those there, but only one of those list will contain items at the same time because of the if..else if...else in here~~

Scratch that.. you are right

aldo-expensify avatar Aug 26 '21 16:08 aldo-expensify

Let's do that then πŸ˜„ I think since the only place we want to prioritize the drafts is the LHN, the default should be false.

Oh you meant for getOptions, yes, there definitely false makes sense. But we also need to decide what defaults we want for the LHN. (Also, what is LHN short for πŸ˜… , its seems like an alias for the sidebar). I think this issue is about making drafts prioritized by default for the sidebar, so for sidebar options, we should be calling getOptions with priority for reports with draft comments set to true?

P.S.: Also, while I am at it, what is IOU short for as well?

meetmangukiya avatar Aug 26 '21 16:08 meetmangukiya

But we also need to decide what defaults we want for the LHN

I think we always want drafts to be prioritized in the LHN

(Also, what is LHN short for πŸ˜… , its seems like an alias for the sidebar)

Left Hand Navigation πŸ˜„

we should be calling getOptions with priority for reports with draft comments set to true?

Yep

P.S.: Also, while I am at it, what is IOU short for as well?

It stands for I owe you

Anyway, the proposal looks good, so @JmillsExpensify can you hire @meetmangukiya please?

iwiznia avatar Aug 26 '21 18:08 iwiznia

@meetmangukiya Gert job on the PR. We have already merged it πŸŽ‰

Since this is your first PR for Expensify/App (I hope first of many :), I just want to double check, if you have submitted a proposal to this job posting in Upwork? The job posting is here.

mountiny avatar Aug 27 '21 14:08 mountiny

Yes, I have @mountiny

meetmangukiya avatar Aug 27 '21 14:08 meetmangukiya

Perfect! You should be hired today by Jason (he is in US, West Coast).

mountiny avatar Aug 27 '21 14:08 mountiny

Hired @meetmangukiya in Upwork, assigned issue to me as Contributor Manager

mallenexpensify avatar Aug 27 '21 18:08 mallenexpensify

πŸš€ Deployed to staging by @iwiznia in version: 1.0.88-3 πŸš€

platform result
πŸ€– android πŸ€– cancelled πŸ”ͺ
πŸ–₯ desktop πŸ–₯ cancelled πŸ”ͺ
🍎 iOS 🍎 cancelled πŸ”ͺ
πŸ•Έ web πŸ•Έ success βœ…

botify avatar Aug 30 '21 17:08 botify