Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.58k stars 2.92k forks source link

[$250] Chat - Cursor moves several characters when deleting markdowns on multiline message #50687

Open IuliiaHerets opened 1 month ago

IuliiaHerets commented 1 month ago

If you havenโ€™t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.48-0 Reproducible in staging?: Y Issue reported by: Applause Internal Team

Action Performed:

  1. Open the staging.new.expensify.com website.
  2. Open any chat.
  3. Write a multiline message with at least five line breaks and three markdowns and send it.
  4. Long tap over the sent message.
  5. Tap on "Edit Message"
  6. Delete the markdowns at the end of the message.
  7. Verify the cursor moves only one character everytime a markdown is deleted.

Expected Result:

The cursor should move only one character at the time while deleting markdowns at the end of a message.

Actual Result:

When deleting the markdowns at the end of a multiline message while editing, the cursor moves several characters at the time.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/1648cb08-1348-4926-a0a0-a03fc2650018

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021847007161571207373
  • Upwork Job ID: 1847007161571207373
  • Last Price Increase: 2024-11-21
Issue OwnerCurrent Issue Owner: @thesahindia
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @OfstadC (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

IuliiaHerets commented 1 month ago

We think that this bug might be related to #wave-collect - Release 1

IuliiaHerets commented 1 month ago

@OfstadC FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

OfstadC commented 1 month ago

I did not experience this. I also think this is kind of an odd scenario that is unlikely to occur for a user (must have 5 line breaks and 3 markdowns seems like an odd equation ) - So going to close this out

melvin-bot[bot] commented 1 month ago

Job added to Upwork: https://www.upwork.com/jobs/~021847007161571207373

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)

melvin-bot[bot] commented 1 month ago

@OfstadC, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

OfstadC commented 1 month ago

@thesahindia could you please review the available proposal by EOD? Thank you ๐Ÿ˜ƒ

thesahindia commented 1 month ago

I couldn't repro it. I tested on the latest dev version.

https://github.com/user-attachments/assets/d710a5e3-869d-429e-8668-0739574f6e95

melvin-bot[bot] commented 1 month ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

thesahindia commented 1 month ago

I still can't repro it. @OfstadC, could you please look into it?

melvin-bot[bot] commented 1 month ago

@OfstadC @thesahindia this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

thesahindia commented 1 month ago

I was able to repro it on mWeb. @shahinyan11, could you repro it on native or is it just a mWeb issue?

melvin-bot[bot] commented 3 weeks ago

@OfstadC, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

thesahindia commented 3 weeks ago

@shahinyan11, Could you retest your solution? Also could you please share the video of testing?

melvin-bot[bot] commented 3 weeks ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

thesahindia commented 3 weeks ago

I need to test some cases; I'll handle it on Monday since it's the weekend.

melvin-bot[bot] commented 3 weeks ago

@OfstadC, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

OfstadC commented 3 weeks ago

Any update @thesahindia ๐Ÿ˜ƒ

melvin-bot[bot] commented 2 weeks ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

OfstadC commented 2 weeks ago

Bump @shahinyan11 Please update by EOD tomorrow ๐Ÿ˜ƒ Thanks!

melvin-bot[bot] commented 2 weeks ago

@OfstadC, @thesahindia 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

OfstadC commented 2 weeks ago

@thesahindia Looks like we have a new proposal to review ๐Ÿ˜ƒ

melvin-bot[bot] commented 1 week ago

@OfstadC, @thesahindia 10 days overdue. Is anyone even seeing these? Hello?

melvin-bot[bot] commented 1 week ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

OfstadC commented 1 week ago

Bump @thesahindia

melvin-bot[bot] commented 1 week ago

@OfstadC, @thesahindia 12 days overdue now... This issue's end is nigh!

OfstadC commented 1 week ago

Sorry for the confusion here! Looks like this is waiting for some more proposals ๐Ÿ˜ƒ

melvin-bot[bot] commented 1 week ago

This issue has not been updated in over 14 days. @OfstadC, @thesahindia eroding to Weekly issue.

gev990 commented 1 week ago

Proposal

Note I noticed that another member had previously posted a proposal here, but since there are currently no proposals, I decided to post a new proposal that might be similar to the proposal that was there before.

Please re-state the problem that we are trying to solve in this issue.

Chat - Cursor moves several characters when deleting markdowns on multiline message

What is the root cause of that problem?

The problem with the react-native-live-markdown package lies in how it handles cursor management. The custom logic for the cursor works effectively but operates at a quicker pace compared to Reactโ€™s default text updating mechanism. As a result, the cursor gets repositioned too early. When the slower React text update concludes, it overwrites the cursor position that was set manually. This mismatch in timing leads to the cursor appearing in an incorrect location, causing it to unexpectedly jump to a different point in the text.

What changes do you think we should make in order to solve the problem?

Move this code in callback of InteractionManager.runAfterInteractions

InteractionManager.runAfterInteractions(()=> {
  if (shouldForceDOMUpdate || targetElement.innerHTML !== dom.innerHTML) {
    const animationTimes = getAnimationCurrentTimes(targetElement);
    targetElement.innerHTML = '';
    targetElement.innerText = '';
    targetElement.innerHTML = dom.innerHTML;
    updateAnimationsTime(targetElement, animationTimes);
  }
  updateTreeElementRefs(tree, targetElement);
  targetElement.tree = tree;

  moveCursor(isFocused, alwaysMoveCursorToTheEnd, cursorPosition, targetElement, shouldScrollIntoView);
})

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 1 week ago

๐Ÿ“ฃ @gev1990! ๐Ÿ“ฃ 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:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
gev990 commented 1 week ago

Contributor details Your Expensify account email: gevexpensify@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~0183b679e4e9629baa

melvin-bot[bot] commented 1 week ago

โœ… Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] commented 5 days ago

๐Ÿ“ฃ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? ๐Ÿ’ธ

mvtglobally commented 4 days ago

Issue not reproducible during KI retests. (First week)