Add swipe gestures to Anki-Mode#804
Open
timbittner wants to merge 1 commit intodavidsansome:masterfrom
Open
Conversation
Swiping on the question background marks answers. Left: incorrect, Right: correct, Down: skip (if skipping allowed), Up: show details (incorrect) This replaces the swipe gestures globally (for unified UX) for changing the font with tap gestures. Taps work like music controls with AirPods single=toggle font (unchanged behavior), double=next font, triple=previous font. Tapping the answer bar will act like tapping the question label previously, i.e. submitting (incorrect) and showing details. Animated banners provide feedback to the user about their swiping direction and intention. Swiping is disabled by default and configurable as sub-setting for Anki-Mode (like the group reading and meaning option).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Swiping on the question background/label marks answers with visual feedback if enabled in settings.
This means that swiping on the question label is no longer changing the font.
Changing the font is now done entirely though tap gestures, see below.
Interference with existing behavior (change fonts)
While it's not impossible to keep the label swiping alongside the gestures for marking, I felt it was more appropriate to change the font cycling behavior to be entirely tap-based.
Taps work similar to playback controls using AirPods:
Tapping the answer bar will act like tapping the question background previously, i.e. submitting (marks incorrect) and showing details.
I felt like this is appropriate since the answer textfield prompts the user with "reveal answer" (EN/JP) anyways.
Rationale
I've been using TsuruKame on public transit in Anki-Mode and I felt like I have to tap too often when I'm certain I know the answer, so I imagined what it would be like to swipe my reviews like you do with popular dating apps.
Initially, I just rewired the tap and swipe gesture recognizers but that resulted in poor responsiveness.
If you didn't know already, there was no way to find out what your swipes would do now.
For this reason, I changed the swipe gesture recognizer to a pan gesture recognizer and provide user feedback via colored banners that slide in from the sides in response to the user's pan.
One could argue for more glyphs instead of just the colors for correct and incorrect but since they use the WaniKani colors for correct and incorrect I think it's reasonable to expect users to understand.
Since this PR is just born out of my desire for such an interaction, I implemented a settings toggle to disable the swipe (pan) gestures.
In fact, they are disabled by default to prevent new users from accidentally swiping in confusion (though they would have to enable Anki-Mode in the first place to do so...)
Discussion
Please let me know what you think about my proposed changes.
I'm happy to adjust anything to your liking. Below, you can find a small gif showing the swipe feature in action.
Bests, Tim