Skip to content

Add swipe gestures to Anki-Mode#804

Open
timbittner wants to merge 1 commit intodavidsansome:masterfrom
timbittner:feature/anki-swipe
Open

Add swipe gestures to Anki-Mode#804
timbittner wants to merge 1 commit intodavidsansome:masterfrom
timbittner:feature/anki-swipe

Conversation

@timbittner
Copy link
Copy Markdown

Summary

Swiping on the question background/label marks answers with visual feedback if enabled in settings.

  • Left: incorrect
  • Right: correct
  • Down: skip (if skipping is allowed in [quick-]settings)
  • Up: show details (marks as incorrect)

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:

  • Single Tap: toggle font (this behavior is unchanged)
  • Double Tap: next font (previously swipe right)
  • Triple Tap: previous font (previously swipe left)

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.

ScreenRecording_01-31-2025 12-39-36_1

Bests, Tim

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).
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.

1 participant