-
Notifications
You must be signed in to change notification settings - Fork 415
New bundle: left sidebar 3 tabs #1542
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
Conversation
📝 WalkthroughWalkthroughMoves ChatPanelButton from apps/desktop to packages/ui and updates consumers to pass isExpanded/togglePanel. Integrates left/right panel hooks across desktop2 header, layout, and sidebar. Reworks chat UI and main tabs header/content. Adds ScrollArea components to UI package. Extends useTabs with currentTab. Minor global CSS height tweak. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MainHeader
participant ChatPanelButton
participant RightPanelCtx as useRightPanel
participant Layout as Main Layout
User->>ChatPanelButton: Click or ⌘/Ctrl+J
ChatPanelButton->>RightPanelCtx: togglePanel()
RightPanelCtx-->>ChatPanelButton: isExpanded (updated)
RightPanelCtx-->>MainHeader: isExpanded
RightPanelCtx-->>Layout: isExpanded
alt Right panel expanded
Layout->>Layout: Render MainContent || Chat (resizable)
else Collapsed
Layout->>Layout: Render MainContent only
end
sequenceDiagram
participant User
participant LeftIcon as PanelLeft(Open/Close) Icon
participant LeftPanelCtx as useLeftSidebar
participant Layout
User->>LeftIcon: Click
LeftIcon->>LeftPanelCtx: toggle()
LeftPanelCtx-->>Layout: isExpanded
alt Left panel expanded
Layout->>Layout: Render LeftSidebar (resizable) + Main column
else Collapsed
Layout->>Layout: Render Main column only
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (3 warnings)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/desktop2/src/components/chat.tsx (1)
30-113: Prevent orphan messages when no chat is selectedWhen
currentChatGroupIdis falsy (initial load or after hitting reset), we still render the submit form. Submitting it writes a message withchat_group_id === "", so the new message is orphaned and never shows up. We need to bail out ofhandleSubmitMessagewhen no chat group is chosen (or disable the form in that state) before shipping.Please add an early return, e.g.
const handleSubmitMessage = useCallback((e: React.FormEvent<HTMLFormElement>) => { e.preventDefault(); const formData = new FormData(e.currentTarget); const message = formData.get("message"); - if (message) { + if (message && currentChatGroupId) { handleAddMessage({ user_id: "TODO", chat_group_id: currentChatGroupId,
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
apps/desktop/src/components/toolbar/bars/main-toolbar.tsx(3 hunks)apps/desktop/src/components/toolbar/buttons/chat-panel-button.tsx(0 hunks)apps/desktop2/src/components/chat.tsx(1 hunks)apps/desktop2/src/components/main/left-sidebar.tsx(4 hunks)apps/desktop2/src/components/main/main-area.tsx(7 hunks)apps/desktop2/src/hooks/useTabs.ts(1 hunks)apps/desktop2/src/routes/app/main/_layout.index.tsx(2 hunks)apps/desktop2/src/styles/globals.css(1 hunks)packages/ui/src/components/block/chat-panel-button.tsx(1 hunks)packages/ui/src/components/ui/scroll-area.tsx(1 hunks)
💤 Files with no reviewable changes (1)
- apps/desktop/src/components/toolbar/buttons/chat-panel-button.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}
⚙️ CodeRabbit configuration file
**/*.{js,ts,tsx,rs}: 1. Do not add any error handling. Keep the existing one.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".
Files:
apps/desktop2/src/hooks/useTabs.tsapps/desktop2/src/components/chat.tsxpackages/ui/src/components/block/chat-panel-button.tsxapps/desktop2/src/routes/app/main/_layout.index.tsxapps/desktop2/src/components/main/main-area.tsxpackages/ui/src/components/ui/scroll-area.tsxapps/desktop/src/components/toolbar/bars/main-toolbar.tsxapps/desktop2/src/components/main/left-sidebar.tsx
🧬 Code graph analysis (7)
apps/desktop2/src/components/chat.tsx (1)
apps/desktop2/src/tinybase/store/persisted.ts (2)
ChatGroup(114-114)ChatMessage(115-115)
packages/ui/src/components/block/chat-panel-button.tsx (2)
packages/ui/src/components/ui/button.tsx (1)
Button(37-89)packages/ui/src/lib/utils.ts (1)
cn(4-6)
apps/desktop2/src/routes/app/main/_layout.index.tsx (4)
packages/utils/src/contexts/right-panel.tsx (1)
useRightPanel(112-118)packages/utils/src/contexts/left-sidebar.tsx (1)
useLeftSidebar(42-48)apps/desktop2/src/components/main/left-sidebar.tsx (1)
LeftSidebar(16-67)apps/desktop2/src/components/main/main-area.tsx (1)
MainHeader(26-82)
apps/desktop2/src/components/main/main-area.tsx (4)
packages/utils/src/contexts/right-panel.tsx (1)
useRightPanel(112-118)packages/utils/src/contexts/left-sidebar.tsx (1)
useLeftSidebar(42-48)packages/ui/src/components/block/chat-panel-button.tsx (1)
ChatPanelButton(7-37)apps/desktop2/src/hooks/useTabs.ts (1)
useTabs(4-77)
packages/ui/src/components/ui/scroll-area.tsx (1)
packages/ui/src/lib/utils.ts (1)
cn(4-6)
apps/desktop/src/components/toolbar/bars/main-toolbar.tsx (2)
packages/utils/src/contexts/right-panel.tsx (1)
useRightPanel(112-118)packages/ui/src/components/block/chat-panel-button.tsx (1)
ChatPanelButton(7-37)
apps/desktop2/src/components/main/left-sidebar.tsx (2)
packages/utils/src/contexts/left-sidebar.tsx (1)
useLeftSidebar(42-48)apps/desktop2/src/hooks/useTabs.ts (1)
useTabs(4-77)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: ci (windows, windows-latest)
- GitHub Check: ci (macos, macos-14)
🔇 Additional comments (1)
apps/desktop2/src/routes/app/main/_layout.index.tsx (1)
82-107: Layout refactor looks consistent.
Conditional left/right panels, sizing, and nested groups are wired coherently with the new contexts. Nice work.
No description provided.