-
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
fix: unify word breaking in ContextMenuItem for Android mweb and Android native #31116
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@artus9033 Can you confirm once this ready for review? Also I would recommend posting videos for all the platform, despite only Android being added as the problematic platforms. |
…tunities to separate functions in src/pages/home/report/ContextMenu/ContextMenuActions.js
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@mananjadhav the PR is ready for review. I also updated the screenshots section to cover all platforms. |
…c/libs/EmailUtils.ts src/pages/home/report/ContextMenu/ContextMenuActions.js
…function naming in comment
@artus9033 When I am testing this at my end, I can see the email is getting truncated. Can you please check this? |
Indeed, I am getting the same ellipsization behaviour on my side from the beginning, however I assumed this is desired behaviour since it is also present in staging and the original issue only mentioned inconsistent breaking of text as an issue, but did not say about ellipsization. Are you certain that we want to change the current behaviour @mananjadhav ? If so, I will add the appropriate changes. |
@artus9033 I checked on staging and your PR author checklist. Both have different behavior ( and not ellipses). |
@mananjadhav, as I see it, this is current behaviour since this probably depends on the DPI of device's screen / modal dialog size. If you use a longer email in such cae, you will see that it ellipsizes as well. The screenshots for desktop may be a bit confusing here, since they were taken with the window resized so they were displaying as full-width pop-ups, but if they are resized to be wider, then the pop-up shows as floating and the text should be ellipsized if the screen cannot fit the mail: |
@artus9033 I understand the screensize/DPI can have an impact, but the screencast that I shared (and sharing again here) is on the same display, browser, account, chat just two tabs. Screen.Recording.2023-12-07.at.11.55.04.AM.mov |
I see, that is true, however the cause here will be rather expectable and coming from the old behaviour. The old behaviour present in staging is that any sufficiently long text will be ellipisized and why this ellipisization happens with the fix applied is because the text is carried to a new line earlier than before ("wasting" some space in the first line) and happens to be overlong in the second line. If we are certain that this is something that we want to change, I can think of one solution - to unlock the limit of lines in that text view and disable ellipsization. Do you think we can go with this approach? |
I think it would be better to confirm with @Julesssss about this. |
I agree with @artus9033 here that this is fine -- assuming that the full email is actually pasted to the clipboard 😄 |
Great, thanks! There is one more thing I saw on @mananjadhav's recording now - that is probably out-of-scope of this issue - however when hovering an email on desktop, there is a tooltip being shown with the mail that can also be split between lines. This popup is for non-mobile devices only, however the manner in which it is split is old-behaviour alike, that is, it can happen anywhere inside words. I'm not sure if we also want to fix this with the same approach as we just did for the context menu here (since we extracted that to a separate function for such cases), or is this a case for a separate issue @Julesssss? |
Lets leave that as a separate issue 👍 |
Sure thing, then now the PR should be ready for review |
Thanks I'll have it reviewed today/tomorrow. |
@artus9033 Can you please fix the conflicts? |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-copy-email.movAndroid: mWeb Chromemweb-chrome-copy-email.moviOS: Nativeios-copy-email.moviOS: mWeb Safarimweb-safari-copy-email.movMacOS: Chrome / Safariweb-copy-email.movMacOS: Desktopdesktop-copy-email.mov |
Sure thing @mananjadhav. The recent conflicts have been resolved |
✋ 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 https://github.com/Julesssss in version: 1.4.11-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.11-25 🚀
|
return email.replace( | ||
/([.@])/g, | ||
// below: zero-width space (U+200B) character | ||
'$1', |
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.
Adding a zero-width space to email caused it issue when email is copied by user and pasted in other places, especially login page - #34437
Details
Sliding context menu used for copying email address from chat to clipboard on Android native and Android mobile web inconsistently breaks words when breaking lines in case the email width exceeds screen width.
Fixed Issues
$ #30985
PROPOSAL:
#30985 (comment)
Tests
testtesttesttesttesttesttesttesttesttest@company.company.company.company.company.com
Offline tests
Same as Tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop