fsnotes icon indicating copy to clipboard operation
fsnotes copied to clipboard

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

Open willxie opened this issue 1 year ago • 12 comments

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

willxie avatar Jan 06 '24 11:01 willxie

It is frustrating! I have iPhone 13 mini as well

nth-chile avatar Jan 06 '24 14:01 nth-chile

@nth-chile can you reproduce it too?

glushchenko avatar Jan 06 '24 15:01 glushchenko

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

nth-chile avatar Jan 06 '24 15:01 nth-chile

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:

  • most notes are long-ish, say 800 words
  • i use a lot of bullet points and links
  • no images. All other markdown features are used sparingly if at all.

willxie avatar Jan 08 '24 12:01 willxie

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)

nburyak avatar Jan 17 '24 10:01 nburyak

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.

glushchenko avatar Jan 18 '24 00:01 glushchenko

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.

nburyak avatar Jan 18 '24 09:01 nburyak

I'm getting this on iOS.

Both with Gboard keyboard and standard system keyboard.

gingerbeardman avatar Jan 23 '24 14:01 gingerbeardman

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

gingerbeardman avatar Feb 16 '24 18:02 gingerbeardman

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.

amarendra avatar Feb 17 '24 18:02 amarendra

@gingerbeardman can you test build 6.2.3 from testflight?

glushchenko avatar Feb 18 '24 00:02 glushchenko

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

gingerbeardman avatar Feb 18 '24 01:02 gingerbeardman

@gingerbeardman can you test build 6.2.3 from testflight?

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

gingerbeardman avatar Feb 20 '24 00:02 gingerbeardman

@gingerbeardman check email

glushchenko avatar Feb 20 '24 03:02 glushchenko

I replied

gingerbeardman avatar Feb 20 '24 11:02 gingerbeardman

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.

gingerbeardman avatar Feb 27 '24 01:02 gingerbeardman

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?

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

glushchenko avatar Feb 27 '24 20:02 glushchenko

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?

nth-chile avatar Feb 27 '24 21:02 nth-chile

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?

glushchenko avatar Feb 27 '24 21:02 glushchenko

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

nth-chile avatar Feb 27 '24 21:02 nth-chile

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?

gingerbeardman avatar Feb 29 '24 13:02 gingerbeardman

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

nth-chile avatar Feb 29 '24 13:02 nth-chile

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

glushchenko avatar Mar 10 '24 20:03 glushchenko

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

Time sync difference?

gingerbeardman avatar Mar 11 '24 02:03 gingerbeardman

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?

glushchenko avatar Mar 11 '24 02:03 glushchenko

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?

gingerbeardman avatar Mar 11 '24 18:03 gingerbeardman