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-08-01] [$1000] Emojis inside the reaction buttons appear far down #18751

Closed
6 tasks done
kavimuru opened this issue May 10, 2023 · 57 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. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented May 10, 2023

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. Go to any chat
  2. Add a reaction
  3. Observe the emojis inside the buttons

Expected Result:

Should be properly aligned in the center

Actual Result:

Appears closer to bottom of the bottom

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.12
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
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683717352716409

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d57ef93d5d7af14e
  • Upwork Job ID: 1656626923913682944
  • Last Price Increase: 2023-06-01
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 10, 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

@tienifr
Copy link
Contributor

tienifr commented May 11, 2023

Proposal

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

Emoji is not in center of reaction button

What is the root cause of that problem?

In

App/src/styles/StyleUtils.js

Lines 1040 to 1052 in 1d951e6

function getEmojiReactionBubbleTextStyle(isContextMenu = false) {
if (isContextMenu) {
return {
fontSize: 17,
lineHeight: 28,
};
}
return {
fontSize: 15,
lineHeight: 24,
};
}

if the fontSize is 15, the actual lineHeight of emoji is 20. But we're setting the lineHeight is 24
if the fontSize is 17, the actual lineHeight of emoji is 24. But we're setting the lineHeight is 28

=> That makes the emoji is not in center

Screenshot 2023-05-11 at 17 04 11 Screenshot 2023-05-11 at 17 05 24

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

update the lineHeight of emoji accordingly:

if the fontSize is 15, set the lineHeight of emoji is 20.
if the fontSize is 17, set the lineHeight of emoji is 24.

we also add paddingVertical: 2 to keep the size is the same as before

function getEmojiReactionBubbleTextStyle(isContextMenu = false) {
    if (isContextMenu) {
        return {
            fontSize: 17,
            lineHeight: 24,
            paddingVertical: 2,
        };
    }

    return {
        fontSize: 15,
        lineHeight: 20,
        paddingVertical: 2,
    };
}

Result

IOS:

Screen.Recording.2023-05-11.at.17.09.38.mov

Web:
Screenshot 2023-05-11 at 17 11 37

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label May 11, 2023
@melvin-bot melvin-bot bot changed the title Emojis inside the reaction buttons appear far down [$1000] Emojis inside the reaction buttons appear far down May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01d57ef93d5d7af14e

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 11, 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 May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@thesahindia
Copy link
Member

@tienifr, your solution didn't work for me.
After changing the line height -
Screenshot 2023-05-15 at 5 21 54 PM

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2023
@wildan-m
Copy link
Contributor

wildan-m commented May 16, 2023

Proposal

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

Emojis inside the reaction buttons appear far down

What is the root cause of that problem?

textAlignVertical is only for android. We are trying to vertically center the emoticon by using lineHeight, but its behavior is not working as expected. There is slightly far down.

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

We can add height to the emoji container.

I've experimented with some numbers and found that to keep the current height we can add:

  • 32 for context height
  • 28 for non-context height
    and change line height to:
  • 25 for context lineHeight
  • 23 for non-context lineHeight

We change this code

App/src/styles/StyleUtils.js

Lines 1004 to 1042 in dd5fbb6

function getEmojiReactionBubbleStyle(isHovered, hasUserReacted, isContextMenu = false) {
let backgroundColor = themeColors.border;
if (isHovered) {
backgroundColor = themeColors.buttonHoveredBG;
}
if (hasUserReacted) {
backgroundColor = themeColors.reactionActive;
}
if (isContextMenu) {
return {
paddingVertical: 3,
paddingHorizontal: 12,
backgroundColor,
};
}
return {
paddingVertical: 2,
paddingHorizontal: 8,
backgroundColor,
};
}
function getEmojiReactionBubbleTextStyle(isContextMenu = false) {
if (isContextMenu) {
return {
fontSize: 17,
lineHeight: 28,
};
}
return {
fontSize: 15,
lineHeight: 24,
};
}

To:

function getEmojiReactionBubbleStyle(isHovered, hasUserReacted, isContextMenu = false) {
    let backgroundColor = themeColors.border;

    if (isHovered) {
        backgroundColor = themeColors.buttonHoveredBG;
    }

    if (hasUserReacted) {
        backgroundColor = themeColors.reactionActiveBackground;
    }

    if (isContextMenu) {
        return {
            paddingVertical: 3,
            paddingHorizontal: 12,
            backgroundColor,
            height: 32,
        };
    }

    return {
        paddingVertical: 2,
        paddingHorizontal: 8,
        backgroundColor,
        height: 28,
    };
}

