feat: improve app list focus behavior and styling#659
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReorganizes key event handlers and introduces simplified focus styling and management to improve focus behavior and navigation in the application list. Sequence diagram for improved app launch key handlingsequenceDiagram
participant User as actor User
participant AppListView
participant AppItem
User->>AppListView: Presses Return or Space key
AppListView->>AppItem: launchApp(desktopId)
Class diagram for updated menu item background stylingclassDiagram
class MenuItem {
+text: string
+palette: Palette
+down: bool
+hovered: bool
+visualFocus: bool
}
class FocusBoxBorder {
+color: Color
+visible: bool
+anchors: Anchors
+margins: int
}
MenuItem "1" -- "1" FocusBoxBorder : background
class BoxPanel {
+outsideBorderColor: Color
+insideBorderColor: Color
+radius: int
+background: Palette
+color1: Color
+color2: Color
}
%% BoxPanel removed as background for MenuItem
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Add a null check before calling currentItem.forceActiveFocus() to avoid runtime errors when the list is empty or no item is present.
- Double-check the FocusBoxBorder anchors.margins change from 2px to 4px against the design spec to ensure the new styling aligns with overall UI layout.
- Consider extracting the Keys.onReturnPressed and Keys.onSpacePressed handlers into a shared component or delegate helper to avoid duplication and keep keyboard behavior consistent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Add a null check before calling currentItem.forceActiveFocus() to avoid runtime errors when the list is empty or no item is present.
- Double-check the FocusBoxBorder anchors.margins change from 2px to 4px against the design spec to ensure the new styling aligns with overall UI layout.
- Consider extracting the Keys.onReturnPressed and Keys.onSpacePressed handlers into a shared component or delegate helper to avoid duplication and keep keyboard behavior consistent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
ec28fbd to
9d1ce69
Compare
1. Move Keys.onReturnPressed and Keys.onSpacePressed outside of the button delegate to fix scope issues 2. Replace complex BoxPanel background with FocusBoxBorder for menu items, simplifying styling and improving focus visibility 3. Add forceActiveFocus() call when list gains active focus to ensure proper focus management 4. Change category type change behavior from positionViewAtBeginning to setting currentIndex to 0 for better navigation 5. Simplify ItemBackground focus condition by removing focusPolicy check feat: 改进应用列表焦点行为和样式 1. 将 Keys.onReturnPressed 和 Keys.onSpacePressed 移出按钮委托以修复作用 域问题 2. 使用 FocusBoxBorder 替换复杂的 BoxPanel 背景,简化样式并改进焦点可 见性 3. 在列表获得活动焦点时添加 forceActiveFocus() 调用以确保正确的焦点管理 4. 将类别类型更改行为从 positionViewAtBeginning 改为设置 currentIndex 为 0,改善导航体验 5. 通过移除 focusPolicy 检查简化 ItemBackground 焦点条件 PMS: BUG-334167
9d1ce69 to
a115ff3
Compare
deepin pr auto review我对这个代码差异进行审查,发现了一些可以改进的地方:
总体而言,这些修改大部分是积极的,特别是性能优化方面的改进。但需要注意事件处理逻辑的改变可能带来的影响,并确保相关功能仍然正常工作。 |
18202781743
approved these changes
Oct 14, 2025
|
[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. 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.
feat: 改进应用列表焦点行为和样式
PMS: BUG-334167
Summary by Sourcery
Improve focus behavior and styling in the app list view by fixing key event scope, streamlining background styling, and enhancing focus navigation.
Bug Fixes:
Enhancements: