Closed puneetlath closed 1 year ago
Current assignee @puneetlath is eligible for the NewFeature assigner, not assigning anyone new.
Hi šš¼ I'm from Software Mansion and I'll handle this task
š£ @RobertKozik! š£
Hey, it seems we donāt have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Ok great @robertKozik. I have assigned you to the issue and shared the design doc with you. Please feel free to hit me up here or in slack if you have any questions!
@robertKozik if you want to test this, the easiest way will be to:
App/node_modules/expensify-common/lib/ExpensiMark.js
. That will make it so that when you type @here
or @user@domain.com
it gets the <mention-here>
or <mention-user>
html tags added. Thats way more convenient than what I used to do (patching the ReportActionItemFragment
to replace all occurances). Thanks!
Hey Hey, two follow up questions:
Before EC3
version? <mention-user>@user@mail</mention-user>
Is it intended and the login handle is only provided inside the body of the HTML tag, or It's just due to that I've only applied changes inside ExpensiMark
?Great questions.
Thanks for answers, today I should create the PR with it.
Awesome!
Hi! Sadly I didn't finish it :/ I've encountered two problems:
When I've patched the ExpensiMark
file, on Safari
browser app is not loading for me and gets following error. Looks like safari can't handle new regex, but I'm not sure about it.
Android native app can't render mention when it's wrapped in Pressable component. Only after refreshing the code, mentions are appearing
I'll investigate it further @puneetlath
Hmm, interesting. It looks like our custom renderer for Anchor tags also returns a component wrapped in a Pressable.
When I've patched theĀ ExpensiMarkĀ file, onĀ SafariĀ browser app is not loading for me and gets following error. Looks like safari can't handle new regex, but I'm not sure about it.
Hi @robertKozik It seems like negative look behind regex group is not supported on safari browser yet, i will investigate and update the PR with the necessary changes.
@robertKozik I just wanted to check in and see how this is going.
Sorry, I was OOO most of the time. I've checked the android issue on the physical device and now it work as it should be, maybe that was a problem with my simulator. I'll check today one more just to be sure, and tomorrow PR will be ready to review, hopefully alongside the @here
mention renderer as it is very similar
Awesome!
I've pushed PR to review. Problems with android were indeed corelated with usage of Pressable
component. The Anchor renderer uses the PressableWithSecondaryInteraction
with inline prop ā it determines usage of Text
rather than Pressable
, as it causes problem with positioning of rendered fragment.
I've used newest implementation of ExpensiMark changes, it works on every browser, although now it cannot recognise properly when mention handle has the .
before the at sign @
. F.E. my mail: @robert.kozik@swmansion.com
renders as mail rather than mention. Is it intended?
CC. @puneetlath @getusha
Nice! Reviewing asap.
Yes, it is intended that only certain characters are allowed directly before the @
sign in a mention and .
is not one of them.
@puneetlath it looks like for native apps both additional padding and radius cannot be applied. The problem occurs because we are trying to style nested Text component.
I've created a snack to show it: https://snack.expo.dev/@rooobi/nested-text
More source about this behaviour from the react-native-render-html
side:
padding and border are ignored in nested text elements. https://meliorence.github.io/react-native-render-html/blog/2021/06/29/create-blog-app-rnrh-III#frustrating-react-native-text-limitations
As it looks like we cannot properly style on native side of the things, should we remove the borderRadius and additional padding from the web also?
Just merged.
Great! I'll follow up with the here mention renderer soon
As the PR needs to be reverted due to android problems, what is the correct way to go with this? Do we pivot to the non-rounded mentions for now?
Ok I reverted the PR. This issue is the problem.
I'm going to chat internally and see what the best path forward is here.
That catch me off guard š¢ I could have sworn that It was working for me while testing...
Let me know if you will know what next, with the work we do already here reverting to the more simple colouring will be an ease and would take no time
@puneetlath Please assign this issue to me as C+.
I think we can just use no border-radius and padding solution for now. When the inline-code block PR is fixed, we can swap that.
That catch me off guard š¢ I could have sworn that It was working for me while testing...
Let me know if you will know what next, with the work we do already here reverting to the more simple colouring will be an ease and would take no time
Is there any alternative of using InlineCodeBlock
? it's the only issue right now. the issue is unpredictable it works sometimes but won't work suddenly, but most of the time it's not working.
Ok @robertKozik @parasharrajat I chatted internally and let's go back to using styled text so it will look good on most devices and just accept that it will be ugly on Android in some scenarios.
So back to what you had originally that had this problem:
And then when https://github.com/Expensify/react-native/pull/43 is merged, the issue should resolve itself.
Sorry for all the flip-flopping!
Alright, It will hopefully need only reverting commits, so I'll do it right away, create new PR and test it
And then when https://github.com/Expensify/react-native/pull/43 is merged, the issue should resolve itself.
Not quite itself, as it will introduce new prop for such styling. But follow-up pr would need only to move style to another prop.
Sounds great and that makes sense. Thanks @robertKozik
Created draft PR for that, just want to check it on all platforms and I'll change it to ready
cc. @parasharrajat
I will check this tomorrow daytime. Night..Night...
PR is not yet ready for review.
Sorry, forgot to change it š
Merged again!
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.12-0 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-05-16. :confetti_ball:
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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
@parasharrajat just sent you a contract offer: https://www.upwork.com/nx/wm/pre-hire/c/8577561/offer/24575855
All paid. Thanks everyone!
As part of the mentions project, we will be adding a custom renderer called MentionUserRenderer for the tag. The custom renderer will be similar to the AnchorRenderer.
The details of the implementation are described in the doc here.