Skip to content

GitAuto: Panning Vertically#969

Open
gitauto-ai[bot] wants to merge 1 commit intomasterfrom
gitauto/issue-935-20250530-031454-hPbW
Open

GitAuto: Panning Vertically#969
gitauto-ai[bot] wants to merge 1 commit intomasterfrom
gitauto/issue-935-20250530-031454-hPbW

Conversation

@gitauto-ai
Copy link

@gitauto-ai gitauto-ai bot commented May 30, 2025

Resolves #935

Why is this feature needed?

The current reader behavior in landscape mode when zoomed in does not properly support vertical panning. Users expect that tapping right or left will first attempt to pan up or down (depending on which edge of the page is visible) before moving to the next or previous page. This update aims to improve the user experience by enabling more intuitive navigation when the page is zoomed in.

What and how are we changing? Why this approach?

We modified the logic in PagerViewer to check for vertical panning before falling back to the horizontal page navigation. When a user taps right, the code now checks if it can pan down (instead of immediately panning right) using the holder.canPanDown() function. Similarly, when a user taps left, it checks if it can pan up before executing a pan left. This approach ensures that if there is spillover for vertical navigation, the reader will pan accordingly, and if the edge of the page is reached, it will then trigger the page change.

What actions are required from users?

No immediate actions are required from users. However, it is recommended to update to the latest version of the app to benefit from this enhanced panning behavior in landscape mode when zoomed in.

How does it work? (Technical details)

• In PagerViewer.kt:

  • For the right tap event, the app now calls holder.canPanDown() to decide whether to pan vertically (down) or if not possible, then fall back to the existing behavior of panRight().
  • For the left tap event, the app similarly uses holder.canPanUp() before calling panLeft().
    • These changes rely on the underlying capabilities of the page holder (canPanDown, panDown, canPanUp, panUp) to determine and execute the correct panning behavior.

Is it backwards compatible?

Yes, the change is backwards compatible. If the vertical panning conditions are not met, the application will utilize the existing horizontal pan behavior. Users who have not updated their reading patterns or whose pages do not have vertical panning capability will not notice any change in behavior.

Any other considerations?

We considered other approaches such as dynamically adjusting the pan behavior based on the zoom level or user settings; however, checking for the capability directly on the page holder and conditionally executing the appropriate pan provided the cleanest and most maintainable solution. Further testing will be necessary to ensure seamless performance across different page types and zoom levels.

git fetch origin
git checkout gitauto/issue-935-20250530-031454-hPbW
git pull origin gitauto/issue-935-20250530-031454-hPbW

@gitauto-ai gitauto-ai bot requested a review from cuong-tran May 30, 2025 03:17
@gitauto-ai gitauto-ai bot mentioned this pull request May 30, 2025
4 tasks
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 30, 2025

Reviewer's Guide

Enhanced the pager navigation logic to attempt vertical panning (down/up) before default horizontal panning when the ‘navigateToPan’ config is enabled.

Updated Class Diagram for PagerViewer

classDiagram
    class PagerViewer {
        +moveToNext()
        +moveToPrevious()
    }
Loading

File-Level Changes

Change Details Files
Forward navigation now tries vertical panning down before panning right.
  • Wrapped holder.panRight() call in a canPanDown() check
  • Invoke holder.panDown() if vertical movement is possible
  • Fallback to holder.panRight() when downward pan isn’t available
app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt
Backward navigation now tries vertical panning up before panning left.
  • Wrapped holder.panLeft() call in a canPanUp() check
  • Invoke holder.panUp() if upward movement is possible
  • Fallback to holder.panLeft() when upward pan isn’t available
app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerViewer.kt

Assessment against linked issues

Issue Objective Addressed Explanation
#935 Enable vertical panning when zoomed in landscape mode, so that tapping right/left moves the page up/down to fit the whole page in the screen.
#935 When the page reaches the top/bottom while zoomed in, tapping right/left should navigate to the next/previous page.

Possibly linked issues

  • Panning Vertically #935: The PR adds checks for vertical panning before allowing horizontal page changes, resolving the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

Panning Vertically

0 participants