Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.49k stars 2.84k forks source link

[HOLD for payment 2023-08-01] [$1000] Emojis inside the reaction buttons appear far down #18751

Closed kavimuru closed 1 year ago

kavimuru commented 1 year ago

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:

  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?

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
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

tienifr commented 1 year ago

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 https://github.com/Expensify/App/blob/1d951e6812a30376eaed21ee792c370626e82d89/src/styles/StyleUtils.js#L1040-L1052

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:

https://github.com/Expensify/App/assets/113963320/46aac979-1511-4db4-9c73-602d7d7a4079

Web:

Screenshot 2023-05-11 at 17 11 37
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

thesahindia commented 1 year ago

@tienifr, your solution didn't work for me. After changing the line height -

Screenshot 2023-05-15 at 5 21 54 PM
wildan-m commented 1 year ago

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:

We change this code https://github.com/Expensify/App/blob/dd5fbb6d12e5daa66458b3db07f0ea88dbc4d449/src/styles/StyleUtils.js#L1004-L1042

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 https://github.com/Expensify/App/blob/dd5fbb6d12e5daa66458b3db07f0ea88dbc4d449/src/styles/StyleUtils.js#L1030-L1042

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 commented 1 year ago

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

Victor-Nyagudi commented 1 year ago

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 commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

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

grgia commented 1 year ago

still waiting for proposals

melvin-bot[bot] commented 1 year ago

@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!

grgia commented 1 year ago

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

Victor-Nyagudi commented 1 year ago

I'm currently investigating this issue, and I'm only seeing the emojis being misaligned vertically on iOS native, particularly the round emotion faces i.e. 😃, 🤓, ☹️.

Take a look at these screenshots I took.

I tried to pick an emoji from each category i.e. smileys & people, animals & nature, food & drink, etc. with varying shapes and sizes for as much variation as possible.

Sreenshots of emojis on different platforms #### Mac Safari ![expensify-emojis-mac-safari](https://github.com/Expensify/App/assets/79470910/69cfb222-55ef-4850-b3c7-29f3f34afd33) #### Mac Chrome ![expensify-emojis-mac-chrome](https://github.com/Expensify/App/assets/79470910/4f4b2818-e16c-45ee-be1b-be91741fa74f) #### iOS Web ![expensify-emojis-ios-web](https://github.com/Expensify/App/assets/79470910/d1edf252-2379-4e6a-97dc-8ceed99daf05) #### iOS Native ![expensify-emojis-ios-native](https://github.com/Expensify/App/assets/79470910/0e7d3b5d-88c9-449c-b728-f26c0db1913c) #### Android Native ![expensify-emojis-android-native](https://github.com/Expensify/App/assets/79470910/d106ef49-435a-4965-abb5-4acc6213d2bb)

If you don't mind me asking, @thesahindia, how did you measure the alignment or misalignment on the other non-iOS platforms? Those look fine to me.

For anyone who's nit-picky, you'll notice the French flag emoji 🇫🇷 is about 2-3 pixels above the 1 on iOS Web and Mac Chrome.

The red triangle 🔻doesn't appear perfectly aligned on some platforms, which could be explained by what I said in an earlier comment (the triangle is just flipped this time, but the same principle applies).

I think we should confirm first if this is an iOS-native-only bug before proceeding, lest we end up trying to fix places that were never broken in the first place.

We could always start a conversation in Slack to get some more eyes and feedback on this, @grgia.

melvin-bot[bot] commented 1 year ago

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

grgia commented 1 year ago

@shawnborton need your 👀 on this one- could you take a look at the screenshots in this comment? https://github.com/Expensify/App/issues/18751#issuecomment-1562990170 is this a noticeable bug to you?

shawnborton commented 1 year ago

Hmm interesting, maybe this is okay now? Those screenshots look way better than what I originally reported (first comment).

But I just checked my physical device on the latest TestFlight on iOS and yeah, some emojis still feel way too far down than others. Thoughts?

thesahindia commented 1 year ago

I think the problem is only at native app. Here's screenshot -

Screenshot 2023-05-31 at 10 38 58 PM

But I just checked my physical device on the latest TestFlight on iOS and yeah, some emojis still feel way too far down than others. Thoughts?

Yes, the problem is still there.

melvin-bot[bot] commented 1 year ago

@grgia @muttmuure @thesahindia this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

wildan-m commented 1 year ago

Proposal

Updated

@thesahindia Add another solution by using emoji container height

melvin-bot[bot] commented 1 year ago

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

muttmuure commented 1 year ago

FWIW I honestly don't notice this at all now

wildan-m commented 1 year ago

@muttmuure try to use square emoji in the native iOS app. I can still reproduce it with the recent commit.

SCR-20230603-azp
grgia commented 1 year ago

@thesahindia do you have any thoughts on @wildan-m's updated proposal?

thesahindia commented 1 year ago

The solution will work but I don't think it's a good solution. Also we don't have a good explanation about the root cause.

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.

@wildan-m, I removed textAlignVertical and didn't see any difference on android. Can you please explain why there's a major difference in the alignment only at ios? Also instead of using lineHeight can we use some other styles to keep it in the center?

wildan-m commented 1 year ago

@thesahindia great question, I agree the root cause might not be related to textAlignVertical. I don't have the answer yet.

instead of using lineHeight can we use some other styles to keep it in the center?

Actually, we also use alignItems: 'center' on the container to vertically center the text, but it also works for non-iOS platforms.

I'll let you know when I've found a better explanation for the root cause.

melvin-bot[bot] commented 1 year ago

@grgia @muttmuure @thesahindia this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

Thanks!

melvin-bot[bot] commented 1 year ago

Current assignee @thesahindia is eligible for the Internal assigner, not assigning anyone new.

grgia commented 1 year ago

@thesahindia based on the current proposals, is there one we should move forward with or shall I take this internal myself?

thesahindia commented 1 year ago

is there one we should move forward with or shall I take this internal myself?

No don't have an acceptable proposal yet so yes you can take this.

muttmuure commented 1 year ago

@grgia I think you should go for it with this one.

grgia commented 1 year ago

Taking internal

grgia commented 1 year ago

Will try to knock this one out by next week

muttmuure commented 1 year ago

Did you get chance to work on this yet @grgia?

grgia commented 1 year ago

Bumping to daily to knock out this week

Vishrut19 commented 1 year ago

Is this issue still Open? Because if no one is working I can submit a proposal and start working (if assigned) asap.

grgia commented 1 year ago

@Vishrut19 @thesahindia I'm fairly swamped right now, I'm open to taking more proposals

melvin-bot[bot] commented 1 year ago

@grgia, @muttmuure, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

grgia commented 1 year ago

I've hit my hours for this week, so I'm going to prioritize getting a PR up for this one on Monday.

melvin-bot[bot] commented 1 year ago

@grgia, @muttmuure, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

grgia commented 1 year ago

working on this

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.44-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-08-01. :confetti_ball:

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.

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

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

melvin-bot[bot] commented 1 year ago

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:

wildan-m commented 1 year ago

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?

https://github.com/Expensify/App/assets/11847279/ee80da3d-23e0-4d19-8e99-4b4c4ec9d00b

grgia commented 1 year ago

Not overdue, Bump on BZ checklist @thesahindia

thesahindia commented 1 year ago

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