Skip to content

feat: track non-keyboard page navigation state - #819

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-377905
Sep 28, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-377905

Conversation

@wjyrich

@wjyrich wjyrich commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
  1. Set changedByNonKeyboard to false and update previousIndex when navigating pages via mouse click on page indicators
  2. Handle both first page to last page and last page to first page wrapping scenarios
  3. Ensures page switch state tracking correctly reflects user interaction method for proper animation and state management

Log: Improved page navigation state tracking for non-keyboard interactions

Influence:

  1. Test clicking page indicator dots to switch pages and verify correct page transition
  2. Verify first page to last page wrap-around navigation via mouse click
  3. Verify last page to first page wrap-around navigation via mouse click
  4. Test that keyboard navigation still works correctly after mouse-based page switching
  5. Verify that previousIndex is correctly updated for page switch animations
  6. Test rapid page switching via mouse clicks to ensure state consistency

feat: 跟踪非键盘翻页状态

  1. 通过鼠标点击页面指示器翻页时,设置 changedByNonKeyboard 为 false 并更 新 previousIndex
  2. 处理首页跳转到末页和末页跳转到首页的循环场景
  3. 确保翻页状态跟踪正确反映用户交互方式,以便正确处理动画和状态管理

Log: 改进非键盘交互的翻页状态跟踪

Influence:

  1. 测试点击页面指示器圆点切换页面,验证页面切换是否正确
  2. 验证通过鼠标点击从首页跳转到末页的循环导航
  3. 验证通过鼠标点击从末页跳转到首页的循环导航
  4. 测试鼠标翻页后键盘导航是否仍正常工作
  5. 验证 previousIndex 是否正确更新以支持翻页动画
  6. 测试通过鼠标快速连续翻页,确保状态一致性

PMS: BUG-377905

Summary by Sourcery

Track page indicator navigation separately from keyboard navigation so page transitions and wrap-around behavior remain consistent.

Bug Fixes:

  • Correct page navigation state tracking for mouse-driven page indicator interactions, including wrap-around transitions between the first and last pages.

Enhancements:

  • Keep animation and subsequent keyboard navigation state consistent after non-keyboard page changes.

1. Set changedByNonKeyboard to false and update previousIndex when
navigating pages via mouse click on page indicators
2. Handle both first page to last page and last page to first page
wrapping scenarios
3. Ensures page switch state tracking correctly reflects user
interaction method for proper animation and state management

Log: Improved page navigation state tracking for non-keyboard
interactions

Influence:
1. Test clicking page indicator dots to switch pages and verify correct
page transition
2. Verify first page to last page wrap-around navigation via mouse click
3. Verify last page to first page wrap-around navigation via mouse click
4. Test that keyboard navigation still works correctly after mouse-based
page switching
5. Verify that previousIndex is correctly updated for page switch
animations
6. Test rapid page switching via mouse clicks to ensure state
consistency

feat: 跟踪非键盘翻页状态

1. 通过鼠标点击页面指示器翻页时,设置 changedByNonKeyboard 为 false 并更
新 previousIndex
2. 处理首页跳转到末页和末页跳转到首页的循环场景
3. 确保翻页状态跟踪正确反映用户交互方式,以便正确处理动画和状态管理

Log: 改进非键盘交互的翻页状态跟踪

Influence:
1. 测试点击页面指示器圆点切换页面,验证页面切换是否正确
2. 验证通过鼠标点击从首页跳转到末页的循环导航
3. 验证通过鼠标点击从末页跳转到首页的循环导航
4. 测试鼠标翻页后键盘导航是否仍正常工作
5. 验证 previousIndex 是否正确更新以支持翻页动画
6. 测试通过鼠标快速连续翻页,确保状态一致性

PMS: BUG-377905
@sourcery-ai

sourcery-ai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Page-indicator clicks now explicitly update navigation metadata so animations and subsequent keyboard navigation distinguish mouse-driven page changes, including wrap-around transitions.

Sequence diagram for page-indicator navigation state tracking

sequenceDiagram
    actor User
    participant PageIndicator as PageIndicator
    participant listviewPage as listviewPage

    User->>PageIndicator: click page indicator
    PageIndicator->>listviewPage: changedByNonKeyboard = false
    PageIndicator->>listviewPage: previousIndex = listItem.viewIndex
    alt first page clicked
        PageIndicator->>listviewPage: setCurrentIndex(pageCount - 1)
    else last page clicked
        PageIndicator->>listviewPage: setCurrentIndex(0)
    else another page clicked
        PageIndicator->>listviewPage: setCurrentIndex(listItem.viewIndex)
    end
Loading

State diagram for mouse-driven page navigation metadata

stateDiagram-v2
    [*] --> CurrentPage
    CurrentPage --> MouseNavigation: page indicator click
    MouseNavigation: changedByNonKeyboard = false
    MouseNavigation: previousIndex updated
    MouseNavigation --> WrappedPage: first/last page boundary
    MouseNavigation --> CurrentPage: setCurrentIndex
    WrappedPage --> CurrentPage: setCurrentIndex
Loading

File-Level Changes

Change Details Files
Track page-indicator navigation as non-keyboard interaction and synchronize animation state before applying page changes.
  • Reset changedByNonKeyboard for indicator clicks.
  • Update previousIndex from the clicked page index where needed.
  • Preserve first-to-last and last-to-first wrap-around handling while applying the tracking state.
qml/FullscreenFrame.qml

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="qml/FullscreenFrame.qml" line_range="513-514" />
<code_context>
                                     return
                                 }

+                                listviewPage.changedByNonKeyboard = false
+                                listviewPage.previousIndex = listItem.viewIndex
+
                                 if (listItem.viewIndex === 0) {
</code_context>
<issue_to_address>
**issue (broader_impact):** The new assignments are inside `Keys.onLeftPressed` and `Keys.onRightPressed`, so clicking a page-indicator dot still follows `PageIndicator.onCurrentIndexChanged`, which sets `changedByNonKeyboard` to `true` and does not update `previousIndex` at the click site. Consequently, the requested mouse-specific state tracking and wrap-around handling are not implemented by this change.

**Triggers:** When the user switches pages by clicking an indicator dot.

**Suggested fix:** Move the state updates into the page-indicator click path, or distinguish user-initiated indicator changes from the binding update and set `changedByNonKeyboard` and `previousIndex` there.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread qml/FullscreenFrame.qml
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, wjyrich

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wjyrich

wjyrich commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit d817a5a into linuxdeepin:master Sep 28, 2026
6 checks passed
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.

3 participants