dreautall / waterfly-iii

Unofficial Android App for Firefly III, a free and open source personal finance manager.
MIT License
334 stars 26 forks source link

Prefetching drop down entries when adding transaction #352

Closed zynexiz closed 3 months ago

zynexiz commented 5 months ago

I hade some issues when adding new transaction in the app. I just noticed this worked without issues when I was connection to my home network, so this issue appears when I'm om mobile network. The issue occurs when starting to type in something in the input boxes with the drop down menu. It seems that the search for the string you start to type is done on the fly, fetching the result from the server itself. This issue seems to be affected when using high latency networks, like mobile network.

This makes the result "jump around" for a second before settling for the result i typed in. Half of the times when I press one of the results, it rearrange the order in the drop down menu entries, thus selecting something else in the end. I have to wait for a second or two for it to "settle" before selecting something. Not a huge issue, but still pretty annoying experience.

One solution is to prefect the entries and do the search locally, alternatively add 500-800 ms delay after last character was typed before querying the result? This would make the experience a bit more consistent.

dreautall commented 5 months ago

The autocomplete is done completely server-side, yes. Obviously on bad connections this might cause some issues.

I can try to put in a delay, but not sure if this wouldn't be too disturbing in most circumstances (assuming you have somewhat good mobile internet). I will experiment a little bit with it in an upcoming beta version.

I could shoot the query right away and then show the results if there was no further input for 500ms. The overhead of the queries should be pretty minimal.

dreautall commented 5 months ago

After playing around a bit, I couldn't find an option that feels "natural" in good internet environments 😞 Might need to play around a bit more, but so far every delay just feels... strange.

dreautall commented 4 months ago

After playing some more (sorry for the long delay), I think I found the best way: The requests are still send instantaneously, but the results are not progressed if a new letter is entered before the answer arrived. This should prevent jump-arounds while not introducing a fake latency with a forced wait, which makes for a way better flow on fast networks.

I'll implement this for the text fields on the transaction page in a future release.