Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Sep 4, 2025

Fixed arrow button visibility logic in ArrowListView to properly hide
buttons when reaching the beginning or end of the list. Previously,
arrow buttons were only hidden when the list was non-interactive, but
remained visible even when at the boundaries of scrollable content.

The changes add boundary checks to the visibility conditions:

  • Up arrow button now hides when at the beginning of the list
    (atYBeginning)
  • Down arrow button now hides when at the end of the list (atYEnd)

This provides better visual feedback to users and prevents unnecessary
button display when no further scrolling is possible.

Log: Fixed arrow button visibility in lists to hide when reaching
boundaries

Influence:

  1. Test scrolling through lists with varying content lengths
  2. Verify up arrow hides when reaching the top of the list
  3. Verify down arrow hides when reaching the bottom of the list
  4. Test with both interactive and non-interactive lists
  5. Verify button visibility during scroll animations
  6. Test edge cases with very short lists

fix: 修复列表边界箭头按钮显示问题

修复了ArrowListView中箭头按钮的可见性逻辑,使其在到达列表边界时正确隐藏
按钮。之前箭头按钮仅在列表不可交互时隐藏,但在可滚动内容边界处仍然显示。

修改为可见性条件添加了边界检查:

  • 向上箭头按钮在到达列表开头时隐藏(atYBeginning)
  • 向下箭头按钮在到达列表末尾时隐藏(atYEnd)

这为用户提供了更好的视觉反馈,并在无法进一步滚动时避免不必要的按钮显示。

Log: 修复列表边界处箭头按钮的显示问题

Influence:

  1. 测试不同长度列表的滚动功能
  2. 验证到达列表顶部时向上箭头是否隐藏
  3. 验证到达列表底部时向下箭头是否隐藏
  4. 测试交互式和非交互式列表的情况
  5. 验证滚动动画期间的按钮可见性
  6. 测试极短列表的边缘情况

PMS: BUG-278697

Summary by Sourcery

Add boundary checks to ArrowListView to hide navigation arrows when the list is at its start or end to prevent unnecessary button display.

Bug Fixes:

  • Hide the up arrow button when the list reaches its beginning
  • Hide the down arrow button when the list reaches its end

Fixed arrow button visibility logic in ArrowListView to properly hide
buttons when reaching the beginning or end of the list. Previously,
arrow buttons were only hidden when the list was non-interactive, but
remained visible even when at the boundaries of scrollable content.

The changes add boundary checks to the visibility conditions:
- Up arrow button now hides when at the beginning of the list
(atYBeginning)
- Down arrow button now hides when at the end of the list (atYEnd)

This provides better visual feedback to users and prevents unnecessary
button display when no further scrolling is possible.

Log: Fixed arrow button visibility in lists to hide when reaching
boundaries

Influence:
1. Test scrolling through lists with varying content lengths
2. Verify up arrow hides when reaching the top of the list
3. Verify down arrow hides when reaching the bottom of the list
4. Test with both interactive and non-interactive lists
5. Verify button visibility during scroll animations
6. Test edge cases with very short lists

fix: 修复列表边界箭头按钮显示问题

修复了ArrowListView中箭头按钮的可见性逻辑,使其在到达列表边界时正确隐藏
按钮。之前箭头按钮仅在列表不可交互时隐藏,但在可滚动内容边界处仍然显示。

修改为可见性条件添加了边界检查:
- 向上箭头按钮在到达列表开头时隐藏(atYBeginning)
- 向下箭头按钮在到达列表末尾时隐藏(atYEnd)

这为用户提供了更好的视觉反馈,并在无法进一步滚动时避免不必要的按钮显示。

Log: 修复列表边界处箭头按钮的显示问题

Influence:
1. 测试不同长度列表的滚动功能
2. 验证到达列表顶部时向上箭头是否隐藏
3. 验证到达列表底部时向下箭头是否隐藏
4. 测试交互式和非交互式列表的情况
5. 验证滚动动画期间的按钮可见性
6. 测试极短列表的边缘情况

PMS: BUG-278697
@18202781743 18202781743 requested review from BLumia and mhduiy September 4, 2025 04:19
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Sep 4, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#526
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

我来审查这段代码的修改。

修改概述

这段代码修改了两个ArrowListViewButton的可见性条件:

  1. 上方按钮:从 visible: itemsView.interactive 改为 visible: itemsView.interactive && !itemsView.atYBeginning
  2. 下方按钮:从 visible: itemsView.interactive 改为 visible: itemsView.interactive && !itemsView.atYEnd

代码分析

这个修改的目的是优化ArrowListView的交互体验,通过添加额外的条件来判断列表是否已经滚动到顶部或底部,从而决定是否显示相应的滚动按钮。

改进意见

  1. 逻辑改进

    • 修改后的逻辑更合理,只有当列表可交互且不在顶部时才显示上方按钮,只有当列表可交互且不在底部时才显示下方按钮。这样可以避免在已经到达边界时仍然显示滚动按钮。
  2. 性能考虑

    • 这个修改可能会带来轻微的性能开销,因为每次滚动时都需要检查atYBeginningatYEnd属性。不过这个开销很小,可以忽略不计。
  3. 用户体验

    • 这个改进显著提升了用户体验,用户可以更直观地知道是否可以继续滚动。
  4. 代码健壮性

    • 建议添加错误处理,以防itemsView对象没有这些属性的情况。可以使用条件判断:
    visible: itemsView.interactive && (itemsView.atYBeginning === undefined || !itemsView.atYBeginning)
  5. 可维护性

    • 可以考虑将这些条件提取为单独的属性,提高代码可读性:
    property bool showUpButton: itemsView.interactive && !itemsView.atYBeginning
    property bool showDownButton: itemsView.interactive && !itemsView.atYEnd
    
    P.ArrowListViewButton {
        visible: showUpButton
        // ...
    }
    
    P.ArrowListViewButton {
        visible: showDownButton
        // ...
    }
  6. 代码风格

    • 当前代码风格良好,保持了一致的缩进和格式。

总结

这个修改是一个合理的改进,它优化了用户界面,使其更加直观和易用。虽然有一些小的改进空间,但整体而言,这个修改是有益的,应该保留。

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 4, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updated ArrowListView to hide navigation arrows at the start and end of the list by adding boundary checks to the visibility logic.

File-Level Changes

Change Details Files
Add boundary checks to arrow button visibility logic
  • Hide up arrow when at list start (atYBeginning)
  • Hide down arrow when at list end (atYEnd)
qt6/src/qml/ArrowListView.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

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, mhduiy

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

@18202781743 18202781743 merged commit ec5b52d into linuxdeepin:master Sep 4, 2025
19 of 20 checks passed
18202781743 pushed a commit to linuxdeepin/dtk6declarative that referenced this pull request Sep 4, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#526
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