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-11-09] [$500] Chat - Compose box - Wrong cursor position for RTL texts and inverted arrow keys functionality #28149

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 25, 2023 · 50 comments
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

@izarutskaya
Copy link

izarutskaya commented Sep 25, 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:

  1. Open any chat and paste an RTL text, for example " مثال "
  2. Continue typing some content and observe the position of the cursor
  3. Use the keyboard arrow keys to traverse through the words

Expected Result:

The cursor should be at the right side and the arrow key functionality should not be inversed

Actual Result:

Arrow key functionality becomes inversed and the cursor stays at the beginning of the words but the typing starts from the right.

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: v1.3.74-0

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

2023-09-20.15.54.49.1.mp4
Recording.1623.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Nathan-Mulugeta

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0144577636f8a78e75
  • Upwork Job ID: 1706316639252033536
  • Last Price Increase: 2023-10-09
  • Automatic offers:
    • Nathan-Mulugeta | Reporter | 27126818
Issue OwnerCurrent Issue Owner: @abekkala
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title Chat - Compose box - Wrong cursor position for RTL texts and inverted arrow keys functionality [$500] Chat - Compose box - Wrong cursor position for RTL texts and inverted arrow keys functionality Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

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

melvin-bot bot commented Sep 25, 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@HardikChoudhary24
Copy link
Contributor

HardikChoudhary24 commented Sep 25, 2023

Proposal

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

  • Wrong cursor position for RTL texts and inverted arrow keys functionality

What is the root cause of that problem?

  • The root cause of this issue lies within the convertToLTR function (that converts RTL text to a LTR text using Unicode controls) and ComposerWithSuggestions Component, which is primarily responsible for rendering the input value. The problem arises due to const convertToLTR: ConvertToLTR = (text) => text; which does not converts the RTL text to LTR text.

const convertToLTR: ConvertToLTR = (text) => text;

  • Also in the ComposerWithSuggestions Component the value prop passed to Composer component is not converted to LTR text.

<Composer
checkComposerVisibility={checkComposerVisibility}
autoFocus={shouldAutoFocus}
multiline
ref={setTextInputRef}
textAlignVertical="top"
placeholder={inputPlaceholder}
placeholderTextColor={themeColors.placeholderText}
onChangeText={(commentValue) => updateComment(commentValue, true)}
onKeyPress={triggerHotkeyActions}
style={[styles.textInputCompose, isComposerFullSize ? styles.textInputFullCompose : styles.flex4]}
maxLines={maxComposerLines}
onFocus={onFocus}
onBlur={onBlur}
onClick={setShouldBlockSuggestionCalcToFalse}
onPasteFile={displayFileInModal}
shouldClear={textInputShouldClear}
onClear={() => setTextInputShouldClear(false)}
isDisabled={isBlockedFromConcierge || disabled}
isReportActionCompose
selection={selection}
onSelectionChange={onSelectionChange}
isFullComposerAvailable={isFullComposerAvailable}
setIsFullComposerAvailable={setIsFullComposerAvailable}
isComposerFullSize={isComposerFullSize}
value={value}
numberOfLines={numberOfLines}
onNumberOfLinesChange={updateNumberOfLines}
shouldCalculateCaretPosition
onLayout={(e) => {
const composerLayoutHeight = e.nativeEvent.layout.height;
if (composerHeight === composerLayoutHeight) {
return;
}
setComposerHeight(composerLayoutHeight);
}}
onScroll={hideSuggestionMenu}
/>

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

  • To address this problem, we can resolve it by simply changing the convertToLTR function .
import CONST from '../../CONST';
import ConvertToLTR from './types';

const convertToLTR: ConvertToLTR = (text) => `${CONST.UNICODE.LTR}${text}`;

export default convertToLTR;
  • And then converting the value prop passed to the Composer Component to LTR
value={convertToLTR(value)}

What alternative solutions did you explore? (Optional)
N/A

@burczu
Copy link
Contributor

burczu commented Sep 26, 2023

@HardikChoudhary24 I'm not sure if your proposal solves the issue correctly - I've tried and it shows the RTL text immediately at left. I guess it should show up at right at first and behave as RTL text until we start typing LTR letters - then it should be converted to LTR. Am I right @izarutskaya?

@trjExpensify
Copy link
Contributor

Assigned second, I'm dropping off @abekkala.

@trjExpensify trjExpensify removed their assignment Sep 26, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@abekkala
Copy link
Contributor

not overdue melvin!

@burczu looks like we have an updated proposal!

@melvin-bot melvin-bot bot removed the Overdue label Sep 29, 2023
@burczu
Copy link
Contributor

burczu commented Sep 29, 2023

@HardikChoudhary24 Instead of adding another proposal, please update the original one - more about it here.

@burczu
Copy link
Contributor

burczu commented Sep 29, 2023

@abekkala Regarding my comment: #28149 (comment) I'm not sure if I understand correctly how it should work. Can we clarify it?

@HardikChoudhary24
Copy link
Contributor

Proposal

