-
Notifications
You must be signed in to change notification settings - Fork 55
fix: Fixed tab key navigation issue in notification center #1259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The changes address the tab key navigation issue in the notification center where pressing tab couldn't close notifications. The main fix involves converting NotifyItem from Control to FocusScope to properly handle focus management. Additionally, all notification components (GroupNotify, NormalNotify, OverlapNotify, NotifyItemContent) were wrapped in Control containers with proper implicit size properties to ensure consistent focus behavior. The close button visibility logic was updated to use activeFocus instead of hovered state for better keyboard navigation support. Log: Fixed tab key navigation issue in notification center Influence: 1. Test tab navigation through notification items 2. Verify close button appears with keyboard focus 3. Test Enter/Return key functionality on notifications 4. Verify mouse interactions still work correctly 5. Test notification dismissal with keyboard shortcuts fix: 修复通知中心Tab键焦点问题 此次修改解决了通知中心中按Tab键无法关闭通知的问题。主要修复包括将 NotifyItem从Control转换为FocusScope以正确处理焦点管理。此外,所有通知组 件(GroupNotify、NormalNotify、OverlapNotify、NotifyItemContent)都被包 装在Control容器中,并设置了适当的隐式大小属性以确保一致的焦点行为。关闭 按钮的可见性逻辑更新为使用activeFocus而不是hovered状态,以提供更好的键盘 导航支持。 Log: 修复通知中心Tab键导航问题 Influence: 1. 测试通过通知项的Tab导航 2. 验证关闭按钮是否随键盘焦点出现 3. 测试Enter/Return键在通知上的功能 4. 验证鼠标交互是否仍然正常工作 5. 测试使用键盘快捷键关闭通知 PMS: BUG-311333
Reviewer's GuideThis PR refactors focus and keyboard navigation in the notification center by converting NotifyItem to a FocusScope root, wrapping notification content in Control containers with implicit sizing, switching close button visibility to rely on activeFocus, adding Enter/Return key handlers for expansion, and fixing a border radius reference. Sequence diagram for notification close button visibility logic changesequenceDiagram
participant User as actor
participant NotifyItemContent
participant CloseButton
User->>NotifyItemContent: Tab to notification item
NotifyItemContent->>CloseButton: Set visible if activeFocus
User->>CloseButton: Press Enter/Return to close notification
CloseButton->>NotifyItemContent: Trigger remove/dismiss
Updated class diagram for notification components focus managementclassDiagram
class NotifyItem {
<<FocusScope>>
+enum CloseReason
// Now inherits FocusScope instead of Control
}
class NotifyItemContent {
+bool closeVisible (now uses activeFocus)
+int miniContentHeight
+bool enableDismissed
+implicitWidth
+implicitHeight
// Wrapped in Control for focus/size
}
class GroupNotify {
+implicitWidth
+implicitHeight
// Wrapped in Control for focus/size
}
class NormalNotify {
+implicitWidth
+implicitHeight
// Wrapped in Control for focus/size
}
class OverlapNotify {
+implicitWidth
+implicitHeight
// Wrapped in Control for focus/size
}
NotifyItem <|-- NotifyItemContent
NotifyItem <|-- GroupNotify
NotifyItem <|-- NormalNotify
NotifyItem <|-- OverlapNotify
NotifyItemContent o-- Control
GroupNotify o-- Control
NormalNotify o-- Control
OverlapNotify o-- Control
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
The changes address the tab key navigation issue in the notification
center where pressing tab couldn't close notifications. The main fix
involves converting NotifyItem from Control to FocusScope to properly
handle focus management. Additionally, all notification components
(GroupNotify, NormalNotify, OverlapNotify, NotifyItemContent) were
wrapped in Control containers with proper implicit size properties to
ensure consistent focus behavior. The close button visibility logic was
updated to use activeFocus instead of hovered state for better keyboard
navigation support.
Log: Fixed tab key navigation issue in notification center
Influence:
fix: 修复通知中心Tab键焦点问题
此次修改解决了通知中心中按Tab键无法关闭通知的问题。主要修复包括将
NotifyItem从Control转换为FocusScope以正确处理焦点管理。此外,所有通知组
件(GroupNotify、NormalNotify、OverlapNotify、NotifyItemContent)都被包
装在Control容器中,并设置了适当的隐式大小属性以确保一致的焦点行为。关闭
按钮的可见性逻辑更新为使用activeFocus而不是hovered状态,以提供更好的键盘
导航支持。
Log: 修复通知中心Tab键导航问题
Influence:
PMS: BUG-311333
Summary by Sourcery
Improve keyboard navigation in the notification center by refactoring focus management, wrapping components for consistent sizing, and updating close button visibility logic to support Tab and Enter/Return key interactions
New Features:
Enhancements: