LHN - Display chats with an existing draft under pinned chats in LHN
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:
- Navigate to a conversation that's not on the top of LHN
- Write something in the compose box.
- 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:

Expensify/Expensify Issue URL:
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
Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
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:
- pinned
- iou debt
- drafts
- 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:
- pinned
- drafts
- all the rest
Triggered auto assignment to @JmillsExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
In my opinion, this can be performed by an external because it seems to be only UI stuff
Forgot to un-assign myself
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!
Triggered auto assignment to @iwiznia (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@aldo-expensify but I think the prioritization really happens here and it can indeed prioritize many things.
Yes, I think the current order is Pinned > IOUs > everything else if respective prioritizing is set.
Proposal
-
Add a new argument
prioritizeReportsWithDraftCommentshttps://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L321-L343 -
Add a new array of reports with draft comments here
draftReportOptionsby filtering withhasDraftCommenthttps://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L455-L461 -
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
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?
- I think that needs to be discussed and decided
- I believe we will pass the param from
getSidebarOptionscallinggetOptions. https://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L707-L715 I am not sure whatGSDstands for, but we could conditionally change that with thatpriorityModeor hardcode the priority value https://github.com/Expensify/App/blob/0f446f0994a8792a96f0ad959294f39031fa8551/src/libs/OptionsListUtils.js#L695-L705
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.
@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
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?
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?
@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.
Yes, I have @mountiny
Perfect! You should be hired today by Jason (he is in US, West Coast).
Hired @meetmangukiya in Upwork, assigned issue to me as Contributor Manager
π Deployed to staging by @iwiznia in version: 1.0.88-3 π
| platform | result |
|---|---|
| π€ android π€ | cancelled πͺ |
| π₯ desktop π₯ | cancelled πͺ |
| π iOS π | cancelled πͺ |
| πΈ web πΈ | success β |