feat: track non-keyboard page navigation state - #819
Merged
Merged
Conversation
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuidePage-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 trackingsequenceDiagram
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
State diagram for mouse-driven page navigation metadatastateDiagram-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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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>
BLumia
approved these changes
Sep 28, 2026
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: blocked) |
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.
Log: Improved page navigation state tracking for non-keyboard interactions
Influence:
feat: 跟踪非键盘翻页状态
Log: 改进非键盘交互的翻页状态跟踪
Influence:
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:
Enhancements: