Skip to content

feat: fix notification center height calculation for bottom dock#1540

Merged
wjyrich merged 1 commit intolinuxdeepin:masterfrom
wjyrich:fix-bug-353613
Apr 8, 2026
Merged

feat: fix notification center height calculation for bottom dock#1540
wjyrich merged 1 commit intolinuxdeepin:masterfrom
wjyrich:fix-bug-353613

Conversation

@wjyrich
Copy link
Copy Markdown
Contributor

@wjyrich wjyrich commented Mar 31, 2026

  1. Fixed height calculation for notification center when dock is positioned at bottom
  2. Changed from using static dockSize to dynamic calculation based on visible screen space
  3. Added logic to calculate visible height between dock top and screen bottom
  4. Ensures notification center doesn't extend beyond visible screen area

Log: Fixed notification center display issue when dock is at bottom of screen

Influence:

  1. Test notification center with dock positioned at bottom of screen
  2. Verify notification center height adapts correctly to screen boundaries
  3. Test with multiple screen configurations and resolutions
  4. Verify notification center doesn't extend beyond visible screen area
  5. Test with dock at different positions (left, right, top) to ensure no regression

feat: 修复底部停靠栏时通知中心高度计算问题

  1. 修复当停靠栏位于底部时通知中心的高度计算问题
  2. 从使用静态dockSize改为基于可见屏幕空间的动态计算
  3. 添加计算停靠栏顶部到屏幕底部可见高度的逻辑
  4. 确保通知中心不会超出可见屏幕区域

Log: 修复停靠栏位于屏幕底部时通知中心显示问题

Influence:

  1. 测试停靠栏位于屏幕底部时的通知中心显示
  2. 验证通知中心高度是否正确适应屏幕边界
  3. 测试多种屏幕配置和分辨率下的表现
  4. 验证通知中心不会超出可见屏幕区域
  5. 测试停靠栏在不同位置(左、右、顶部)确保没有回归问题

PMS: BUG-353613
T#

Summary by Sourcery

Bug Fixes:

  • Correct notification center height when the dock is positioned at the bottom so it stays within the visible screen area.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 31, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the notification center’s height calculation for bottom-docked panels to use the actual visible screen space instead of a fixed dock size, preventing the notification center from extending beyond the screen.

File-Level Changes

Change Details Files
Recalculate dock-related dimension for bottom-docked configuration based on visible screen height instead of static dock size.
  • In the DOCK_BOTTOM branch, replaced use of dockApplet.dockSize with a calculated visible height from the dock’s top edge to the bottom of the screen.
  • Clamped the visible height to be non-negative using Math.max(0, ...).
  • Limited the effective height to not exceed the dock’s actual height using Math.min(visibleHeight, dockGeometry.height).
panels/notification/center/package/main.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
Copy Markdown

@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 left some high level feedback:

  • Consider adding a short comment explaining the visibleHeight calculation (why Math.max(0, screenGeometry.y + screenGeometry.height - dockGeometry.y) is needed) to make the intent clear for future maintainers.
  • If other dock positions (e.g., top) need similar visible-area-based sizing, consider extracting a small helper for visible dimension calculation to keep the layout logic consistent and avoid duplicating geometry math.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a short comment explaining the `visibleHeight` calculation (why `Math.max(0, screenGeometry.y + screenGeometry.height - dockGeometry.y)` is needed) to make the intent clear for future maintainers.
- If other dock positions (e.g., top) need similar visible-area-based sizing, consider extracting a small helper for visible dimension calculation to keep the layout logic consistent and avoid duplicating geometry math.

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
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 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

@deepin-bot
Copy link
Copy Markdown

deepin-bot bot commented Apr 7, 2026

TAG Bot

New tag: 2.0.35
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1545

@deepin-bot
Copy link
Copy Markdown

deepin-bot bot commented Apr 7, 2026

TAG Bot

New tag: 2.0.36
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1547

@wjyrich wjyrich force-pushed the fix-bug-353613 branch 2 times, most recently from a83fcba to 7adc530 Compare April 8, 2026 02:22
1. Fixed height calculation for notification center when dock is
positioned at bottom
2. Changed from using static dockSize to dynamic calculation based on
visible screen space
3. Added logic to calculate visible height between dock top and screen
bottom
4. Ensures notification center doesn't extend beyond visible screen area

Log: Fixed notification center display issue when dock is at bottom
of screen

Influence:
1. Test notification center with dock positioned at bottom of screen
2. Verify notification center height adapts correctly to screen
boundaries
3. Test with multiple screen configurations and resolutions
4. Verify notification center doesn't extend beyond visible screen area
5. Test with dock at different positions (left, right, top) to ensure
no regression

feat: 修复底部停靠栏时通知中心高度计算问题

1. 修复当停靠栏位于底部时通知中心的高度计算问题
2. 从使用静态dockSize改为基于可见屏幕空间的动态计算
3. 添加计算停靠栏顶部到屏幕底部可见高度的逻辑
4. 确保通知中心不会超出可见屏幕区域

Log: 修复停靠栏位于屏幕底部时通知中心显示问题

Influence:
1. 测试停靠栏位于屏幕底部时的通知中心显示
2. 验证通知中心高度是否正确适应屏幕边界
3. 测试多种屏幕配置和分辨率下的表现
4. 验证通知中心不会超出可见屏幕区域
5. 测试停靠栏在不同位置(左、右、顶部)确保没有回归问题

PMS: BUG-353613
T#
@wjyrich wjyrich merged commit 140b946 into linuxdeepin:master Apr 8, 2026
10 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.

3 participants