-
Notifications
You must be signed in to change notification settings - Fork 387
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: right panel container view #4178
Conversation
Walkthrough此次更改主要集中在 Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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. 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
🧹 Outside diff range and nitpick comments (2)
packages/main-layout/src/browser/tabbar/bar.view.tsx (2)
Line range hint
116-171
: 建议优化回调函数的依赖项
renderContainers
使用了useCallback
,但依赖数组为空。函数内部使用了tabbarService
和styles
,建议将这些依赖项添加到依赖数组中。const renderContainers = React.useCallback( (component: ComponentRegistryInfo, tabbarService: TabbarService, currentContainerId?: string) => { // ... existing implementation }, - [], + [tabbarService, styles, tabClassName], );
177-177
: 建议优化代码可读性当前行包含了多个操作,建议拆分为更清晰的步骤以提高可读性。
- {visibleContainers.map((component) => renderContainers(component, tabbarService, currentContainerId))} + {visibleContainers.map((component) => { + return renderContainers(component, tabbarService, currentContainerId); + })}🧰 Tools
🪛 Biome
[error] 177-177: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
packages/ai-native/src/browser/layout/tabbar.view.tsx
(1 hunks)packages/main-layout/src/browser/tabbar/bar.view.tsx
(4 hunks)
🧰 Additional context used
🪛 Biome
packages/main-layout/src/browser/tabbar/bar.view.tsx
[error] 177-177: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.
(lint/suspicious/noAssignInExpressions)
🔇 Additional comments (3)
packages/ai-native/src/browser/layout/tabbar.view.tsx (1)
126-126
: 通过传递 tabbarService 参数修复了右侧面板显示问题
这个改动确保了每个容器都使用正确的 tabbarService 实例,解决了之前所有调用者都引用左侧实例的问题。请验证右侧面板现在是否能正确显示。
packages/main-layout/src/browser/tabbar/bar.view.tsx (2)
57-61
: 接口更新符合预期
renderContainers
函数签名的更新通过添加 tabbarService
参数解决了多实例问题,这与 PR 的目标相符。
315-319
: 类型定义更新完善
LeftTabbarRenderer
组件的类型定义更新与整体改动保持一致,确保了类型安全。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4178 +/- ##
==========================================
- Coverage 54.07% 54.06% -0.01%
==========================================
Files 1612 1612
Lines 97917 97917
Branches 20051 20043 -8
==========================================
- Hits 52944 52941 -3
- Misses 37363 37365 +2
- Partials 7610 7611 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Types
Background or solution
因为 tabbarService 是多例的,根据不同的 location 会实例化一个。
之前的代码会导致其他调用方都只会走到 left 这个 tabbarService,从而导致异常
Changelog
修复 right 面板不展示的问题
Summary by CodeRabbit