-
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
[CRITICAL][HOLD for payment 2024-05-03][Track Expense] [$500] Allow the self-DM to show up within the 'Start Chat' participant selector #40259
Comments
Triggered auto assignment to @mallenexpensify ( |
|
Job added to Upwork: https://www.upwork.com/jobs/~0112a1eb2ca973eaaa |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
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?
if not, the selfDM is excluded from the results. const createChat = useCallback(
(option?: OptionsListUtils.Option) => {
+ if (option?.isSelfDM) {
+ const report = getReport(option.reportID);
+ Navigation.dismissModalWithReport(report);
+ return;
}
...
},
[selectedOptions],
);
What alternative solutions did you explore? (Optional)
ResultScreen.Recording.2024-04-17.at.03.14.14.mov |
ProposalPlease re-state the problem that we are trying to solve in this issue.Allow the self-DM to show up within the 'Start Chat' participant selector What is the root cause of that problem?new feature What changes do you think we should make in order to solve the problem?
const filteredOptions = OptionsListUtils.getFilteredOptions(
listOptions.reports ?? [],
listOptions.personalDetails ?? [],
betas ?? [],
debouncedSearchTerm,
selectedOptions,
isGroupChat ? excludedGroupEmails : [],
false,
true,
false,
{},
[],
false,
{},
[],
true,
false,
false,
{} as TaxRatesWithDefault,
true,
);
const optionsToExclude: Option[] = includeSelfDM ? [{login: CONST.EMAIL.NOTIFICATIONS}] : [{login: currentUserLogin}, {login: CONST.EMAIL.NOTIFICATIONS}];
if (optionsToExclude.some((optionToExclude) => optionToExclude.login === personalDetailOption.login || personalDetailOption.login === currentUserLogin)) {
if (option?.reportID) {
Navigation.dismissModal(option.reportID);
} else {
Report.navigateToAndOpenReport([login]);
} OR we a cleaner way would be to consider the selfDM inside the Report.navigateToAndOpenReport function: const isSelfDM = userLogins.length === 1 && userLogins?.[0] === currentUserEmail;
if (isSelfDM) {
const selfDMReportID = ReportUtils.findSelfDMReportID();
const selfDMReport = ReportUtils.getReport(selfDMReportID) ?? {};
Navigation.dismissModalWithReport(selfDMReport);
return;
}
|
ProposalPlease re-state the problem that we are trying to solve in this issue.[Track Expense] Allow the self-DM to show up within the 'Start Chat' participant selector What is the root cause of that problem?New feature. What changes do you think we should make in order to solve the problem?We can follow task self assign the cases for showing section selfDM will be similar to self assign
For that we need the following change:
// NewChatPage.tsx pass `includeSelfDM` true
OptionsListUtils.getFilteredOptions(
... cureent params,
false,
false,
{} as TaxRatesWithDefault,
true,
);
// OptionsListUtils.ts return selfDM independent
let selfDM = allReportOptions.find(option => !!option.isSelfDM && !option.isThread);
if (searchValue && selfDM && !isSearchStringMatch(searchValue, selfDM.searchText)) {
selfDM = undefined;
}
return {..., selfDM}
// of course we will update typesrcipt in PR
// recieve selfDM in useOptions
const {..., selfDM} = useOptions(...);
// add new section me at the top
if (selfDM) {
sectionsList.push({
title: translate('newTaskPage.me'),
data: [selfDM],
shouldShow: true,
});
}
const itemRightSideComponent = useCallback(...) => {
if(item.isSelfDM) {
return null;
}
...
// selectedOptions.some((participant) => participant?.searchText?.toLowerCase?.().includes(debouncedSearchTerm.trim().toLowerCase())),
selectedOptions.some((participant) => participant?.searchText?.toLowerCase?.().includes(debouncedSearchTerm.trim().toLowerCase())) || filteredOptions.selfDM, resultScreen.Recording.2024-04-16.at.5.54.21.AM.movWhat alternative solutions did you explore? (Optional) |
@s77rt , plz review the proposals above. Only other thought I had was that self DM shouldn't be prioritized any differently that whatever we're currently doing for the chats that show there. @thienlnam , comment if you disagree. |
@nkdengineer Thanks for the proposal. The suggested solution is over-engineered:
Also searching for |
@abzokhattab Thanks for the proposal. Your solution is not complete:
|
@ahmedGaber93 Thanks for the proposal. I don't see why we need to move the self dm to a separate section. Let's avoid that. |
@s77rt Thanks for your feedback.
App/src/libs/OptionsListUtils.ts Lines 1475 to 1476 in 0eb9ef2
but when the App/src/libs/OptionsListUtils.ts Line 1508 in 0eb9ef2
const createChat = useCallback(
(option?: OptionsListUtils.Option) => {
+ if (option?.isSelfDM) {
+ const report = getReport(option.reportID);
+ Navigation.dismissModalWithReport(report);
+ return;
}
...
},
[selectedOptions],
); |
@s77rt The main goal of this is ensuring display |
@s77rt I updated comment. I have a question about your feedback:
Why is my initial solution from step 2 considered incorrect? I've tested both your suggestion and mine, and they both function correctly. |
@s77rt updated my proposal to fix the self dm navigation .. please try it out with a new account |
@nkdengineer Thanks for looking into this. That makes sense! Can you please update your proposal to cover that? (all details should be in one comment)
Your solution was excluding the current user login and add a condition to "ignore" that exclusion. This could cause problems if we use |
@ahmedGaber93 The goal is to be able to open self dm from chats. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.66-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-05-03. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Regression Test Proposal
|
Thanks @s77rt , testrail GH created |
Contributor: @nkdengineer paid $500 via Upwork @nkdengineer can you please accept the job and reply here once you have? |
@mallenexpensify Based on this comment, the issue`s price should be updated to $500, right? Please correct me if I miss anything |
Yes @nkdengineer , I missed that (and automation doesn't appear to be working as I'd expect). |
Current assignee @mallenexpensify is eligible for the Bug assigner, not assigning anyone new. |
Upwork job price has been updated to $500 |
Thanks @mallenexpensify 🙇 I've applied to the job |
@nkdengineer can you please accept the job and reply here once you have? Before submitting new offers, can you check next time to see if there are existing ones that we sent where we're just waiting for you to accept? There were two for this job awaiting acceptance. Thx |
@mallenexpensify Thanks 🙇 I accepted the offer!
@mallenexpensify Got it, but those were for the wrong amount so I didn't accept |
Paid @nkdengineer , thx. Payment comment updated above. |
Right now, you can only find the self-DM via the global chat search. This is not entirely intuitive that you have to search for your email / you to find the self-DM this way.
Let's allow you to select the self-DM in the chat search and have it open up the self-DM
From the global create,
Note: You should not be able to add the self-DM to group
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: