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 2023-07-06] [$1000] Emoji Picker don't hide when composer is hide #20765

Closed
6 tasks done
kbecciv opened this issue Jun 14, 2023 · 51 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

@kbecciv
Copy link

kbecciv commented Jun 14, 2023

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


Action Performed:

Action Performed:

  1. Login with user A --> create new workspace--> invite user B
  2. Open announce room of above workspace --> detail chat --> settting --> who can post --> choose All member
  3. Login with user B on another device --> Open announce chat of above workspace --> open emoji picker
  4. On user A choose who can post --> admin only

Expected Result:

Emoji Picker should be hide like main composer

Actual Result:

Emoji Picker don't hide

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.27-6

Reproducible in staging?: yes

Reproducible in production?: yes

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

Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-06-08.at.15.04.50.1.1.mov
Recording.718.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dukenv0307

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686211761685699

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012f927fc251d62d87
  • Upwork Job ID: 1669121681673699328
  • Last Price Increase: 2023-06-21
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

Triggered auto assignment to @arielgreen (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@Nikhil-Vats
Copy link
Contributor

Proposal

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

When room permissions are changed (from all members can post to only admins) and the members have EmojiPicker open then it is not closed automatically like ReportActionCompose.

What is the root cause of that problem?

We hide the ReportActionCompose component when a room is archived, permissions are changed or there are errors.

const isAllowedToComment = ReportUtils.isAllowedToComment(props.report);
const hideComposer = isArchivedRoom || !_.isEmpty(props.errors) || !isAllowedToComment;

But EmojiPicker is not rendered conditionally in ReportScreen -
<EmojiPicker ref={EmojiPickerAction.emojiPickerRef} />

I tested and the same issue also happens when workspace is archived or there are errors.

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

We should use the same conditions while rendering EmojiPicker -

const isAllowedToComment = ReportUtils.isAllowedToComment(props.report);
const hideComposer = isArchivedRoom || !_.isEmpty(props.errors) || !isAllowedToComment;

But to keep the code DRY we should make a new utility function in ReportUtils and reuse it in both places - ReportFooter and ReportScreen.

What alternative solutions did you explore? (Optional)

NA

@arielgreen arielgreen added the External Added to denote the issue can be worked on by a contributor label Jun 14, 2023
@melvin-bot melvin-bot bot changed the title Emoji Picker don't hide when composer is hide [$1000] Emoji Picker don't hide when composer is hide Jun 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

Job added to Upwork: https://www.upwork.com/jobs/~012f927fc251d62d87

@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

Current assignee @arielgreen is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

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

@spcheema
Copy link
Contributor

Proposed solution

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

Emoji Picker should be hide like main composer

What is the root cause of that problem?

Emoji picker is not wrapped inside conditions like <ReportActionCompose on ReportFooter.js

https://github.com/spcheema/expensify-app/blob/main/src/pages/home/report/ReportFooter.js#L82

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

Following changes are to hide Emoji picker

  • Add utility method to check if a given report is composable.
/**
 * Returns true if a given report is eligible for composable actions like comment, reply or reactions
 * @param {Object} report
 * @returns {Boolean}
 */
function isComposableReport(report) {
    return !isArchivedRoom(report) && isAllowedToComment(report);
}
    { ReportUtils.isComposableReport(this.props.report) && (
        <EmojiPicker ref={EmojiPickerAction.emojiPickerRef} />
    )}
    
  • Update ReportFooter function to use utility method on file ReportFooter.js
function ReportFooter(props) {
    const chatFooterStyles = {...styles.chatFooter, minHeight: !props.isOffline ? CONST.CHAT_FOOTER_MIN_HEIGHT : 0};
    const isArchivedRoom = ReportUtils.isArchivedRoom(props.report);
    const hideComposer = !ReportUtils.isComposableReport(props.report);

    // ... rest of the code
}

What alternative solutions did you explore? (Optional)

NA

@Nikhil-Vats
Copy link
Contributor

@spcheema I have already written in my proposal that I would use a utility function in ReportUtils for doing this to follow DRY.

You have posted the code diff of the same which is not a new approach but exactly same as my proposal.

@spcheema
Copy link
Contributor

spcheema commented Jun 15, 2023

@Nikhil-Vats I spend my time finding the solution and posted it here.

Not sure why it's hurting you. You have written that but I did use complete POC so not sure why you are here to with useless argue.

@Nikhil-Vats
Copy link
Contributor

Hey @spcheema, it is mentioned in the contribution guidelines.

Note: Before submitting a proposal on an issue, be sure to read any other existing proposals. ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The difference should be important, meaningful or considerable.

@spcheema
Copy link
Contributor

@Nikhil-Vats if there is room one can make different proposal. Right?

@spcheema
Copy link
Contributor

I believe my proposal is different because it has got complete POC where you just talk about things can be done without any POC/testing

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 15, 2023

Proposal

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

Emoji Picker don't hide when composer is hide

What is the root cause of that problem?

We don't have a condition to hide emoji picker when permission is changed, room is archived or has error same as composer

const isAllowedToComment = ReportUtils.isAllowedToComment(props.report);
const hideComposer = isArchivedRoom || !_.isEmpty(props.errors) || !isAllowedToComment;

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

We can create a function like isHidenComposer with this logic here to reuse both in ReportFooter and ReportScreen to hide composer and emoji picker or move this logic here to ReportScreen and pass hideComposer as a prop in to ReportFooter

const isAllowedToComment = ReportUtils.isAllowedToComment(props.report);
const hideComposer = isArchivedRoom || !_.isEmpty(props.errors) || !isAllowedToComment;

And in ReportScreen we need to add two emoji picker like this to the user can open emoji picker when editing the message that is sent by the user before permission changed

{hideComposer && <EmojiPicker ref={EmojiPickerAction.emojiPickerRef} />}
{!hideComposer && <EmojiPicker ref={EmojiPickerAction.emojiPickerRef} />}

What alternative solutions did you explore? (Optional)

We also hide the emoji picker when Permission change to only admin
To do that
In componentDidUpdate we can add this code

const isArchivedRoom = ReportUtils.isArchivedRoom(this.props.report);
        const isAllowedToComment = ReportUtils.isAllowedToComment(this.props.report);
        const hideEmojiPicker = isArchivedRoom || !_.isEmpty(this.props.errors) || !isAllowedToComment;
        if(hideEmojiPicker) {
            EmojiPickerAction.hideEmojiPicker()
        }

We also move this code to the utils function to avoid duplicated code

Result

Both Proposal work well

Screencast.from.15-06-2023.12.34.58.webm

@arielgreen
Copy link
Contributor

Reassigning, team change

@arielgreen arielgreen added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot

This comment was marked as duplicate.

@arielgreen arielgreen removed their assignment Jun 16, 2023
@bfitzexpensify
Copy link
Contributor

bfitzexpensify commented Jun 16, 2023

@thesahindia few proposals for you to review when you get a chance!

@thesahindia
Copy link
Member

@spcheema, would you mind explaining how your solution is similar to @dukenv0307's alternative solution?

@spcheema
Copy link
Contributor

@thesahindia pls ignore just realised now. Thanks for reading out.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

📣 @dukenv0307 You have been assigned to this job by @Beamanator!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jun 23, 2023
@dukenv0307
Copy link
Contributor

Hi @thesahindia The PR is ready for review

@melvin-bot
Copy link

melvin-bot bot commented Jun 28, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @dukenv0307 got assigned: 2023-06-23 09:34:02 Z
  • when the PR got merged: 2023-06-28 10:08:58 UTC
  • days elapsed: 3

On to the next one 🚀

@bfitzexpensify
Copy link
Contributor

Just noting here I'm going to consider this eligible for the #urgency bonus. It missed by a whisker (30 minutes) and that mostly came down to timezone differences.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 29, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Emoji Picker don't hide when composer is hide [HOLD for payment 2023-07-06] [$1000] Emoji Picker don't hide when composer is hide Jun 29, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.34-1 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 2023-07-06. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

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:

  • [@thesahindia] The PR that introduced the bug has been identified. Link to the PR:
  • [@thesahindia] 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:
  • [@thesahindia] 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:
  • [@thesahindia] Determine if we should create a regression test for this bug.
  • [@thesahindia] 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.
  • [@bfitzexpensify] 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 5, 2023
@bfitzexpensify
Copy link
Contributor

Offers sent out @thesahindia @dukenv0307

@thesahindia, please complete the BZ checklist when you get a chance - thanks!

@thesahindia
Copy link
Member

@thesahindia, please complete the BZ checklist when you get a chance - thanks!

It wasn't a regression. Just an edge case, so we can skip the checklist.

We can add a test case for this. Steps -

  1. Login with user A
  2. Create a new workspace
  3. Invite user B to the new workspace
  4. Login with user B on a different browser/device
  5. Open announce room
  6. Click on emoji picker
  7. Use account A and open the announce room
  8. Click on the chat header > settings > who can post
  9. Choose "Admins only"
  10. Use account B and verify that emoji picker is hidden.

@thesahindia
Copy link
Member

@bfitzexpensify, I am going to request money on new dot, so no need to pay me on Upwork.

@bfitzexpensify
Copy link
Contributor

Thanks @thesahindia - proposed the test steps in https://github.com/Expensify/Expensify/issues/298637.

So, we're all done here! Thanks everyone

@JmillsExpensify
Copy link

@bfitzexpensify Can you please provide a payment summary on this issue so that I can issue payment via NewDot? Thanks!

@bfitzexpensify
Copy link
Contributor

Payment summary:

C+: @thesahindia - $1500 (C+ review & urgency bonus). To be paid via manual request
Contributor: @dukenv0307 - reporting + contributor work + urgency bonus. $1750 paid via Upwork

@JmillsExpensify
Copy link

Reviewed the details for @thesahindia. $1,500 approved for payment via NewDot based on BZ summary above.

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
None yet
Development

No branches or pull requests

9 participants