Skip to content
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 for payment 2024-08-01] [Details revamp] [$250] Unable to unpin my SelfDM #45654

Closed
6 tasks done
m-natarajan opened this issue Jul 18, 2024 · 22 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 18, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.8-3
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: @JmillsExpensify
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1721253090263159

Action Performed:

  1. Log into any account, though preferably new since we auto-pin your SelfDM
  2. Tap on on the SelfDM header

Expected Result:

An option to unpin my selfDM

Actual Result:

Impossible to unpin your selfDM and no option

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

CleanShot 2024-07-17 at 14 43 10@2x

Recording.353.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018cb35860d3254ac5
  • Upwork Job ID: 1813935056621759849
  • Last Price Increase: 2024-07-18
  • Automatic offers:
    • eh2077 | Reviewer | 103182610
Issue OwnerCurrent Issue Owner: @adelekennedy
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 18, 2024
Copy link

melvin-bot bot commented Jul 18, 2024

Triggered auto assignment to @adelekennedy (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@Tony-MK
Copy link
Contributor

Tony-MK commented Jul 18, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Unable to unpin my SelfDM

What is the root cause of that problem?

The issue's root cause is that the OptionRowLHN component does not use the PinButtion component.

<View
style={styles.ml2}
accessibilityLabel={translate('sidebarScreen.chatPinned')}
>
<Icon
testID="Pin Icon"
fill={theme.icon}
src={Expensicons.Pin}
/>

Therefore, the user has to right-click the OptionRowLHN and unpin or pin the report instead of the pin icon unpinning the report.

The pin icon is unclickable and unusable.

What changes do you think we should make in order to solve the problem?

Use the PinButtion component to ensure the pin icon can be used.

Hence, let's change the code in the OptionRowLHN component in these lines above to the one below.

<PinButton report={optionItem} isOption/>

Finally, we need to make the icon for the PinButton component consistent with the previous look.

Therefore, we should create a new prop called isOption defaulted to false to create two other simple logics to fill icon prop for the PinButton component to icon.fill and the styles for an OptionRowLHN component.

  1. Change this fil logic to over here.
fill={report.isPinned && !isOption ? theme.heading : theme.icon}
  1. Create a condition for the style over here.
style={!isOption ? styles.touchableButtonImage : undefined}
Screen.Recording.2024-07-18.at.06.53.14.mov

@bernhardoj
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

There is no option to unpin self-DM other than from the LHN context menu.

What is the root cause of that problem?

We previously removed the three-dot menu that includes the option to pin/unpin and move it to the profile page or report details page. The pin/unpin option will be shown if the report exists.

const promotedActions = useMemo(() => {
const result: PromotedAction[] = [];
if (report) {
result.push(PromotedActions.pin(report));
}

However, for self-DM, the report doesn't exist.

const reportKey = useMemo(() => {
const accountID = Number(route.params?.accountID ?? -1);
const reportID = ReportUtils.getChatByParticipants(session?.accountID ? [accountID, session.accountID] : [], reports)?.reportID ?? '-1';
if ((!!session && Number(session?.accountID) === accountID) || SessionActions.isAnonymousUser() || !reportID) {
return `${ONYXKEYS.COLLECTION.REPORT}0` as const;
}
return `${ONYXKEYS.COLLECTION.REPORT}${reportID}` as const;
}, [reports, route.params?.accountID, session]);
const [report] = useOnyx(reportKey);

If the current user account ID is the same as the account ID that we are viewing, then we return report_0 as the report key.

What changes do you think we should make in order to solve the problem?

If we are viewing our own profile, then we need to return the self-DM report ID.

const accountID = Number(route.params?.accountID ?? -1);
const isCurrentUser = session?.accountID === accountID;

const reportKey = useMemo(() => {
    const reportID = isCurrentUser
        ? ReportUtils.findSelfDMReportID()
        : ReportUtils.getChatByParticipants(session?.accountID ? [accountID, session.accountID] : [], reports)?.reportID ?? '-1';

    if (SessionActions.isAnonymousUser() || !reportID) {
        return `${ONYXKEYS.COLLECTION.REPORT}0` as const;
    }
    return `${ONYXKEYS.COLLECTION.REPORT}${reportID}` as const;
}, [reports, accountID, isCurrentUser, session]);
image

We can show the Message button if needed too which will open the self-DM report.

image

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 18, 2024
Copy link

melvin-bot bot commented Jul 18, 2024

Job added to Upwork: https://www.upwork.com/jobs/~018cb35860d3254ac5

@melvin-bot melvin-bot bot changed the title Unable to unpin my SelfDM [$250] Unable to unpin my SelfDM Jul 18, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 18, 2024
Copy link

melvin-bot bot commented Jul 18, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)

@trjExpensify trjExpensify changed the title [$250] Unable to unpin my SelfDM [Details revamp] [$250] Unable to unpin my SelfDM Jul 18, 2024
@trjExpensify
Copy link
Contributor

However, for self-DM, the report doesn't exist.

Isn't the self-DM a chatReport? 😕

@bernhardoj
Copy link
Contributor

Oh, the "report" that I was mentioning is the "report" variable 😄, it's undefined for self-DM.

@trjExpensify
Copy link
Contributor

Ah okay, that makes sense.

@eh2077
Copy link
Contributor

eh2077 commented Jul 18, 2024

@Tony-MK Thanks for your proposal. But I don't think we'll want to make the pin icon of LHN message as button - that's inconsistent to the current design - The pin/unpin options are available from RHP.


@bernhardoj 's proposal looks good to me.

I think including both Pin/Unpin and Message buttons makes sense. @trjExpensify What do you think?
image

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jul 18, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

📣 @eh2077 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 19, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @eh2077

@melvin-bot melvin-bot bot removed the Weekly KSv2 label Jul 25, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Jul 25, 2024
@melvin-bot melvin-bot bot changed the title [Details revamp] [$250] Unable to unpin my SelfDM [HOLD for payment 2024-08-01] [Details revamp] [$250] Unable to unpin my SelfDM Jul 25, 2024
Copy link

melvin-bot bot commented Jul 25, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 25, 2024
Copy link

melvin-bot bot commented Jul 25, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.11-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-08-01. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jul 25, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@eh2077] The PR that introduced the bug has been identified. Link to the PR:
  • [@eh2077] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@eh2077] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@eh2077] Determine if we should create a regression test for this bug.
  • [@eh2077] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@adelekennedy] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 31, 2024