[Updated] (#28149 (comment))

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@burczu
Copy link
Contributor

burczu commented Oct 2, 2023

Not overdue - clarification is need how exactly this should work.

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@HardikChoudhary24
Copy link
Contributor

@burczu I think that my first approach can be used to fix this issue because most of the other apps like Rocket chat, Linkedin, Chatgpt and even messaging of upwork implements this like my first approach where the RTL text appears immediately on left. And also in the expected result of this issue, its given that the cursor should be on the right.

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@burczu
Copy link
Contributor

burczu commented Oct 4, 2023

@HardikChoudhary24 I've checked how it's done on Slack, and it differs from your first approach

Slack:

Screen.Recording.2023-10-04.at.09.47.59.mov

new.expensify.com:

Screen.Recording.2023-10-04.at.09.52.41.mov

Your first solution:

Screen.Recording.2023-10-04.at.09.48.25.mov

So... The only difference I see between Slack and the current new.expensify.com is that in Slack the RTL text appears on the left, and in Expensify it appears on the right - no differences in behaviour when you start typing or using arrow keys.

What do you think?

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 31, 2023
Copy link

melvin-bot bot commented Oct 31, 2023

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

Copy link

melvin-bot bot commented Oct 31, 2023

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

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:

Copy link

melvin-bot bot commented Oct 31, 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:

  • [@burczu] The PR that introduced the bug has been identified. Link to the PR:
  • [@burczu] 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:
  • [@burczu] 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:
  • [@burczu] Determine if we should create a regression test for this bug.
  • [@burczu] 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.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Nov 2, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-11-07] [$500] Chat - Compose box - Wrong cursor position for RTL texts and inverted arrow keys functionality [HOLD for payment 2023-11-09] [HOLD for payment 2023-11-07] [$500] Chat - Compose box - Wrong cursor position for RTL texts and inverted arrow keys functionality Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-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-11-09. 🎊

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:

Copy link

melvin-bot bot commented Nov 2, 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:

  • [@burczu] The PR that introduced the bug has been identified. Link to the PR:
  • [@burczu] 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:
  • [@burczu] 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:
  • [@burczu] Determine if we should create a regression test for this bug.
  • [@burczu] 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.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abekkala abekkala changed the title [HOLD for payment 2023-11-09] [HOLD for payment 2023-11-07] [$500] Chat - Compose box - Wrong cursor position for RTL texts and inverted arrow keys functionality [HOLD for payment 2023-11-09] [$500] Chat - Compose box - Wrong cursor position for RTL texts and inverted arrow keys functionality Nov 3, 2023
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 7, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 9, 2023
@neil-marcellini
Copy link
Contributor

@neil-marcellini can you confirm the linked PR caused the regression?

Sorry for the delay, yes it did.

@melvin-bot melvin-bot bot removed the Overdue label Nov 9, 2023
@HardikChoudhary24
Copy link
Contributor

@neil-marcellini @abekkala

Regarding my pull request, I am aware that it initially caused an unexpected issue after merging and I did my best to address this issue within few hours. I also took the initiative to write tests, even though it was not initially mentioned as a requirement and raised the PR with the fix. However, due to the timing of events, the fix was not merged immediately as it was a weekend which led to the PR being deployed in staging environment and thus making this issue a deploy blocker, as it was beyond my control. I understand the project's policy regarding regressions and penalties. I believe that I took the necessary steps to rectify the issue as soon as it was identified.

I kindly request your consideration on above points during the payment assessment. Thank you.

@melvin-bot melvin-bot bot added the Overdue label Nov 13, 2023
Copy link

melvin-bot bot commented Nov 13, 2023

@burczu, @abekkala, @neil-marcellini, @HardikChoudhary24 Whoops! This issue is 2 days overdue. Let's get this updated quick!

1 similar comment
Copy link

melvin-bot bot commented Nov 13, 2023

@burczu, @abekkala, @neil-marcellini, @HardikChoudhary24 Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Nov 13, 2023

@burczu, @abekkala, @neil-marcellini, @HardikChoudhary24 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@abekkala
Copy link
Contributor

@burczu can you complete the checklist please

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2023
@abekkala
Copy link
Contributor

@HardikChoudhary24 it was announced on Oct 24th in the expensify-open-source Slack channel that there will no longer be the 50% urgency bonus payouts

@abekkala
Copy link
Contributor

@HardikChoudhary24 offer sent

@Nathan-Mulugeta requires payment sent and contract ended - thank you! 🎉

@HardikChoudhary24
Copy link
Contributor

@abekkala Yes I am aware of that, but this bug was raised before that announcement and it was mentioned that bugs prior to that announcement will be treated normally.

Screenshot 2023-11-13 at 9 43 33 PM

@situchan
Copy link
Contributor

I maybe eligible for compensation for reporting regression and reviewing PR that fixed it

@abekkala
Copy link
Contributor

@situchan I'll send an Upwork offer today

@abekkala
Copy link
Contributor

abekkala commented Nov 14, 2023

@situchan payment sent and contract ended - thank you! 🎉

closing

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

7 participants