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

[$250] Web - Emoji- Black box for flag emoji are difficult to cancel with backspace key #51336

Open
1 of 8 tasks
lanitochka17 opened this issue Oct 23, 2024 · 43 comments
Open
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 23, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.0.55-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to http://www.staging.new.expensify.com/
  2. Navigate to a conversation
  3. Open the emoji picker
  4. Scroll down the list to the bottom( to flag emoji)

Expected Result:

Any emojis can be erased by backspace key

Actual Result:

Black box flag emojis are difficult to cancel with backspace key (removed from composed box after taping backspace 7 times)

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6643336_1729695740979.bandicam_2024-10-23_17-57-18-262.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021852238123831178456
  • Upwork Job ID: 1852238123831178456
  • Last Price Increase: 2024-11-15
  • Automatic offers:
    • c3024 | Contributor | 104988248
Issue OwnerCurrent Issue Owner: @eVoloshchak
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

Triggered auto assignment to @muttmuure (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.

@lanitochka17 lanitochka17 removed their assignment Oct 23, 2024
@lanitochka17
Copy link
Author

@muttmuure FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@c3024
Copy link
Contributor

c3024 commented Oct 25, 2024

@lanitochka17

This does not have a BZ assigned. Can you remove and re-add the Bug label?

@lanitochka17 lanitochka17 added Bug Something is broken. Auto assigns a BugZero manager. and removed Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 25, 2024
Copy link

melvin-bot bot commented Oct 25, 2024

Triggered auto assignment to @Christinadobrzyn (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.

@melvin-bot melvin-bot bot added the Daily KSv2 label Oct 25, 2024
@lanitochka17
Copy link
Author

@c3024 Done

@c3024
Copy link
Contributor

c3024 commented Oct 25, 2024

Proposal

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

Flag emojis are not completely deleted with backspace key

What is the root cause of that problem?

Some flags are composed of multiple unicode points.

For example, Wales flag has
• U E0067 (TAG LATIN SMALL LETTER G)
• U E0062 (TAG LATIN SMALL LETTER B)
• U E0077 (TAG LATIN SMALL LETTER W)
• U E006C (TAG LATIN SMALL LETTER L)
• U E0073 (TAG LATIN SMALL LETTER S)
• U E007F (CANCEL TAG)

When we click on backspace key, the last unicode code point is removed which is the CANCEL TAG here. Once this last code point is removed, the sequence becomes an incomplete sequence and the fallback black flag appears.

Further backspace key presses remove the unicode points one by one. Until the first tag is removed, the sequence stays as an incomplete sequence and it appears that the black flag could be deleted only after pressing backspace several times.

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

Different flags have different number of unicode code points.

So, we should use the grapheme-spiltter library to identify the graphemes and remove a grapheme on a backspace press.

We will add a new module grapheme-splitter in package.json and import GraphemeSplitter in ComposerWithSuggestions and update the triggerHotkeyActions (name might need to be changed to accurately reflect the new behaviour) to something like this:

const triggerHotkeyActions = useCallback(
        (event: NativeSyntheticEvent<TextInputKeyPressEventData>) => {
            const webEvent = event as unknown as KeyboardEvent;
            if (webEvent.key === 'Backspace') {
               if (selection.start === 0) {
                    return;
                }
                if (selection.start !== selection.end) {
                    return;
                }
                const graphemes = splitter.splitGraphemes(lastTextRef.current.substring(0, selection.start));
                const lastGrapheme = graphemes[graphemes.length - 1];
               if (lastGrapheme.length > 1) {
                     event.preventDefault();
                    const newText = lastTextRef.current.slice(0, selection.start - lastGrapheme.length)   lastTextRef.current.slice(selection.start);
                    setSelection((prevSelection) => ({
                        start: selection.start - lastGrapheme.length,
                        end: selection.start - lastGrapheme.length,
                        positionX: prevSelection.positionX,
                        positionY: prevSelection.positionY,
                    }));
                    updateComment(newText, true);
                }
            }

What alternative solutions did you explore? (Optional)

@Christinadobrzyn
Copy link
Contributor

gonna investigate this tomorrow when I'm back from ooo

@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Oct 29, 2024

I don't see this happening on the version v9.0.54-11 (staging) or v9.0.53-1 (prod). I'll see if we can get QA to restest on the latest version. https://expensify.slack.com/archives/C9YU7BX5M/p1730175293093429

@Christinadobrzyn Christinadobrzyn added the Needs Reproduction Reproducible steps needed label Oct 29, 2024
@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@izarutskaya
Copy link

Still reproducible on latest build v9.0.55-2

bandicam.2024-10-29.14-23-06-918.mp4

@Christinadobrzyn
Copy link
Contributor

I'm not sure how to test that version, I don't have that version. I'm asking Tom for some guidance on how to test this

@Christinadobrzyn
Copy link
Contributor

Asking @izarutskaya for some guidance on how to test this bug in the version they see it in - https://expensify.slack.com/archives/C9YU7BX5M/p1730357190129519?thread_ts=1730175293.093429&cid=C9YU7BX5M

@Christinadobrzyn Christinadobrzyn added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Nov 1, 2024
@melvin-bot melvin-bot bot changed the title Web - Emoji- Black box for flag emoji are difficult to cancel with backspace key [$250] Web - Emoji- Black box for flag emoji are difficult to cancel with backspace key Nov 1, 2024
Copy link

melvin-bot bot commented Nov 1, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 1, 2024
@melvin-bot melvin-bot bot removed the Overdue label Nov 10, 2024
@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 11, 2024
@Anaslancer
Copy link
Contributor

@eVoloshchak I used regexp, it will contain all additional flags.
// England
Base component: 🏴 (U 1F3F4) – A black flag.
Tag characters:
(U E0067) – Tag Latin Small Letter G.
(U E0062) – Tag Latin Small Letter B.
(U E0065) – Tag Latin Small Letter E.
(U E006E) – Tag Latin Small Letter N.
(U E0067) – Tag Latin Small Letter G.
(U E007F) – Cancel Tag (to close the sequence).

// Scotland
Base component: 🏴 (U 1F3F4) – A black flag.
Tag characters:
(U E0067) – Tag Latin Small Letter G.
(U E0062) – Tag Latin Small Letter B.
(U E0073) – Tag Latin Small Letter S.
(U E0063) – Tag Latin Small Letter C.
(U E0074) – Tag Latin Small Letter T.
(U E007F) – Cancel Tag (to close the sequence).

// Wales
Base component: 🏴 (U 1F3F4) – A black flag.
Tag characters:
(U E0067) – Tag Latin Small Letter G.
(U E0062) – Tag Latin Small Letter B.
(U E0077) – Tag Latin Small Letter W.
(U E0061) – Tag Latin Small Letter A.
(U E006C) – Tag Latin Small Letter L.
(U E0065) – Tag Latin Small Letter E.
(U E0073) – Tag Latin Small Letter S.
(U E007F) – Cancel Tag (to close the sequence).

@Anaslancer
Copy link
Contributor

And if you can't repro this error, perhaps the system can process deleting by one backspace. I tested it on web

@Anaslancer
Copy link
Contributor

I can repro this error on Android 13 emulator. @eVoloshchak What is your Android version?

Copy link

melvin-bot bot commented Nov 14, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 14, 2024
@Christinadobrzyn
Copy link
Contributor

Hey @Anaslancer we don't have android as one of the affected platforms in the original post - can you tell me what platform version you've reproduced the issues on the Android 13?

@Anaslancer
Copy link
Contributor

@Christinadobrzyn I can reproduce this on the windows chrome browser too.

15.11.2024_06.38.33_REC.mp4

cc @eVoloshchak

Copy link

melvin-bot bot commented Nov 15, 2024

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

@eVoloshchak
Copy link
Contributor

Screen.Recording.2024-11-17.at.21.01.26.mov

This isn't a problem with our App, the same behavior can be observed on every other website.
Ideally, we'd open an issue for Chrome/JVM itself, but this problem has existed for 5 years already, and I couldn't find any attempts to fix the root cause, so I think a workaround is acceptable in this case.
This was already resolved for a different project at element-hq/element-web#22196

@c3024's proposal looks good to me. We have to make sure this doesn't affect performance negatively and make sure to test this in many browsers and on windows

🎀👀🎀 C reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Nov 17, 2024
Copy link

melvin-bot bot commented Nov 17, 2024

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

Copy link

melvin-bot bot commented Nov 20, 2024

@eVoloshchak @Gonals @Christinadobrzyn this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

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

melvin-bot bot commented Nov 20, 2024

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

Offer link
Upwork job
Please accept the offer 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 📖

@Christinadobrzyn
Copy link
Contributor

Looks like the PR is under review - #52995

@c3024
Copy link
Contributor

c3024 commented Dec 5, 2024

@eVoloshchak , please check this PR #52995. Thanks!

@Christinadobrzyn
Copy link
Contributor

monitoring PR #52995

@Christinadobrzyn
Copy link
Contributor

monitoring #52995

@c3024
Copy link
Contributor

c3024 commented Dec 18, 2024

@eVoloshchak , gentle bump for the PR review!

@c3024
Copy link
Contributor

c3024 commented Dec 23, 2024

@eVoloshchak 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

9 participants