glushchenko / fsnotes

Notes manager for macOS/iOS
https://fsnot.es
MIT License
6.18k stars 453 forks source link

iOS editor frequently makes the cursor jump to the bottom of the file when typing #1678

Closed willxie closed 4 months ago

willxie commented 6 months ago

Description

It's pretty frustrating especially when there's no easy way to jump back to where I was typing in a large file. I turned off all all Editor rendering features and it still does the same thing. This very reproducible on my iPhone 13 mini. This can happen when my laptop is closed. I assume there should not be any opportunity for two devices updating the same file.

IMG_4232

To Reproduce

  1. Open any file
  2. Start making edits
  3. cursor jumps to the end of the file mid sentence as I was typing

Expected behavior

No response

FSNotes version

6.2.1 build 276

macOS/iOS version

17.1.2

Additional context

No response

nth-chile commented 6 months ago

It is frustrating! I have iPhone 13 mini as well

glushchenko commented 6 months ago

@nth-chile can you reproduce it too?

nth-chile commented 6 months ago

Yes, but it doesn't happen all the time. I'll try to pay attention to see how to reproduce

willxie commented 5 months ago

I tried to find a reproducible example using random texts. I was not able to. However, in my personal notes, it happens frequently. The characteristics of my notes are:

nburyak commented 5 months ago

Not sure, if it's the same issue. On MacOS I have also jumping cursor. Happens all the time but I can't come up with an explanation for such a behavior.

In the screen recording below I only typed text, but the cursor tried to jump to the beginning of the line all the time:

https://github.com/glushchenko/fsnotes/assets/2462403/80d00325-3edd-4c92-9535-9dd6ab2d8e52

Version: 6.6.6 (610) macOS: 14.2.1 (23C71)

glushchenko commented 5 months ago

Not sure, if it's the same issue. On MacOS I have also jumping cursor. Happens all the time but I can't come up with an explanation for such a behavior.

In the screen recording below I only typed text, but the cursor tried to jump to the beginning of the line all the time:

https://github.com/glushchenko/fsnotes/assets/2462403/80d00325-3edd-4c92-9535-9dd6ab2d8e52

Version: 6.6.6 (610)

macOS: 14.2.1 (23C71)

Where do you store your notes? Try the default storage.

nburyak commented 5 months ago

Where do you store your notes? Try the default storage.

Hi @glushchenko, I'm using the default storage. I tried changing it to a different one and then back to default but it didn't solve the issue. Eventually, I've managed to find the exact steps to reproduce and created a separate issue for it.

gingerbeardman commented 5 months ago

I'm getting this on iOS.

Both with Gboard keyboard and standard system keyboard.

gingerbeardman commented 4 months ago

This has driven me so crazy today. So much that I'm now using a different text editor on iOS.

amarendra commented 4 months ago

This has been happening on both Mac and iOS for quite sometime. But I am not able to find the exact steps either.

I noticed it happens when I stop typing for sometimes and let there be a noticeable gap. But sadly not always. Sometimes it just goes the beginning of line, paragraph, note randomly. Sometimes it does that while still typing and not stopped.

it also moves to the end of the file/note sometimes. This is really difficult to deal with as it messes up a lot of text, more so if typing fast.

glushchenko commented 4 months ago

@gingerbeardman can you test build 6.2.3 from testflight?

gingerbeardman commented 4 months ago

Somehow I'm no longer on the TestFlight. Please email me a new link

gingerbeardman commented 4 months ago

@gingerbeardman can you test build 6.2.3 from testflight?

Initial quick testing seems to show it's fixed in the TestFlight version.

glushchenko commented 4 months ago

@gingerbeardman check email

gingerbeardman commented 4 months ago

I replied

gingerbeardman commented 4 months ago

Whilst this is improved, the new version flicks quickly to the bottom and then returns to the current position (previously it would jump to the bottom and staying there)

This quick flick is really annoying because you're looking at the text when it happens.

So, I don't think this is really truly fixed.

glushchenko commented 4 months ago

There are several options:

1) I can prevent the open note from reloading at all. But then no changes will be received during synchronization.

If I make this as a separate option? Does this only happen on iOS?

2) I can block all reloading in example for two second after every key press.

nth-chile commented 4 months ago

Is there a way to help prevent user from editing a note that hasn't been synchronized? It would help prevent the merge conflicts mentioned in #1700. Can it sync in the background when the app is minimized? And if the app is terminated, then when you launch it, it opens with no note selected?

glushchenko commented 4 months ago

Is there a way to help prevent user from editing a note that hasn't been synchronized? It would help prevent the merge conflicts mentioned in #1700. Can it sync in the background when the app is minimized? And if the app is terminated, then when you launch it, it opens with no note selected?

How can I know if my notes have been synchronized or not? For example in Dropbox or Google Drive or iCloud Drive? Implement all existing clouds?

nth-chile commented 4 months ago

When you open the app from a minimized state, it sometimes shows an older state of the note and then flashes to the new one. If we could avoid that, it might prevent conflicts

gingerbeardman commented 4 months ago

So the issue is that as I am typing the note is constantly reloading? Because the note is receiving a synchronisation from other devices? But the note I am working on has only just been created on my iPhone, it does not exist on any other devices.

Hmm, I think the syncing logic is not ideal.

Pausing this behaviour for some seconds would be a workaround, but I feel that if the flicker/jump still happens it's not really a solution. Why does the note need to sync at all whilst i'm editing it? How do other apps handle it?

nth-chile commented 4 months ago

I don't know how much sync is responsible for the cursor jump because the cursor jump sometimes happens repeatedly on every autosave

glushchenko commented 3 months ago

Yes, reloading happens only in one case, when CloudDriveManager receives updated date of note file, and that date greater than local modification date.

gingerbeardman commented 3 months ago

Then I have no idea why my note is constantly updating and reloading.

Time sync difference?

glushchenko commented 3 months ago

This is a very interesting question as to why it just works for me. Everything seems to be standard, time syncs by ntp, APFS file system. What else could be breaking modification time?

gingerbeardman commented 3 months ago

I have no idea, I'm using FSNotes on my iPhone and it keeps reloading.

FSNotes not open on any of my other devices.

Can we add some logging to help? Do we know the source of the CloudDriveManager update?