Skip to content

fix: Update message display and toolbar behavior in WebEngineView.qml…#328

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/snipefrom
dengzhongyuan365-dev:bug-fix-342693
Jan 6, 2026
Merged

fix: Update message display and toolbar behavior in WebEngineView.qml…#328
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/snipefrom
dengzhongyuan365-dev:bug-fix-342693

Conversation

@dengzhongyuan365-dev
Copy link

… and index.js

  • Changed the message display to show on the rootItem instead of webView to prevent display issues during scrolling.
  • Added functionality to hide the floating toolbar when the menu is closed, enhancing user interface responsiveness.
  • Updated the showRightMenu function to use viewport coordinates, improving the accuracy of toolbar positioning.

These changes improve the overall user experience by ensuring consistent message visibility and toolbar behavior.

bug:https://pms.uniontech.com/bug-view-342199.html

… and index.js

- Changed the message display to show on the rootItem instead of webView to prevent display issues during scrolling.
- Added functionality to hide the floating toolbar when the menu is closed, enhancing user interface responsiveness.
- Updated the showRightMenu function to use viewport coordinates, improving the accuracy of toolbar positioning.

These changes improve the overall user experience by ensuring consistent message visibility and toolbar behavior.

bug:https://pms.uniontech.com/bug-view-342199.html
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengzhongyuan365-dev

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-ci-robot
Copy link

deepin pr auto review

我来对这段代码变更进行详细分析:

  1. 代码变更概述:
  • 在WebEngineView.qml中添加了菜单关闭时隐藏悬浮工具栏的逻辑
  • 在index.js中修改了setMenuPosition函数中工具栏坐标的计算方式
  1. 具体分析:

WebEngineView.qml变更:

onClosed: {
    // 菜单关闭时隐藏悬浮工具栏
    Webobj.callJsHideEditToolbar();
}

优点:

  • 添加了必要的清理逻辑,确保菜单关闭时工具栏也被隐藏
  • 避免了工具栏可能出现的残留显示问题

建议改进:

  • 可以添加错误处理机制,防止callJsHideEditToolbar调用失败
onClosed: {
    try {
        Webobj.callJsHideEditToolbar();
    } catch(e) {
        console.error("Failed to hide edit toolbar:", e);
    }
}

index.js变更:

// 显示工具栏(传入视口坐标,rightUpdate 内部会添加滚动偏移)
showRightMenu(toolbarX, toolbarY);

优点:

  • 简化了坐标计算逻辑
  • 将滚动偏移的处理移到了rightUpdate内部,提高了代码的内聚性

潜在问题:

  • 需要确保rightUpdate函数确实正确处理了滚动偏移
  • 建议在rightUpdate函数中添加注释说明滚动偏移的处理逻辑

建议改进:

// 显示工具栏(传入视口坐标)
showRightMenu(toolbarX, toolbarY);
  1. 整体评价:
    这次变更提高了代码的可维护性,将坐标计算的职责更加明确地划分。但需要注意:
  • 添加适当的错误处理机制
  • 确保相关函数文档更新
  • 建议添加单元测试验证工具栏显示/隐藏的正确性
  1. 性能考虑:
  • 变更对性能影响很小
  • 建议监控工具栏显示/隐藏操作的性能表现
  1. 安全考虑:
  • 没有明显的安全问题
  • 建议验证Webobj.callJsHideEditToolbar的调用权限控制

这些变更总体上是合理的,但建议实施上述改进措施以提高代码的健壮性。

@dengzhongyuan365-dev
Copy link
Author

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Jan 6, 2026

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit b70dc01 into linuxdeepin:develop/snipe Jan 6, 2026
15 of 17 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