function getEmojiReactionBubbleTextStyle(isContextMenu = false) {
    if (isContextMenu) {
        return {
            fontSize: 17,
            lineHeight: 25,
        };
    }

    return {
        fontSize: 15,
        lineHeight: 23,
    };
}

What alternative solutions did you explore? (Optional)

I can see significant differences only on iOS, so we can make iOS-specific styling to adjust the slight difference.

Since the iOS-specific code is minor, I'd prefer not to make another wrapper.

We change this code

App/src/styles/StyleUtils.js

Lines 1030 to 1042 in dd5fbb6

function getEmojiReactionBubbleTextStyle(isContextMenu = false) {
if (isContextMenu) {
return {
fontSize: 17,
lineHeight: 28,
};
}
return {
fontSize: 15,
lineHeight: 24,
};
}

To

function getEmojiReactionBubbleTextStyle(isContextMenu = false, isIos = false) {
    if (isContextMenu) {
        return {
            fontSize: 17,
            lineHeight: 28,
            marginTop: isIos ? -2 : null,
        };
    }

    return {
        fontSize: 15,
        lineHeight: 24,
        marginTop: isIos ? -2 : null,
    };
}

We can use iOS specific wrapper if required or use padding-bottom instead of marginTop, but it will make the bubble a little bit bigger

@thesahindia
Copy link
Member

@wildan-m, it's not an iOS specific bug and the solution doesn't look good to me.

@Victor-Nyagudi
Copy link
Contributor

Maybe it's just my eyes, but I'm having trouble seeing the misalignment - the emojis look fairly properly aligned, at least on desktop and web.

Are you guys just eyeballing it or using the inspector?

Furthermore, the emojis come in different shapes, so I feel some are bound to look misaligned because the center used is not the visual center.

Here's an image to demonstrate.

image

The triangle on the left is perfectly aligned on both the vertical and horizontal axis, but it doesn't appear that way because its aligned about the blue dotted square's center. This is how software usually centrally positions elements.

The triangle on the right is positioned about the triangle's center, so it looks optically aligned.

@grgia
Copy link
Contributor

grgia commented May 17, 2023

@Victor-Nyagudi it seems to be a vertical misalignment rather than horizontal

@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label May 19, 2023
@grgia
Copy link
Contributor

grgia commented May 22, 2023

still waiting for proposals

@melvin-bot melvin-bot bot removed the Overdue label May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

@grgia @muttmuure @thesahindia this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label May 24, 2023
@grgia
Copy link
Contributor

grgia commented May 25, 2023

Still waiting on proposals, I'm going to check on the spacing on native/ios myself

@melvin-bot melvin-bot bot removed the Overdue label May 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

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

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

  • @thesahindia does not require payment (Eligable for Manual Requests)

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 Jul 25, 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.
  • [@muttmuure] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@wildan-m
Copy link
Contributor

FWIW, I've seen that the current solution is to only adjust lineHeight.

Actually, reducing the line height will also narrow down the bubble height, especially in safari (macos). Is that expected?

Recording.45.2.mp4

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 31, 2023
@grgia
Copy link
Contributor

grgia commented Aug 3, 2023

Not overdue, Bump on BZ checklist @thesahindia

@melvin-bot melvin-bot bot removed the Overdue label Aug 3, 2023
@grgia grgia added Weekly KSv2 and removed Daily KSv2 labels Aug 3, 2023
@thesahindia
Copy link
Member

It was an edge case and doesn't need a test case so we can skip the checklist

@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@muttmuure
Copy link
Contributor

Catching up after being OOO, I'll get to this later this week

@melvin-bot melvin-bot bot removed the Overdue label Aug 22, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 30, 2023
@grgia
Copy link
Contributor

grgia commented Sep 1, 2023

not overdue, hold for payment

@melvin-bot melvin-bot bot removed the Overdue label Sep 1, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@grgia
Copy link
Contributor

grgia commented Sep 13, 2023

@muttmuure did we finalize payment?

@melvin-bot melvin-bot bot removed the Overdue label Sep 13, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 21, 2023
@grgia grgia closed this as completed Sep 25, 2023
@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@thesahindia
Copy link
Member

@grgia, I haven't requested the payment yet. @muttmuure, can you please confirm the payment on this issue so that I can send a request?

@thesahindia
Copy link
Member

thesahindia commented Oct 19, 2023

Bump @muttmuure

P.S. I have requested $1000. It was an internal PR review.

@muttmuure
Copy link
Contributor

C+ @thesahindia - $1000

@JmillsExpensify
Copy link

$1,000 payment approved for @thesahindia based on comment 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. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants