fix(ui/sidebar):correct-sidebar-position - #6546
Conversation
WalkthroughThe Sidebar component derives left or right placement from the application direction context, removing ChangesSidebar direction handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/src/components/ui/sidebar.tsx`:
- Around line 179-183: Update the Sidebar props type to omit the inherited dir
attribute from React.ComponentProps<'div'>, while preserving the component’s
existing internal direction handling and all other div props.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 87f6c209-6512-43ef-a6c5-15a672a666c9
📒 Files selected for processing (1)
web/src/components/ui/sidebar.tsx
9d6e022 to
c6f8c02
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
web/src/components/ui/sidebar.tsx (1)
179-183: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winOmit the inherited
dirprop fromSidebarprops.
React.ComponentProps<'div'>still exposes the standard HTMLdirattribute, so callers can pass it even though placement is now controlled byuseDirection(). UseOmit<React.ComponentProps<'div'>, 'dir'>to enforce the intended public contract. This is the same unresolved issue raised in the previous review.Suggested fix
-}: React.ComponentProps<'div'> & { +}: Omit<React.ComponentProps<'div'>, 'dir'> & {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/src/components/ui/sidebar.tsx` around lines 179 - 183, Update the Sidebar props type to use Omit<React.ComponentProps<'div'>, 'dir'>, removing the inherited dir attribute while preserving all other div props and the existing variant and collapsible options.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@web/src/components/ui/sidebar.tsx`:
- Around line 179-183: Update the Sidebar props type to use
Omit<React.ComponentProps<'div'>, 'dir'>, removing the inherited dir attribute
while preserving all other div props and the existing variant and collapsible
options.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 996d5426-42e0-4b71-9556-aa8a209c6a78
📒 Files selected for processing (1)
web/src/components/ui/sidebar.tsx
📝 变更描述 / Description
移除 Sidebar 未实际使用的 side/dir props,改为从 DirectionContext 读取 dir 并推导 side
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
修复前

修复后

Summary by CodeRabbit
Bug Fixes
Improvements