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

Add a delay before analysing URLs #356

Open
3 tasks done
CloneWith opened this issue May 13, 2024 · 1 comment
Open
3 tasks done

Add a delay before analysing URLs #356

CloneWith opened this issue May 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@CloneWith
Copy link
Contributor

CloneWith commented May 13, 2024

Problem

When typing in the URL textbox, the URL view updates every time a character was typed.

This would lead to problems such as the log file and the history list is too long, or performance issues especially when a bunch of characters got deleted by pressing the Backspace key (instead of select and delete), which is common among mobile device users.

Suggestion

We can add a delay feature to the textbox, which let the application to wait for a while (maybe around 0.5 seconds) to let users complete their changes before analysing the URL and adding it to the log and history.

Alternative

We can also use an event to trigger the update of the view, such as:

  • The textbox loses focus
  • User presses a button (to be added) beside the textbox

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.
@CloneWith CloneWith added the enhancement New feature or request label May 13, 2024
@TrianguloY
Copy link
Owner

There is in fact special logic that marks some url changes (currently used only by the input text module) as "modifications of the previous url". But I think only the history module uses it to "replace" the previous url with that one.

You can easily test this by editing a url (writing or deleting characters quickly) and checking the history list (middle "clock" button). Only the last url will appear.

The issue with this approach is that, since it is a "modify the past" approach, modules in general can't react to it (they don't know if there will be a next input or not) so I also agree that replacing it with a "only send modifications after a small period of inactivity" should be done.
The main reasons I haven't done that yet is that it will require a background task (which I still don't properly know how to implement) and I personally like that it updates automatically.

As for your suggestions, the button approach could work perfectly with #100, and I'm not sure now how to detect the keyboard hiding, but detecting focus out of the textbox should be perfectly possible. Detecting a line break is a bit more problematic (what if the original text has one?) but you should be able to detect the "apply" keyboard button easily instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants