Skip to content

feat(desktop): consolidate comment pane headers#3803

Merged
saddlepaddle merged 1 commit into
mainfrom
consolidate-comment-heade
Apr 27, 2026
Merged

feat(desktop): consolidate comment pane headers#3803
saddlepaddle merged 1 commit into
mainfrom
consolidate-comment-heade

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Apr 27, 2026

Summary

  • Comment panes had two stacked headers showing duplicate avatar + author. Consolidated into the pane header.
  • Title slot now renders avatar + author + path:line (muted, truncates).
  • Header extras: GitHub link first (icon-only with "Open on GitHub" tooltip), then Copy button (icon-only with tooltip), matching the existing pane-header button pattern (e.g. TerminalHeaderExtras, FilePaneHeaderExtras).
  • In-content header removed; pane content is just the markdown article.

Test plan

  • Open a comment pane — verify only one header is visible
  • Verify avatar, author, and path:line render in the pane header (long paths truncate)
  • Hover GitHub icon → "Open on GitHub" tooltip; click opens the comment URL
  • Hover Copy icon → "Copy comment" tooltip; click copies body and shows ✓ for ~1.5s
  • Comment with no url hides the GitHub button entirely
  • Active vs inactive pane styling on the title still toggles foreground/muted color

Summary 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.

  • Refactors
    • Added CommentPaneTitle and CommentPaneHeaderExtras.
    • GitHub link is icon-only with “Open on GitHub” tooltip; hidden when no url.
    • Copy is icon-only with tooltip; shows a check for ~1.5s after copying.
    • Removed the in-content header; pane body now only renders the markdown. Long paths truncate; active titles use foreground color.

Written for commit d66a9a0. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features

    • Added button to copy comment text to clipboard
    • Added quick-access link to GitHub issue source for comments
  • Refactor

    • Reorganized comment pane layout with improved component structure and separation of concerns

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.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR consolidates the duplicate avatar + author header in CommentPane into the shared pane header by introducing two new components — CommentPaneTitle (avatar + author + path:line) and CommentPaneHeaderExtras (GitHub link + Copy button) — and wires them into the pane registry, removing the in-content header entirely. The refactoring aligns with patterns already established by TerminalHeaderExtras and FilePaneHeaderExtras.

Confidence Score: 5/5

Safe 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 renderTitle/renderHeaderExtras slots. No logic is altered (same isMountedRef guard, same 1.5s timer, same conditional URL rendering). Unused imports are correctly pruned. No P0/P1 findings.

No files require special attention.

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "feat(desktop): consolidate comment pane ..." | Re-trigger Greptile

@saddlepaddle saddlepaddle merged commit 298d773 into main Apr 27, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7c40e24-2104-4cba-b150-b2115154c7ab

📥 Commits

Reviewing files that changed from the base of the PR and between 790cbbc and d66a9a0.

📒 Files selected for processing (6)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/CommentPane.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/components/CommentPaneHeaderExtras/CommentPaneHeaderExtras.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/components/CommentPaneHeaderExtras/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/components/CommentPaneTitle/CommentPaneTitle.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/CommentPane/components/CommentPaneTitle/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/usePaneRegistry.tsx

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
CommentPane Simplification
CommentPane.tsx
Removed "Copy All" button, author/path header, and associated state management (mounted, timer, handleCopyAll). Component now renders only markdown body content.
New Title Component
CommentPaneTitle.tsx, CommentPaneTitle/index.ts
New component rendering pane title with avatar image or message icon, author login (with active state coloring), and optional truncated path label with line number tooltip.
New Header Extras Component
CommentPaneHeaderExtras.tsx, CommentPaneHeaderExtras/index.ts
New component with GitHub icon link (conditionally displayed via tooltip) and copy-comment button. Copy action triggers Electron TRPC mutation, displays checkmark on success, and reverts after 1500ms with mounted/timeout cleanup.
Registry Integration
usePaneRegistry.tsx
Updated comment pane configuration to delegate header and title rendering to new components via renderTitle and renderHeaderExtras. Removed unused icon imports.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hop, hop! Components split with care,
Title and extras float through the air!
Copy buttons click with checkmark cheer,
Refactored code—now crystal clear!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch consolidate-comment-heade

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant