feat(desktop): consolidate comment pane headers#3803
Conversation
Move avatar, author, and path:line into the pane header title slot, and move the GitHub link + Copy button into the header extras alongside the existing close action. Drops the in-content header that previously duplicated avatar/author and only added path:line + Copy.
Greptile SummaryThis PR consolidates the duplicate avatar + author header in Confidence Score: 5/5Safe to merge — clean structural refactor with no logic regressions. All changes are structural: moving existing copy/GitHub logic into dedicated components and wiring them via the pane registry's No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/CommentPane.tsx | In-content header stripped; component now renders only the markdown article with minor layout tweaks (added min-w-0). Unused imports (Avatar, LuCopy) correctly removed; remaining hooks are still consumed by CopyableTable. |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/components/CommentPaneHeaderExtras/CommentPaneHeaderExtras.tsx | New component: renders conditional GitHub link (icon-only, hidden when no url) and always-visible Copy button with tooltip and 1.5s feedback. Correctly migrates the copy state/timer from the old CommentPane header; isMountedRef guard and cleanup are preserved. |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/components/CommentPaneTitle/CommentPaneTitle.tsx | New component: renders avatar img (or MessageSquare fallback), author span (active/inactive color), and optional truncated path:line span with tooltip. Layout follows the existing title-slot pattern. |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/usePaneRegistry.tsx | Registry updated to use renderTitle with CommentPaneTitle and simplified renderHeaderExtras with CommentPaneHeaderExtras; old inline GitHub anchor and unused FaGithub/LuArrowUpRight imports removed cleanly. |
Sequence Diagram
sequenceDiagram
participant Registry as usePaneRegistry
participant Header as PaneHeader
participant TitleComp as CommentPaneTitle
participant ExtrasComp as CommentPaneHeaderExtras
participant ContentComp as CommentPane
Registry->>Header: renderTitle
Header->>TitleComp: render context
TitleComp-->>Header: avatar + authorLogin + path line
Registry->>Header: renderHeaderExtras
Header->>ExtrasComp: render context
ExtrasComp-->>Header: GitHub link and Copy button
Registry->>ContentComp: renderPane
ContentComp-->>Registry: markdown article only
Reviews (1): Last reviewed commit: "feat(desktop): consolidate comment pane ..." | Re-trigger Greptile
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis refactoring extracts CommentPane UI rendering logic into dedicated components. CommentPaneTitle handles title rendering with avatar/author information and optional path labels. CommentPaneHeaderExtras manages the GitHub link and copy-comment button with visual feedback. CommentPane itself is simplified to focus on body rendering only. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
path:line(muted, truncates).TerminalHeaderExtras,FilePaneHeaderExtras).Test plan
path:linerender in the pane header (long paths truncate)urlhides the GitHub button entirelySummary by cubic
Consolidated the Comment pane into a single header for a cleaner, consistent UI. Avatar, author, and path:line moved to the pane title; GitHub and Copy actions moved into header extras.
CommentPaneTitleandCommentPaneHeaderExtras.url.Written for commit d66a9a0. Summary will update on new commits. Review in cubic
Summary by CodeRabbit
New Features
Refactor