-
Notifications
You must be signed in to change notification settings - Fork 433
fix: tabbar dnd invalid #4296
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
fix: tabbar dnd invalid #4296
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options. 变更概述详细介绍该变更主要修改了
变更
可能相关的 PR
建议标签
建议审阅者
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/main-layout/src/browser/tabbar/tabbar.service.ts (1)
78-83
: 使用 Emitter 与 observableFromEventOpts 搭配更新视图的策略需关注潜在性能影响。
在equalsFn: () => false
的情况下,任何触发都会强制视图更新,但目前看符合需求。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/main-layout/src/browser/tabbar/tabbar.service.ts
(4 hunks)
🔇 Additional comments (5)
packages/main-layout/src/browser/tabbar/tabbar.service.ts (5)
44-50
: 导入可观察式工具库的改动看起来合理。
这些新增的工具类有助于统一管理可观察数据并提升代码可读性,无明显问题。
84-85
: 初始化 containerIdObs 为 undefined 时,请确认使用场景是否做了非空判断。
确保在访问该值时不会发生空指针问题。
86-96
: 通过 derivedOpts 结合 shouldChangeView 来动态更新 currentContainerId 的实现清晰可读。
此处逻辑明确,无需额外修改。
218-218
: 使用 transaction 包裹 containerIdObs.set 有利于保证状态变更的原子性。
此实现方式正确,可在需要时统一管理派生更新。
714-714
: 触发 doChangeViewEmitter.fire() 会通知所有观察者更新。
与前述可观察机制相配合,可确保拖拽事件后同步视图。
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.
LGTM
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4296 +/- ##
=======================================
Coverage 54.20% 54.21%
=======================================
Files 1634 1634
Lines 99907 99917 +10
Branches 21691 21699 +8
=======================================
+ Hits 54159 54167 +8
- Misses 38005 38007 +2
Partials 7743 7743
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Types
Background or solution
Changelog
修复 tabbar 拖拽事件失效的问题
Summary by CodeRabbit