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

improve language swipe cycling #656

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

codokie
Copy link
Contributor

@codokie codokie commented Apr 6, 2024

I've added a setting to adjust the sensitivity of the language swipe/slide gesture distance sensitivity.
The current step value does not work well on some devices like S22+.
Here is the current behavior:

Click to expand
High.mp4

And with the new default Medium option selected:

Click to expand
medium.mp4
fixes #255 and #614

@RHJihan
Copy link
Contributor

RHJihan commented Apr 6, 2024

Sensitivity 20 is very low for vertical sliding. I am not sure about this approach. Related issue: #255

@codokie
Copy link
Contributor Author

codokie commented Apr 6, 2024

If you swipe downwards, for sure. But anything higher than 4 may not be feasible as well. That said, if you swipe upwards and have only 2 subtypes, it does make sense.
I could change that to 16 or rename it to "Very Low". There can be a "Very High" setting as well.
How about the following mapping?
4 -> Very high
8 -> High
12 -> Medium
16 -> Low
20 -> Very Low
Alternatively, a slider could be implemented instead, but I think the above options cover most use cases

@RHJihan
Copy link
Contributor

RHJihan commented Apr 6, 2024

Low sensitivity kind of fixes the flickering problem. However, it requires more travel distance and, so, more time to type. This is a drawback. To address this trade-off, perhaps we could consider other options, like the ones mentioned in #255, such as switching only one language per swipe or stopping the cycle at the end of the enabled language.

This PR is a positive step forward. I'm just curious if there might be an even more optimal solution to this flickering issue.

I'm curious if @nach0 has any thoughts on this approach.

@Helium314
Copy link
Owner

Just some thoughts, haven't read up on the old issues yet. (so some parts below might be outdated)

If sensitivity is too high for swipe to be usable, does it also apply to cursor movement?
My reasoning was that if a user is able to place the cursor with character accuracy, they should be able to to select a language with quarter that accuracy.
If the general sensitivity is too high, maybe the setting could adjust pointerStep instead?

In my opinion a slider is preferable over a bunch of fixed values, because it allows more fine-grained tuning and requires fewer strings, so less work for translators.

@codokie
Copy link
Contributor Author

codokie commented Apr 6, 2024

If sensitivity is too high for swipe to be usable, does it also apply to cursor movement?

No, only onLanguageSlide() uses the set value. The calculation for the cursor are different and I have no real issue with them.

a slider is preferable

what a good range would you say it should be? from 1 to 25 ?

switching only one language per swipe

@RHJihan I could implement that very easily but I assume people with many subtypes may not be crazy about it so I might have to add another setting. The other solution is more tricky but I think is feasible. Should I pursue both solutions?

@RHJihan
Copy link
Contributor

RHJihan commented Apr 6, 2024

Should I pursue both solutions?

I am unsure about which approach would be better. Or implementing both will be a good decision? I think it will be better than the current situation. However, I use only two subtypes, I cannot give a final though on this.
But I don't think anyone would be unhappy if one language change per swipe is a tweakable option.

replaced options with slider
renamed "sensitivity" with "distance"
@codokie
Copy link
Contributor Author

codokie commented Apr 6, 2024

@RHJihan On a second though I think the 2nd solution is more elegant and renders the first one a bit redundant if there is also a slider for adjusting the sensitivity.
No setting is needed because cycling through all subtypes only once is a desired behavior I believe.
If you have only 2 subtypes, it would be the same as if just one language could be switched per swipe.

In c50acad I've added that functionality as well as the slider ranging from 2 to 18 with a default 10 in between

@codokie codokie changed the title language swipe sensitivity options improve language swipe cycling Apr 6, 2024
@codokie codokie closed this Apr 6, 2024
@codokie codokie deleted the lang_swipe_sensitivity branch April 6, 2024 22:10
@codokie codokie restored the lang_swipe_sensitivity branch April 6, 2024 22:10
@codokie
Copy link
Contributor Author

codokie commented Apr 6, 2024

Oops, I tried to rename the branch but I did not know it will close this PR.

@codokie codokie reopened this Apr 6, 2024
@RHJihan
Copy link
Contributor

RHJihan commented Apr 7, 2024

works perfectly. loved it

@RHJihan
Copy link
Contributor

RHJihan commented Oct 10, 2024

@Helium314, just wanted to kindly check in on the status of this PR. I know you're busy, but this PR would be a huge update for me. I’d really appreciate it if it could be reviewed when you have a moment. Thank you!

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

Successfully merging this pull request may close these issues.

Refinement of Space bar language slide Mechanism for Improved User Interaction
3 participants