-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Repair Editing a comment containing both RTL and LTR characters breaks the (edited) text #9834
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
style={EmojiUtils.containsOnlyEmojis(props.fragment.text) ? styles.onlyEmojisText : undefined} | ||
> | ||
{Str.htmlDecode(props.fragment.text)} | ||
<View style={[styles.flexRow, styles.alignItemsBaseline]}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karim-30 unfortunately, justifyContent: baseline
doesn't work well for a multiline message
Paste this message and edit it - "pen app on webPost(if not) some code block message with long lines so that it overflows.Try to move two finger (scroll) not precisely horizontally but at some other angle eg. 45Expected Result:
We have to precisely scroll to left or right or else the page will also scroll vertically."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated, here how it looks like :
web :
web2.mov
mweb :
mweb2.mov
android :
android2.mov
ios :
Ios2.mov
desktop :
Desktop2.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karim-30 code keeps changing, so it isn't necessary to add updated screenshots :)
@Karim-30 after you address @rushatgabhane concern I would be happy to review the code |
@@ -106,9 +106,9 @@ const ReportActionItemFragment = (props) => { | |||
) : ( | |||
<Text | |||
selectable={!canUseTouchScreen() || !props.isSmallScreenWidth} | |||
style={EmojiUtils.containsOnlyEmojis(props.fragment.text) ? styles.onlyEmojisText : undefined} | |||
style={[EmojiUtils.containsOnlyEmojis(props.fragment.text) ? styles.onlyEmojisText : undefined, {writingDirection: 'ltr'}]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karim-30 any context on where this came from? Link to some docs/stackoverflow would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P.S. inline styles are forbidden https://github.com/Expensify/App/blob/main/contributingGuides/STYLING.md#inline-styles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writingDirection: 'ltr'
fixes the issue on web, desktop, and IOS but not on android. docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved inline styles issue.
> | ||
{Str.htmlDecode(props.fragment.text)} | ||
{`\u2066${Str.htmlDecode(props.fragment.text)}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\u2066${Str.htmlDecode(props.fragment.text)}
fixes the issue on Android. docs
I know these changes are different from what I proposed earlier, So if you find these not fit enough or prefer looking for other proposals no problem at all I can decline the Upwork offer from my side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karim-30 Thank you!
I know these changes are different from what I proposed earlier, So if you find these not fit enough or prefer looking for other proposals no problem at all I can decline the Upwork offer from my side
no no, that's alright. We just want to get to the best possible solution. It doesn't matter if it's different from original proposal
selectable={!canUseTouchScreen() || !props.isSmallScreenWidth} | ||
style={[EmojiUtils.containsOnlyEmojis(props.fragment.text) ? styles.onlyEmojisText : undefined, styles.ltr]} | ||
> | ||
{`\u2066${Str.htmlDecode(props.fragment.text)}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karim-30 can we also move this to a function? It should prepend \u2066
to a string
Make sure to write jsdoc for it too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
*/ | ||
export default { | ||
rtl: { | ||
writingDirection: 'ltr', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This are both the same, not sure what the value of that is, of if this is a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@rushatgabhane it seems you concerns have been met, are you happy with the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sketchydroide yep, looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Karim-30 noticed a few comment issues
@@ -0,0 +1,14 @@ | |||
/** | |||
* Writing direction utility styles. | |||
* note: writingDirection not available for Android, for Android you can use the Unicode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* note: writingDirection not available for Android, for Android you can use the Unicode. | |
* Note: writingDirection isn't supported on Android. Unicode controls are being used for Android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
/** | ||
* Writing direction utility styles. | ||
* note: writingDirection not available for Android, for Android you can use the Unicode. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra line
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/styles/StyleUtils.js
Outdated
@@ -448,6 +448,15 @@ function getPaddingLeft(paddingLeft) { | |||
}; | |||
} | |||
|
|||
/** | |||
* Convert RTL text to a LTR text on Android devices useing the Unicode controls, see : https://www.w3.org/International/questions/qa-bidi-unicode-controls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Convert RTL text to a LTR text on Android devices useing the Unicode controls, see : https://www.w3.org/International/questions/qa-bidi-unicode-controls | |
* Android only - convert RTL text to LTR text using Unicode controls. | |
* https://www.w3.org/International/questions/qa-bidi-unicode-controls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @sketchydroide in version: 1.1.86-0 🚀
|
Causing regression here: #10086 Why did we replaces And on another note, is the new text for the edited comment supposed to go on the right side? |
@ctkochan22 I'm so sorry for this mistake, the reason is when I started this PR 15 days ago there was only App/src/pages/home/report/ReportActionItemFragment.js Lines 90 to 121 in 0fcc492
one week later the PR fixes the empty lines bug https://github.com/Expensify/App/pull/9195/files which replace |
🚀 Deployed to production by @yuwenmemon in version: 1.1.86-5 🚀
|
@Karim-30 The linked Pr has been incorrectly linked, please make sure there is the dollar sign always included before the link like so:
Thank you! |
Details
Fixed Issues
$ #9709
Tests
(edited)
text appears at the end of the line not between words.PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
(edited)
text appears at the end of the line not between words.Screenshots
Web
web2.mov
Mobile Web
mweb2.mov
Desktop
Desktop2.mov
iOS
Ios2.mov
Android
Desktop2.mov