@adelekennedy
Copy link

adelekennedy commented Aug 1, 2024

Payouts due:

Just the checklist left @eh2077

@bernhardoj
Copy link
Contributor

Requested in ND

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@melvin-bot melvin-bot bot added the Overdue label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

@nkuoch, @bernhardoj, @adelekennedy, @eh2077 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@adelekennedy
Copy link

bump @eh2077 for the checklist

@melvin-bot melvin-bot bot removed the Overdue label Aug 5, 2024
@eh2077
Copy link
Contributor

eh2077 commented Aug 7, 2024

Checklist

  • [@eh2077] The PR that introduced the bug has been identified. Link to the PR: This issue was introduced by the change to remove the three-dot menu, see related issue [HOLD for payment 2024-07-17] [Details Revamp] Remove the Three Dot Menu on Affected Reports #42080
  • [@eh2077] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
  • [@eh2077] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
  • [@eh2077] Determine if we should create a regression test for this bug. No, because this should be a stable feature and won't be changed often.

@eh2077
Copy link
Contributor

eh2077 commented Aug 7, 2024

@adelekennedy Just completed the checklist, thanks for the reminder!

@melvin-bot melvin-bot bot added the Overdue label Aug 8, 2024
@melvin-bot melvin-bot bot removed the Overdue label Aug 8, 2024
@github-project-automation github-project-automation bot moved this from Polish to Done in [#whatsnext] #wave-collect Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: Done
Development

No branches or pull requests

8 participants