Skip to content

Add scanOnTouchTap and improve touch scanning defaults#791

Merged
jamesmaa merged 3 commits intoyomidevs:masterfrom
Kuuuube:touch-gestures
Apr 14, 2024
Merged

Add scanOnTouchTap and improve touch scanning defaults#791
jamesmaa merged 3 commits intoyomidevs:masterfrom
Kuuuube:touch-gestures

Conversation

@Kuuuube
Copy link
Copy Markdown
Member

@Kuuuube Kuuuube commented Mar 26, 2024

The current touch scanning options are extremely prone to accidental scans. Scrolling down a webpage or flipping a page in a book can get very annoying when every 2 seconds theres an accidental scan.

In the past with yomichan there were some very specific settings that could be used as a workaround to fix this and effectively get a touch tap gesture. Yomitan no longer allows this workaround. I looked into restoring this behavior and it turns out that behavior being possible was actually exploiting a bug and it's also a pain to set up anyways.

I've added scanOnTouchTap so we can have proper touch tap gesture support. The implementation is simple:

touchstart -> touchend = touchtap

touchstart -> touchmove -> touchend = no touchtap

I've also made this update settings to disable the previous defaults: scanOnTouchPress and scanOnTouchMove. Normally I wouldn't want to mess with existing settings like this but the previous defaults were so bad to use compared to this I think it's a worthy change. If messing with existing settings like this goes against the project's values I'll revert that.

Comparison in use:

Before:

before.mp4

After:

after.mp4

@Kuuuube Kuuuube requested a review from a team as a code owner March 26, 2024 01:13
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2024

⚠️ Visual differences introduced by this PR; please validate if they are desirable.

View Playwright Report (note: open the "playwright-report" artifact)

@Casheeew Casheeew added kind/enhancement The issue or PR is a new feature or request area/ui-ux The issue or PR is related to UI/UX/Design labels Mar 28, 2024
Copy link
Copy Markdown
Member

@StefanVukovic99 StefanVukovic99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (has a conflict though)

@Kuuuube
Copy link
Copy Markdown
Member Author

Kuuuube commented Apr 10, 2024

LGTM (has a conflict though)

Resolved

@jamesmaa jamesmaa added this pull request to the merge queue Apr 14, 2024
@jamesmaa jamesmaa removed this pull request from the merge queue due to a manual request Apr 14, 2024
@jamesmaa jamesmaa added this pull request to the merge queue Apr 14, 2024
Merged via the queue into yomidevs:master with commit 7df7e1b Apr 14, 2024
github-merge-queue bot pushed a commit that referenced this pull request Apr 16, 2024
* added Old Irish (SGA)

* Merge Yomitan Updates (#1)

* fix (#811)

* Add scanOnTouchTap and improve touch scanning defaults (#791)

* Add scanOnTouchTap

* Update version to 30

* Cleanup if statement

* log anki error when hiding button (#821)

* Fix noteInfos not getting assigned (#819)

* improve term sorting (#806)

* improve term sorting

* edge case

* fix: add missing handlebar entry (#823)

* fix: add missing handlebar entry

* fix: add new handlebar to tests

* Revert to using canAddNotes (#827)

Fix #818

* Remove unused canAdd (#824)

Co-authored-by: James Maa <jamesmaa@Jamess-MacBook-Pro.local>

* Fix duplicate check not working across note types (#830)

* Fix duplicate check not working across note types

* Add invalidNoteId

---------

Co-authored-by: James Maa <jmaa@berkeley.edu>

---------

Co-authored-by: StefanVukovic99 <stefanvukovic44@gmail.com>
Co-authored-by: Kuuuube <61125188+Kuuuube@users.noreply.github.com>
Co-authored-by: m-edlund <me@fwegmann.com>
Co-authored-by: Eloy Robillard <eloy.robillard@gmail.com>
Co-authored-by: James Maa <jmaa@berkeley.edu>
Co-authored-by: James Maa <jamesmaa@Jamess-MacBook-Pro.local>

* Revert "Merge Yomitan Updates (#1)"

This reverts commit 748dc22.

* Fix Static Analysis Error

* Fix eslint erro

---------

Co-authored-by: martholomew <martholomew@users.noreply.github.com>
Co-authored-by: StefanVukovic99 <stefanvukovic44@gmail.com>
Co-authored-by: Kuuuube <61125188+Kuuuube@users.noreply.github.com>
Co-authored-by: m-edlund <me@fwegmann.com>
Co-authored-by: Eloy Robillard <eloy.robillard@gmail.com>
Co-authored-by: James Maa <jmaa@berkeley.edu>
Co-authored-by: James Maa <jamesmaa@Jamess-MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui-ux The issue or PR is related to UI/UX/Design kind/enhancement The issue or PR is a new feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants