-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Handle emoji tooltip #35838
Handle emoji tooltip #35838
Conversation
@fedirjh My Android and IOS simulator don't work now. Please help me to test on these platforms. |
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.
Please help me to test on these platforms.
@dukenv0307 Sure.
!_.isUndefined(props.draftMessage) | ||
? null | ||
: props.action.pendingAction || | ||
(props.action.isOptimisticAction ? CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD : '') || | ||
lodashGet(props, 'iouReport.pendingFields.preview') |
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.
why this change?
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.
Missed restoring some changes to test locally.
We can completely test now. |
@dukenv0307 Could you please merge main ? Thank you |
@fedirjh I updated. |
@dukenv0307 Was the
This is already live as per this comment https://expensify.slack.com/archives/C01GTK53T8Q/p1707153064290739?thread_ts=1706851954.228519&cid=C01GTK53T8Q |
When I tested it locally, it was not. I need to hard code in |
Can you please hard code with this to test locally? |
Cool, I didn't realize this when creating the PR. |
We have to bump |
@fedirjh Bumped the expensify-common version. |
@fedirjh Thanks for your great solution, I updated this and tested. |
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.
Looks good. Found a little bug with offline feedback style. Left a simpler solution to address it.
const htmlContent = styleAsDeleted ? `<del>${html}</del>` : html; | ||
const htmlWithDeletedTag = styleAsDeleted ? `<del>${html}</del>` : html; | ||
|
||
const containsOnlyEmojis = EmojiUtils.containsOnlyEmojis(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.
@dukenv0307 I got a little bug with offline feedback (deleted action); when a comment that only contains emojis is deleted in offline mode, the style is not applied correctly :
current | expected |
---|---|
![]() |
![]() |
I think the simplest solution in this case is to use the text source of the comment when it's pending deletion, it will fix the style issue, but it will not render the tooltip. I think that's fine since this comment will be deleted anyway. cc @stitesExpensify what do you think?
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.
@dukenv0307 Have you got a chance to look at this one? I think this is a blocker for this 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.
The changes that should fix this one are suggested here #35838 (comment)
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.
I saw that and I'm waiting @stitesExpensify for confirming this.
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.
I think that we can ignore this for now. I am creating a new issue to prevent markdown from affecting emojis as a whole, so this will be fixed in the future in a different way
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.
@fedirjh Updated this case.
const htmlContent = styleAsDeleted ? `<del>${html}</del>` : html; | ||
const htmlWithDeletedTag = styleAsDeleted ? `<del>${html}</del>` : html; | ||
|
||
const containsOnlyEmojis = EmojiUtils.containsOnlyEmojis(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.
We should move this to the top to avoid code duplication
@@ -52,7 +52,10 @@ function TextCommentFragment({fragment, styleAsDeleted, source, style, displayAs | |||
// Only render HTML if we have html in the fragment | |||
if (!differByLineBreaksOnly) { |
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.
if (!differByLineBreaksOnly) { | |
if (!differByLineBreaksOnly && !(containsOnlyEmojis && styleAsDeleted)) { |
This change should fix the offline style , we just need to move containsOnlyEmojis
to the top.
Bug: Large Emoji is cut off at the top when the comment is edited CleanShot.2024-02-26.at.19.20.44.mp4 |
@dukenv0307 To address the last bug, I think we can explore creating a separate version of |
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.
Create a new directory shouldRenderAsText and add index.native.ts, index.ts and types.ts
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.
I updated.
const htmlContent = styleAsDeleted ? `<del>${html}</del>` : html; | ||
const htmlWithDeletedTag = styleAsDeleted ? `<del>${html}</del>` : html; | ||
|
||
const containsOnlyEmojis = EmojiUtils.containsOnlyEmojis(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.
@dukenv0307 Have you got a chance to look at this one? I think this is a blocker for this PR.
On web: bug was fixed also 🚀 CleanShot.2024-02-28.at.07.29.12.mp4 |
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.
Looks good to me and tests well, over to you @stitesExpensify
Changes look good but there are conflicts :( Just a quick package change and we should be good to go! |
@stitesExpensify I merged main and resolved the conflict. |
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.
LGTM!
🚀 Deployed to staging by https://github.com/stitesExpensify in version: 1.4.47-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.4.47-10 🚀
|
Details
Display a tooltip when hovering over emoji in report action
Fixed Issues
$ #34307
PROPOSAL: #34307 (comment)
Tests
Offline tests
Same as above
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(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Screen.Recording.2024-02-05.at.23.41.52.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2024-02-05.at.23.40.44.mov
MacOS: Chrome / Safari
Screen.Recording.2024-02-05.at.23.38.47.mov
MacOS: Desktop
Screen.Recording.2024-02-05.at.23.46.52.mov