Revert "fix: set focus to search edit when launcher becomes visible"#732
Revert "fix: set focus to search edit when launcher becomes visible"#732Ivy233 wants to merge 1 commit intolinuxdeepin:masterfrom
Conversation
This reverts commit a8dd424.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ivy233 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 |
|
CLA Assistant Lite bot: You can retrigger this bot by commenting recheck in this Pull Request |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReverts the previous behavior that automatically focused the search input when the launcher became visible, while keeping the cleanup logic that runs when the launcher is hidden. Sequence diagram for launcher visibility change and search edit cleanupsequenceDiagram
actor User
participant LauncherController
participant WindowedFrame
participant FullscreenFrame
participant WindowedSearchEdit as Windowed_searchEdit
participant FullscreenSearchEdit as Fullscreen_searchEdit
User->>LauncherController: showLauncher()
LauncherController-->>LauncherController: visible = true
LauncherController-->>WindowedFrame: onVisibleChanged()
LauncherController-->>FullscreenFrame: onVisibleChanged()
Note over WindowedSearchEdit,FullscreenSearchEdit: After revert, no automatic focus when visible becomes true
User->>LauncherController: hideLauncher()
LauncherController-->>LauncherController: visible = false
LauncherController-->>WindowedFrame: onVisibleChanged()
WindowedFrame->>WindowedSearchEdit: text = ""
WindowedFrame->>WindowedSearchEdit: clearFocus()
LauncherController-->>FullscreenFrame: onVisibleChanged()
FullscreenFrame->>FullscreenSearchEdit: text = ""
FullscreenFrame->>FullscreenSearchEdit: clearFocus()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
onVisibleChangedhandlers inWindowedFrame.qmlandFullscreenFrame.qmlnow contain nearly identical visibility guards and cleanup logic; consider extracting this into a shared helper or utility to avoid future divergence between the two implementations.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `onVisibleChanged` handlers in `WindowedFrame.qml` and `FullscreenFrame.qml` now contain nearly identical visibility guards and cleanup logic; consider extracting this into a shared helper or utility to avoid future divergence between the two implementations.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review这段代码主要对启动器(Launcher)在可见性变化时的处理逻辑进行了简化。以下是对这段 diff 的详细审查意见: 1. 代码逻辑审查观察: if (LauncherController.visible) {
searchEdit.forceActiveFocus() // 或 bottomBar.searchEdit.forceActiveFocus()
return
}简化为了: if (LauncherController.visible) return问题: 建议: 2. 代码质量与风格优点:
改进建议: 3. 代码性能
4. 代码安全
总结与修改建议这段代码修改虽然在语法上没有错误,且在结构上更加简洁,但破坏了原有的交互逻辑(自动聚焦搜索框)。 建议方案: 如果目的是为了优化代码结构(减少嵌套),建议保留 对于 Connections {
target: LauncherController
function onVisibleChanged() {
if (LauncherController.visible) {
searchEdit.forceActiveFocus()
return
}
// only do these clean-up steps on launcher get hide
searchEdit.text = ""
if (listviewPage.currentItem) {
// ... 后续清理逻辑
}
}
}对于 Connections {
target: LauncherController
function onVisibleChanged() {
if (LauncherController.visible) {
bottomBar.searchEdit.forceActiveFocus()
return
}
// only do these clean-up steps on launcher get hide
bottomBar.searchEdit.text = ""
// ... 后续清理逻辑
}
}结论: 请回滚该改动,或者提供删除 |
Reverts #729
Summary by Sourcery
Bug Fixes: