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

Excessive history generation #3

Closed
lifthrasiir opened this issue Feb 18, 2024 · 2 comments
Closed

Excessive history generation #3

lifthrasiir opened this issue Feb 18, 2024 · 2 comments

Comments

@lifthrasiir
Copy link

I'm not sure this should be filed under furls instead, but I feel that this issue is more relevant in the context of this particular app, so I'll put this here.

Imagine the following sequence of actions:

  1. Navigate to https://erikdemaine.org/fonts/orthofoldcut/.
  2. Replace the default text with hello world.
  3. Select the "Puzzle font" to see an alternative view, and select the "Solved font" radio after that. (Note: This doesn't seem to work right now, at least in my Firefox, for your information. But anyway...)
  4. Replace hello world with Hello, world!, and roll back with Ctrl-Z or equivalent because punctuations are not supported.

This generates an enormous number of history entries: 1, 11, 2 and 4 for each step to be exact. Most of them are redundant and do not have to be saved at all. As is, they effectively render the entire history unusable.

I personally prefer to have only one additional entry after the initial load, that is, pushState initially and replaceState from that point on (unless the new state was reverted, in which case pushState again). Of course that's my opinion, and you may instead save the state for each step. But my point is that, at least for textareas, each input (as in oninput) needs not generate a new history entry, especially because even an undo counts as a single additional input, and onchange should be used instead for this purpose.

@edemaine
Copy link
Owner

I like the idea of doing pushState during onchange and replaceState during oninput. That seems like a good usability improvement for text entry.

FWIW, there is an option (at least in furls) to implement your preference of "always replaceState". I just happen not to share that preference.

@edemaine
Copy link
Owner

I implemented the compromise above, as a new default mode for furls. Thanks again for the suggestion!

I also fixed the bug you reported in the orthofoldcut font on Firefox, which I thought was a bug in Firefox but turns out to be a bug in Chrome.

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

No branches or pull requests

2 participants