Skip to content

fix: prevent notification list overscrolling#1507

Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom
qxp930712:master
Mar 17, 2026
Merged

fix: prevent notification list overscrolling#1507
18202781743 merged 1 commit intolinuxdeepin:masterfrom
qxp930712:master

Conversation

@qxp930712
Copy link

@qxp930712 qxp930712 commented Mar 17, 2026

Added boundsBehavior: Flickable.StopAtBounds to the notification list view to prevent overscrolling beyond the content boundaries. This improves the user experience by providing more natural scrolling behavior and preventing the list from bouncing when reaching the edges.

Log: Improved notification list scrolling behavior

Influence:

  1. Test scrolling to the top and bottom of the notification list
  2. Verify that list stops at boundaries without overscrolling
  3. Check that normal scrolling functionality remains intact
  4. Test with various numbers of notifications (empty, few, many)
  5. Verify behavior on different screen sizes and resolutions

PMS: BUG-324863

Summary by Sourcery

Bug Fixes:

  • Fix overscrolling behavior in the notification list so it stops at the top and bottom content edges.

Added boundsBehavior: Flickable.StopAtBounds to the notification
list view to prevent overscrolling beyond the content boundaries.
This improves the user experience by providing more natural scrolling
behavior and preventing the list from bouncing when reaching the edges.

Log: Improved notification list scrolling behavior

Influence:
1. Test scrolling to the top and bottom of the notification list
2. Verify that list stops at boundaries without overscrolling
3. Check that normal scrolling functionality remains intact
4. Test with various numbers of notifications (empty, few, many)
5. Verify behavior on different screen sizes and resolutions

PMS: BUG-324863
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 17, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adjusts the notification center ListView’s flick behavior so the notification list stops cleanly at its content bounds instead of overscrolling or bouncing at the edges.

State diagram for notification ListView scrolling with StopAtBounds

stateDiagram-v2
  title Notification_ListView_scrolling_behavior

  [*] --> IdleAtTop

  IdleAtTop --> ScrollingDown : user_drags_down
  IdleAtTop --> ScrollingUpBlocked : user_drags_up_at_top

  ScrollingDown --> IdleAtBottom : reached_bottom
  ScrollingDown --> IdleAtTop : user_scrolls_back_to_top
  ScrollingDown --> FlingDown : user_releases_while_moving_down

  FlingDown --> IdleAtBottom : reaches_bottom_with_inertia
  FlingDown --> IdleAtTop : inertia_carries_back_to_top

  IdleAtBottom --> ScrollingUp : user_drags_up
  IdleAtBottom --> ScrollingDownBlocked : user_drags_down_at_bottom

  ScrollingUp --> IdleAtTop : reached_top
  ScrollingUp --> IdleAtBottom : user_scrolls_back_to_bottom
  ScrollingUp --> FlingUp : user_releases_while_moving_up

  FlingUp --> IdleAtTop : reaches_top_with_inertia
  FlingUp --> IdleAtBottom : inertia_carries_back_to_bottom

  state ScrollingUpBlocked {
    [*] --> AtTop
    AtTop --> AtTop : further_drag_up
  }

  state ScrollingDownBlocked {
    [*] --> AtBottom
    AtBottom --> AtBottom : further_drag_down
  }

  note right of ScrollingUpBlocked
    Overscroll_past_top_prevented
    by_StopAtBounds
  end note

  note right of ScrollingDownBlocked
    Overscroll_past_bottom_prevented
    by_StopAtBounds
  end note
Loading

File-Level Changes

Change Details Files
Constrain notification list scrolling to stop at content bounds instead of overscrolling.
  • Configured the notification ListView’s Flickable bounds behavior to stop at its edges
  • Ensured scroll interaction remains otherwise unchanged, including snapping and margins, while improving UX at list boundaries
panels/notification/center/NotifyView.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

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 - 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.

@deepin-ci-robot
Copy link

deepin pr auto review

这段代码修改是在 QML 的 ListView 组件中添加了 boundsBehavior: Flickable.StopAtBounds 属性。以下是对该修改的详细审查意见:

1. 语法逻辑

  • 审查结果:正确。
  • 解释ListView 继承自 Flickable,因此使用 Flickable.StopAtBounds 枚举值是完全合法的。该属性用于控制视图在拖拽超出边界时的行为。

2. 代码质量

  • 审查结果:良好,建议统一。
  • 解释
    • 在通知中心(Notification Center)这种场景下,用户通常期望列表在滚动到顶部或底部时能够"硬性"停止,而不是产生"回弹"(Over-scroll/Bounce)效果,或者允许用户继续拖拽查看空白区域。
    • 添加 StopAtBounds 可以提供更精确的滚动手感,符合系统级 UI 的严谨性。
    • 建议:检查项目中其他类似的 ListViewGridView(例如应用列表、任务栏列表等),确保滚动行为的一致性。如果整个 UI 风格倾向于无回弹,建议将此属性推广到其他列表视图中。

3. 代码性能

  • 审查结果:无影响(或极轻微正面影响)。
  • 解释:设置 boundsBehavior 主要是改变渲染和交互逻辑,不会显著增加 CPU 或内存开销。相反,StopAtBounds 相比于默认行为(在某些平台上可能有回弹动画计算),可能会减少少量的动画计算资源消耗。

4. 代码安全

  • 审查结果:安全。
  • 解释:此修改仅涉及 UI 交互体验,不涉及数据处理、权限控制或网络请求,不存在安全风险。

总结与建议

这是一个合理且推荐的修改,能够提升通知中心列表的滚动手感,使其更加跟手和稳定。

改进建议
如果这是针对特定平台(如 Deepin/UOS)的 UI 规范修改,建议在代码中添加简短的注释,说明为何设置此属性,以便后续维护者理解这是出于 UI 规范的考虑,而非随意添加。

示例代码:

ListView {
    // ... 其他属性
    // 遵循 UI 设计规范,禁止列表滚动时的回弹效果,提供更硬朗的停止手感
    boundsBehavior: Flickable.StopAtBounds
    // ...
}

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 18def5e into linuxdeepin:master Mar 17, 2026
11 of 12 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.

4 participants