bludit icon indicating copy to clipboard operation
bludit copied to clipboard

Usability Bug: First save redirects to content list, others move cursor up

Open capocasa opened this issue 2 years ago • 2 comments

Describe your problem

I like that bludit now stays on the editor page after saving. But on the first save of new content, a redirect to the list of content is still performed. This is especially confusing for a draft, where the content goes into the draft list and is obscured from view after the save (see #1540, I thought there was no save happening).

Similarly, when performing subsequent save, the cursor moves to the top, presumably because a reload is performed. It would be much nicer if the cursor would stay where it is so saving can happen without interrupting writing flow.

I would highly recommend to perform all saves in the background without reloading any part of the UI at all, only displaying a little notification.

Steps to reproduce the problem

Create new content, set to draft, save.

Write some content, more than one page length, cursor is at end of content. Save. Content scrolls up, cursor is at beginning.

Bludit version

v 3.15 Pro

PHP version

7.4.33

capocasa avatar Sep 25 '23 10:09 capocasa

Hi, thank for reporting the issues.

I fixed the first part, when you save the content as draft and the user is not redirect to the proper Content Tab.

The second issue with the cursor is hard to fix as you mentioned the save button is doing a redirection and reseting the cursor. This will be fixed in Bludit v4, as everything is going though sub-requests using the API and not refreshing the entire page.

dignajar avatar Jun 30 '24 20:06 dignajar

Thank you for accomodating! I'll be happy to test.

That sounds like a great idea to use an API in bludit 4. Thanks for implementing this fix, I will be happy to test.

Low-effort fix suggestion for cursor

If you wish, I believe you could do a dirty fix for the cursor usability issue by storing the cursor position in JavaScript localStorage after each keystroke, delete it on save- set the cursor position on page load if present, like so: https://stackoverflow.com/a/6249440/187273

_Low-effort data loss prevention suggestion-

Another suggestion: Store the current article text in localStorage on every key stroke, delete after successful save. Offer to restore as new content in new tab if present. This would prevent the last data-loss inducing failure mode in bludit I am aware of. You could then safely write on spotty internet connections, or even when offline, and save when online.

I hope these are helpful- in any case, thank you for writing bludit. My bludit blog, if you want to have a quick look: http://shaman.capo.casa/

capocasa avatar Jul 01 '24 08:07 capocasa