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

fix the issue that inconsistent highlighting occurs when multiple mentions are used without spaces #594

Merged
merged 10 commits into from
Nov 19, 2023

Conversation

agilejune
Copy link
Contributor

@agilejune agilejune commented Oct 31, 2023

Fixed Issues

$ Expensify/App#21753
Proposal: Expensify/App#21753 (comment)

Tests

  1. Go to any chat.
  2. Type the following cases
  1. Observe that all the mentions are highlighted as expected.

QA

Same as tests step

Offline tests

Same as tests step

Screenshots/Videos

Web

image

Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@agilejune agilejune requested a review from a team as a code owner October 31, 2023 04:50
@github-actions
Copy link

github-actions bot commented Oct 31, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@melvin-bot melvin-bot bot requested review from amyevans and removed request for a team October 31, 2023 04:50
@agilejune
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@amyevans
Copy link
Contributor

@aimane-chnaif can you comment here so I can assign you for review please?

@amyevans amyevans removed their request for review October 31, 2023 16:55
@aimane-chnaif
Copy link
Contributor

reviewing

@@ -1298,6 +1298,36 @@ test('Test for @here mention without space or supported styling character', () =
expect(parser.replace(testString)).toBe(resultString);
});

test('Test user mention and here mention, which are concatenated without space', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use general emails, not mine 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's updated with general ones

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update Step 2 in Tests as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done as well

@aimane-chnaif
Copy link
Contributor

@agilejune

Screenshot 2023-11-05 at 10 49 33 AM

@agilejune
Copy link
Contributor Author

@aimane-chnaif good catch of edge case
I will fix to cover all those cases

@agilejune
Copy link
Contributor Author

image

@agilejune
Copy link
Contributor Author

agilejune commented Nov 7, 2023

@aimane-chnaif I fixed and added auto test cases, please check again

@puneetlath
Copy link
Contributor

@agilejune looks like you have some failing tests.

@aimane-chnaif
Copy link
Contributor

@agilejune please merge main and fix javascript test failing

@agilejune
Copy link
Contributor Author

@puneetlath @aimane-chnaif
all done

Copy link
Contributor

@aimane-chnaif aimane-chnaif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What code change you done to fix js lint?

@@ -202,7 +208,7 @@ export default class ExpensiMark {
return this.modifyTextForQuote(regex, textToProcess, replacement);
},
replacement: (g1) => {
const replacedText = this.replace(g1, {filterRules: ['heading1'], shouldEscapeText: false});
const replacedText = this.replace(g1, { filterRules: ['heading1'], shouldEscapeText: false });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all irrelevant changes like this. Keep original code formatting

Copy link
Contributor Author

@agilejune agilejune Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, mistake of auto formatting
all restored
@aimane-chnaif

lib/str.js Outdated
@@ -944,7 +944,8 @@ const Str = {
*/
isValidMention(mention) {
// Mentions can start @ proceeded by a space, eg "ping @[email protected]"
if (/[\s@]/g.test(mention.charAt(0))) {
// or by a @here, eg "@here@[email protected]"
if (/[\s@]/g.test(mention.charAt(0)) || /^@here.*/g.test(mention)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change needed? I don't see issue without adding this condition

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this fixes something, add more test case affected by this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aimane-chnaif you're right. it's needless
I removed it

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Nov 15, 2023

Not sure this should be fixed here. I think it's expected.

Screenshot 2023-11-15 at 10 42 35 AM

@aimane-chnaif
Copy link
Contributor

Screenshots/Videos

Android: Native android
Android: mWeb Chrome mchrome
iOS: Native

ios

iOS: mWeb Safari

msafari

MacOS: Chrome / Safari web
MacOS: Desktop desktop

@aimane-chnaif
Copy link
Contributor

@puneetlath Is this known bug? style broken on iOS native

ios

Copy link
Contributor

@aimane-chnaif aimane-chnaif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉
@puneetlath all yours

puneetlath
puneetlath previously approved these changes Nov 17, 2023
@puneetlath
Copy link
Contributor

Sorry for the delay. Code looks good to me, but tests are failing.

@agilejune
Copy link
Contributor Author

@puneetlath It's fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants