Skip to content

feat(desktop): v1 review comments open in a pane like v2#3596

Merged
AviPeltz merged 4 commits into
mainfrom
charming-blinker
Apr 22, 2026
Merged

feat(desktop): v1 review comments open in a pane like v2#3596
AviPeltz merged 4 commits into
mainfrom
charming-blinker

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented Apr 20, 2026

Summary

  • Clicking a review comment in v1's ReviewPanel now opens the comment as a full pane (rendered markdown, code blocks, tables, copy-all button) — matching v2's behavior. Previously the row click opened the GitHub URL; that action is preserved as the separate arrow-up-right icon on each row.
  • Ports v2's CommentPane into v1's TabView, wrapped in v1's BasePaneWindow so it participates in split/close/focus like any other pane.
  • Adds a "comment" pane type to the v1 tabs store — new CommentPaneState on Pane, createCommentPane/createCommentTabWithPane helpers, and an openCommentPane store action that reuses an existing comment pane per workspace (or opens a new tab).

Test plan

  • Open v1 workspace with an active PR → Review tab
  • Click a comment → opens a new tab with a comment pane showing the full body
  • Click a second comment → reuses the existing comment pane (no new tab)
  • "Open on GitHub" icon on the comment row still opens the PR comment in browser
  • Copy All button inside the comment pane copies the raw body
  • Pane supports split/close/move like other panes
  • Resolve/unresolve and "Copy" row actions still work

Summary by cubic

v1 now opens review comments in a dedicated pane, matching v2. Clicking a row shows the full comment in-app; the arrow icon still opens GitHub.

  • New Features

    • Added CommentPane to TabView with markdown rendering (code, tables, Mermaid) and a “Copy All” action.
    • Introduced comment pane type and an openCommentPane store action that reuses a single comment pane per workspace.
    • Toolbar shows the author’s avatar, path/line, and a GitHub link; pane supports split, close, and focus.
    • Updated ReviewPanel row click to open the pane; the external link action remains on the arrow-up-right icon.
  • Bug Fixes

    • When reusing an existing comment pane, the tab name now updates to match the selected comment’s author.

Written for commit 41b8f6c. Summary will update on new commits.

Summary by CodeRabbit

  • New Features
    • Dedicated comment pane with rich, styled markdown viewer and empty-state when nothing is selected
    • Inline pane renaming, author avatar/fallback, optional external link, and header showing path/line
    • Markdown supports code blocks, tables and Mermaid diagrams with themed rendering
    • One-click “Copy All” for comment body and per-table copy with transient “Copied” feedback
    • Open/reuse comment panes directly from the review panel and tab view routing for comments

Clicking a review comment in v1's ReviewPanel now opens it as a full
pane rendering the comment body (markdown, code blocks, tables), instead
of opening the GitHub URL. The "Open on GitHub" action remains as a
separate icon in the comment row.

Adds a "comment" pane type to the v1 tabs store (shared types,
createCommentPane/createCommentTabWithPane helpers, openCommentPane
action that reuses an existing comment pane per workspace) and a new
CommentPane view wired into TabView alongside file/chat/browser panes.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

Adds a new CommentPane UI and stylesheet, integrates it into TabView, exposes an openCommentPane store action to open/reuse comment panes from ReviewPanel, and introduces tab/store utilities and types to support comment panes.

Changes

Cohort / File(s) Summary
Comment Pane component
apps/desktop/src/renderer/screens/main/components/.../CommentPane/CommentPane.tsx, apps/desktop/src/renderer/screens/main/components/.../CommentPane/comment-pane.css, apps/desktop/src/renderer/screens/main/components/.../CommentPane/index.ts
New CommentPane React component and CSS. Renders markdown with remark-gfm/rehype, custom code/table renderers (Mermaid via Streamdown, Prism), copy-to-clipboard for comment body and tables, author metadata, pane rename, and lifecycle cleanup.
TabView integration
apps/desktop/src/renderer/screens/main/components/.../TabView/index.tsx
TabView now recognizes paneInfo.type === "comment" and renders CommentPane with existing pane props.
ReviewPanel changes
apps/desktop/src/renderer/screens/main/components/.../ReviewPanel/ReviewPanel.tsx
Replaces comment link/content with a button that calls openCommentPane(...) to open or reuse a comment pane; preserves external "open on GitHub" link.
Tabs store: API & logic
apps/desktop/src/renderer/stores/tabs/store.ts, apps/desktop/src/renderer/stores/tabs/types.ts, apps/desktop/src/renderer/stores/tabs/utils.ts
Adds openCommentPane(workspaceId, comment) store action that reuses or creates comment panes/tabs, returns {tabId,paneId}, emits analytics for new panes, and adds helpers createCommentPane / createCommentTabWithPane. Also adds CommentPaneData type.
Shared tab types
apps/desktop/src/shared/tabs-types.ts
Extends PaneType with "comment", adds optional comment?: CommentPaneState to Pane, and introduces exported CommentPaneState shape.

Sequence Diagram

sequenceDiagram
    actor User
    participant ReviewPanel as "ReviewPanel"
    participant TabsStore as "TabsStore"
    participant TabView as "TabView"
    participant CommentPane as "CommentPane"

    User->>ReviewPanel: click "open comment" button
    ReviewPanel->>TabsStore: openCommentPane(workspaceId, comment)

    alt reuse existing comment pane
        TabsStore->>TabsStore: find & update existing comment pane, activate pane
    else create new comment pane
        TabsStore->>TabsStore: createCommentTabWithPane(workspaceId, comment)
        TabsStore->>TabsStore: append tab & pane, update active/focused ids
        TabsStore->>TabsStore: emit posthog "panel_opened"
    end

    TabsStore-->>ReviewPanel: return {tabId, paneId}
    TabView->>TabView: detect pane type "comment" on active pane
    TabView->>CommentPane: render with comment data
    CommentPane-->>User: display markdown, Mermaid, code, tables, and copy actions
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I found a pane where comments bloom and play,
Markdown hops, mermaid diagrams sway,
Tables copy-ready, code snippets shine,
Open, rename, and view each review in line,
A tiny rabbit cheers: "Pane—hooray!" 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(desktop): v1 review comments open in a pane like v2' clearly summarizes the main change: enabling v1 review comments to open in a dedicated pane matching v2 behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description provides a comprehensive summary of changes, test plan, and related issues, following the template structure with clear sections.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 charming-blinker

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.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 20, 2026

Greptile Summary

This PR brings v1's ReviewPanel in line with v2's behavior: clicking a review comment now opens it as a full-featured markdown pane (with syntax highlighting, mermaid diagrams, copyable tables, and a copy-all button) instead of navigating to GitHub. The GitHub link is preserved as an arrow-up-right icon in each row's hover action bar. The implementation is clean and follows all established patterns in the codebase.

Key changes:

  • New CommentPane component ported from v2, wrapped in BasePaneWindow so it participates in split/close/focus like other panes
  • Adds "comment" to the PaneType union and CommentPaneState to the shared Pane interface
  • openCommentPane store action implements a "reuse-or-create" strategy — one comment pane per workspace is updated in place rather than spawning a new tab on every click
  • ReviewPanel comment rows are converted from anchor tags to buttons; the external GitHub link moves to the existing hover action toolbar
  • Minor: openCommentPane is placed under the // Browser operations section comment in store.ts rather than a dedicated comment-operations section, and analytics (posthog.capture) are only emitted on new-pane creation, not on reuse

Confidence Score: 5/5

Safe to merge — no blocking bugs; all remaining findings are minor style and observability notes

The implementation correctly ports the v2 pattern, the reuse-or-create logic is sound, user-generated markdown is sanitized via rehype-sanitize after rehype-raw (correct ordering), the GitHub URL link is preserved in the hover bar, and the component handles missing comment state gracefully. The only open points are a misplaced section comment in store.ts, missing posthog on the reuse path, and a possibly-mismatched hotkey ID — none of which affect runtime correctness.

No files require special attention

Important Files Changed

Filename Overview
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx New component rendering PR comments as a rich markdown pane with syntax highlighting, mermaid diagrams, copyable tables, and a copy-all button; well-structured with proper cleanup of timers and mounted refs
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx Replaces the whole-row anchor tag with a button that opens the comment pane; GitHub URL link is correctly preserved in the hover action bar as a separate arrow-up-right icon
apps/desktop/src/renderer/stores/tabs/store.ts Adds openCommentPane action with correct reuse-or-create logic; minor issues: action is grouped under the Browser operations section comment, and analytics are only fired on new-pane creation (not reuse)
apps/desktop/src/renderer/stores/tabs/utils.ts Adds createCommentPane and createCommentTabWithPane helpers following the exact same pattern as createChatPane/createChatTabWithPane; clean and consistent
apps/desktop/src/shared/tabs-types.ts Adds 'comment' to PaneType union and CommentPaneState interface with optional fields; extends the Pane interface with comment?: CommentPaneState following established patterns

Sequence Diagram

sequenceDiagram
    participant User
    participant ReviewPanel
    participant TabsStore
    participant TabView

    User->>ReviewPanel: Click comment row
    ReviewPanel->>TabsStore: openCommentPane(workspaceId, commentData)
    alt existing comment pane found in workspace
        TabsStore->>TabsStore: Update pane.comment + pane.name
        TabsStore->>TabsStore: activatePaneInWorkspace (switch to tab)
    else no existing comment pane
        TabsStore->>TabsStore: createCommentTabWithPane()
        TabsStore->>TabsStore: Add tab + pane, set as active
        TabsStore->>TabsStore: posthog.capture panel_opened
    end
    TabView->>TabView: Route pane type comment to CommentPane
    TabView-->>User: Comment rendered with markdown and syntax highlighting

    User->>ReviewPanel: Click arrow-up-right icon in hover action bar
    ReviewPanel-->>User: Opens comment URL in browser (unchanged)
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/stores/tabs/store.ts
Line: 1620-1645

Comment:
**Missing analytics when reusing an existing comment pane**

`posthog.capture("panel_opened", ...)` is only emitted on the new-tab path. When an existing comment pane is found and its content is swapped, no event is fired. This means analytics will undercount how often users view comments in the pane — every click after the first one in a session goes untracked.

Consider emitting a lighter event (e.g. `"comment_pane_reused"`) in the reuse branch so click frequency remains observable.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/desktop/src/renderer/stores/tabs/store.ts
Line: 1607

Comment:
**`openCommentPane` grouped under wrong section comment**

`openCommentPane` was inserted immediately before `addBrowserTab`, so it falls under the existing `// Browser operations` section comment. It should sit under `// Comment operations` (as the type file correctly labels it).

```suggestion
			// Comment operations
			openCommentPane: (workspaceId: string, comment: CommentPaneData) => {
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx
Line: 99

Comment:
**Hotkey ID may be semantically mismatched**

`PaneToolbarActions` receives `closeHotkeyId` with the terminal's close action value. If this constant is a generic "close focused pane" action shared by all pane types, this is fine. However, if it controls tooltip text or keyboard shortcut registration differently per pane type, a comment pane using the terminal's hotkey ID could surface incorrect labels.

Worth confirming that `ChatPane` and `BrowserPane` use the same constant — if they do, this is a pre-existing naming convention rather than a new bug introduced by this PR.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(desktop): v1 review comments open i..." | Re-trigger Greptile

Comment thread apps/desktop/src/renderer/stores/tabs/store.ts
Comment thread apps/desktop/src/renderer/stores/tabs/store.ts
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx (1)

203-331: Split the nested components into their own files.

CommentCodeBlock and CopyableTable are full React components in the same file as CommentPane. Move them into colocated component files/folders and import them here. As per coding guidelines, **/*.{tsx,ts}: Do not create multi-component files; use one component per file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`
around lines 203 - 331, The file contains multiple full React components in one
file; extract CommentCodeBlock and CopyableTable into their own colocated
component files (e.g., CommentCodeBlock.tsx and CopyableTable.tsx), move their
imports/hooks (useTheme, SyntaxHighlighter, Streamdown, mermaidVars,
electronTrpcClient, LuCheck, etc.) into those new files, export them as default
or named exports, then update the original file to import CommentCodeBlock and
CopyableTable and keep only the commentComponents object and the CommentPane
logic; ensure prop types/signatures for CommentCodeBlock and CopyableTable
(children, className) remain unchanged and preserve any
refs/useEffect/useCallback behavior (timerRef, isMountedRef, handleCopy) when
moving CopyableTable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`:
- Around line 57-81: The cleanup effect currently only sets isMountedRef.current
= false and clears copyTimerRef, which leaves isMountedRef false after
StrictMode remounts; update the useEffect setup to set isMountedRef.current =
true at the start of the effect and in the cleanup
clearTimeout(copyTimerRef.current) and then set copyTimerRef.current = null to
fully reset the timer; ensure this change covers the same logic used by
handleCopyAll so setCopied continues to work after remounts.
- Around line 3-9: The file uses the unbound React namespace for a style type
(React.CSSProperties) inside the CommentPane component, causing a type error;
fix it by adding a named type import for CSSProperties from "react" in the
import list alongside ReactNode/useCallback/useEffect/useRef/useState and then
replace any occurrences of React.CSSProperties with CSSProperties (e.g., the
style variable/type used in CommentPane) so the type resolves correctly.
- Line 104: The CommentPane component is passing a terminal-specific hotkey id
to PaneToolbarActions via the prop closeHotkeyId="CLOSE_TERMINAL"; change this
to use the pane-focused hotkey by replacing or removing that prop so it uses
closeHotkeyId="CLOSE_PANE" (or omit closeHotkeyId to use the default CLOSE_PANE)
— update the JSX in CommentPane where PaneToolbarActions is rendered to
reference CLOSE_PANE instead of CLOSE_TERMINAL.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx`:
- Around line 74-85: The row click handler handleOpenComment currently returns
early if workspaceId is missing, leaving the UI control actionable but doing
nothing; update the component that renders the comment row/button to either
disable the button when workspaceId is falsy or implement a fallback inside
handleOpenComment that opens the comment.url (e.g., via shell.openExternal or
the existing URL-opening helper) so the control is never a no-op; search for
handleOpenComment and openCommentPane to apply the same fix to the other
occurrence (the block referenced also around the second occurrence) so both
places consistently disable the button or fall back to opening the GitHub URL
when workspaceId is absent.

In `@apps/desktop/src/renderer/stores/tabs/store.ts`:
- Around line 1620-1645: When reusing an existing comment pane you update the
pane name but not its containing tab, so the tab strip still shows the old
author; update the tab's name as well before calling activatePaneInWorkspace or
set. Specifically, when building newPanes for existingPane, also produce a
newTabs object (based on state.tabs) that sets newTabs[existingPane.tabId].name
= `@${comment.authorLogin}` (or otherwise sync tab name to the pane name), then
pass that newTabs into activatePaneInWorkspace and into set() when
activationState is falsy so the tab title is refreshed in the UI.

---

Nitpick comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`:
- Around line 203-331: The file contains multiple full React components in one
file; extract CommentCodeBlock and CopyableTable into their own colocated
component files (e.g., CommentCodeBlock.tsx and CopyableTable.tsx), move their
imports/hooks (useTheme, SyntaxHighlighter, Streamdown, mermaidVars,
electronTrpcClient, LuCheck, etc.) into those new files, export them as default
or named exports, then update the original file to import CommentCodeBlock and
CopyableTable and keep only the commentComponents object and the CommentPane
logic; ensure prop types/signatures for CommentCodeBlock and CopyableTable
(children, className) remain unchanged and preserve any
refs/useEffect/useCallback behavior (timerRef, isMountedRef, handleCopy) when
moving CopyableTable.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 857ee337-afbd-4c99-bbb8-754da34644c0

📥 Commits

Reviewing files that changed from the base of the PR and between bdd9a7a and d1e3f35.

📒 Files selected for processing (9)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/comment-pane.css
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/index.ts
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/index.tsx
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/ChangesView/components/ReviewPanel/ReviewPanel.tsx
  • apps/desktop/src/renderer/stores/tabs/store.ts
  • apps/desktop/src/renderer/stores/tabs/types.ts
  • apps/desktop/src/renderer/stores/tabs/utils.ts
  • apps/desktop/src/shared/tabs-types.ts

Comment thread apps/desktop/src/renderer/stores/tabs/store.ts
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.

2 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx">

<violation number="1" location="apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx:213">
P3: Language extraction regex is too restrictive and misparses common language identifiers.</violation>
</file>

<file name="apps/desktop/src/renderer/stores/tabs/store.ts">

<violation number="1" location="apps/desktop/src/renderer/stores/tabs/store.ts:1621">
P2: When reusing an existing comment pane, update the tab title too; otherwise the tab label can stay stuck on the previous comment author.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/desktop/src/renderer/stores/tabs/store.ts
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (3)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx (3)

127-132: ⚠️ Potential issue | 🟡 Minor

Use the pane close hotkey, not the terminal close hotkey.

CLOSE_TERMINAL gives this comment pane terminal-specific shortcut metadata. Omit the prop or use CLOSE_PANE.

Proposed fix
 					<PaneToolbarActions
 						splitOrientation={handlers.splitOrientation}
 						onSplitPane={handlers.onSplitPane}
 						onClosePane={handlers.onClosePane}
-						closeHotkeyId="CLOSE_TERMINAL"
 					/>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`
around lines 127 - 132, The PaneToolbarActions invocation is passing the
terminal-specific hotkey id CLOSE_TERMINAL via the closeHotkeyId prop which is
incorrect for the comment pane; update the PaneToolbarActions call (the
component used in CommentPane.tsx) to either remove the closeHotkeyId prop or
replace CLOSE_TERMINAL with the pane-specific constant CLOSE_PANE so the close
action uses the correct hotkey metadata (check where closeHotkeyId is consumed
in PaneToolbarActions to confirm).

3-9: ⚠️ Potential issue | 🔴 Critical

Import CSSProperties instead of referencing React.CSSProperties.

This module imports named React APIs only, so React.CSSProperties can fail as an unbound UMD namespace in a module. Use a type import instead.

Proposed fix
 import {
+	type CSSProperties,
 	type ReactNode,
 	useCallback,
 	useEffect,
 	useRef,
 	useState,
 } from "react";
@@
 			style={
-				(isDark ? oneDark : oneLight) as Record<string, React.CSSProperties>
+				(isDark ? oneDark : oneLight) as Record<string, CSSProperties>
 			}

Read-only verification:

#!/bin/bash
# Description: Verify React namespace type usage and whether UMD global access is explicitly enabled.
rg -nP 'React\.CSSProperties|allowUmdGlobalAccess|import\s+(type\s+)?\*\s+as\s+React|import\s+React\b' -C2 --type=ts --type=tsx

Also applies to: 269-273

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`
around lines 3 - 9, The code currently imports named React APIs (ReactNode,
useCallback, useEffect, useRef, useState) but references React.CSSProperties
which can fail; update the import to include the CSSProperties type (e.g., add
type CSSProperties to the import list) and then replace occurrences of
React.CSSProperties with CSSProperties in CommentPane (look for uses near the
existing ReactNode/useCallback imports and other occurrences around lines
referenced such as 269-273) so the module uses the imported type instead of the
React namespace.

59-87: ⚠️ Potential issue | 🟡 Minor

Reset copy feedback when the reused pane switches comments.

Since this pane is reused for subsequent comments, copied can remain visible for a different comment; table copy state can also carry over if markdown table components reconcile in the same position. Reset the timer/state on comment identity changes and key the markdown subtree to the active comment.

Proposed fix
 	const [copied, setCopied] = useState(false);
 	const copyTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
 	const isMountedRef = useRef(true);
+	const commentKey = `${comment?.url ?? ""}\0${comment?.body ?? ""}`;
 
 	useEffect(() => {
 		return () => {
 			isMountedRef.current = false;
-			if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
+			if (copyTimerRef.current) {
+				clearTimeout(copyTimerRef.current);
+				copyTimerRef.current = null;
+			}
 		};
 	}, []);
+
+	useEffect(() => {
+		setCopied(false);
+		if (copyTimerRef.current) {
+			clearTimeout(copyTimerRef.current);
+			copyTimerRef.current = null;
+		}
+	}, [commentKey]);
@@
 							<ReactMarkdown
+								key={commentKey}
 								remarkPlugins={[remarkGfm]}
 								rehypePlugins={[rehypeRaw, rehypeSanitize]}
 								components={commentComponents}

Also applies to: 183-189, 290-333

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`
around lines 59 - 87, The copied state and its timer are not cleared when the
pane is reused for a different comment; update the component to reset the copy
feedback whenever the active comment identity changes and ensure the markdown
subtree is keyed by the comment id so React fully remounts it. Concretely: in
the effect that currently only cleans up on unmount, add comment (or comment.id)
to the dependency array and inside it clear copyTimerRef (if set),
setCopied(false), and set isMountedRef.current appropriately; also ensure the
markdown/render subtree is given a key like `key={comment?.id}` so table copy
state doesn't carry over between comments. Reference: copied, copyTimerRef,
isMountedRef, handleCopyAll, and the markdown subtree rendering.
🧹 Nitpick comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx (1)

230-358: Split child components into their own component files.

CommentCodeBlock and CopyableTable are additional React components in this .tsx file. Please move them under the CommentPane folder as separate component files with barrel exports.

As per coding guidelines, **/*.{tsx,ts}: Do not create multi-component files; use one component per file. As per coding guidelines, **/*.tsx: Use one folder per component with structure: ComponentName/ComponentName.tsx + index.ts for barrel export.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`
around lines 230 - 358, This file contains two extra React components
(CommentCodeBlock and CopyableTable) that must be split into their own component
folders/files: create CommentCodeBlock/CommentCodeBlock.tsx and
CommentCodeBlock/index.ts (barrel) and CopyableTable/CopyableTable.tsx and
CopyableTable/index.ts, move the respective function implementations into those
files, export the components (default or named) from each index.ts, then update
the original CommentPane to import CommentCodeBlock and CopyableTable (and keep
commentComponents referencing CommentCodeBlock and CopyableTable) and remove the
in-file definitions; ensure all hooks/props (useTheme, mermaidPlugins,
electronTrpcClient, etc.) used by the moved components are imported or passed as
needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`:
- Around line 127-132: The PaneToolbarActions invocation is passing the
terminal-specific hotkey id CLOSE_TERMINAL via the closeHotkeyId prop which is
incorrect for the comment pane; update the PaneToolbarActions call (the
component used in CommentPane.tsx) to either remove the closeHotkeyId prop or
replace CLOSE_TERMINAL with the pane-specific constant CLOSE_PANE so the close
action uses the correct hotkey metadata (check where closeHotkeyId is consumed
in PaneToolbarActions to confirm).
- Around line 3-9: The code currently imports named React APIs (ReactNode,
useCallback, useEffect, useRef, useState) but references React.CSSProperties
which can fail; update the import to include the CSSProperties type (e.g., add
type CSSProperties to the import list) and then replace occurrences of
React.CSSProperties with CSSProperties in CommentPane (look for uses near the
existing ReactNode/useCallback imports and other occurrences around lines
referenced such as 269-273) so the module uses the imported type instead of the
React namespace.
- Around line 59-87: The copied state and its timer are not cleared when the
pane is reused for a different comment; update the component to reset the copy
feedback whenever the active comment identity changes and ensure the markdown
subtree is keyed by the comment id so React fully remounts it. Concretely: in
the effect that currently only cleans up on unmount, add comment (or comment.id)
to the dependency array and inside it clear copyTimerRef (if set),
setCopied(false), and set isMountedRef.current appropriately; also ensure the
markdown/render subtree is given a key like `key={comment?.id}` so table copy
state doesn't carry over between comments. Reference: copied, copyTimerRef,
isMountedRef, handleCopyAll, and the markdown subtree rendering.

---

Nitpick comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx`:
- Around line 230-358: This file contains two extra React components
(CommentCodeBlock and CopyableTable) that must be split into their own component
folders/files: create CommentCodeBlock/CommentCodeBlock.tsx and
CommentCodeBlock/index.ts (barrel) and CopyableTable/CopyableTable.tsx and
CopyableTable/index.ts, move the respective function implementations into those
files, export the components (default or named) from each index.ts, then update
the original CommentPane to import CommentCodeBlock and CopyableTable (and keep
commentComponents referencing CommentCodeBlock and CopyableTable) and remove the
in-file definitions; ensure all hooks/props (useTheme, mermaidPlugins,
electronTrpcClient, etc.) used by the moved components are imported or passed as
needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c3e55131-70b5-4ad4-afbf-50e633e47d2c

📥 Commits

Reviewing files that changed from the base of the PR and between d1e3f35 and 85d7595.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/CommentPane/CommentPane.tsx

@AviPeltz AviPeltz merged commit 5914bb9 into main Apr 22, 2026
7 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! 🎉

Kitenite added a commit that referenced this pull request May 4, 2026
Add v2 project setup section (#3566, #3605, #3606, #3592, #3626, #3632),
scheduled agent runs (#3576), Opus 4.7 (#3579), v1 review comments in pane
(#3596), configurable v2 link-click (#3600), Copy Branch Name (#3635),
safer terminal preset defaults (#3546), and /pricing page (#3639). Expand
bug fixes with v2 git correctness, cross-fork PR misattribution, terminal
paste/Unicode/Shift+Enter, and security bumps.
Kitenite added a commit that referenced this pull request May 6, 2026
…-27) (#3792)

* docs: generate weekly changelog 2026-04-27

* docs: reframe weekly changelog around v2 public beta

Lead with v2 public beta + Settings → Experimental enable, restructure
around the v1→v2 migration story, sidebar overhaul, cross-workspace
terminals, and v2 chat. Pull in ~30 v2 PRs the bot missed and demote
non-v2 items (Hosts page, marketing menu) to a brief "Also this week".

* docs: pull in missed v2 features and bug fixes

Add v2 project setup section (#3566, #3605, #3606, #3592, #3626, #3632),
scheduled agent runs (#3576), Opus 4.7 (#3579), v1 review comments in pane
(#3596), configurable v2 link-click (#3600), Copy Branch Name (#3635),
safer terminal preset defaults (#3546), and /pricing page (#3639). Expand
bug fixes with v2 git correctness, cross-fork PR misattribution, terminal
paste/Unicode/Shift+Enter, and security bumps.

* docs(changelog): add v2 public beta hero screenshot

* docs(changelog): add Settings → Experimental screenshot, compress hero

pngquant compression: v2-public-beta.png 704KB → 166KB (76%),
v2-enable-flag.png 160KB → 36KB (78%). No visible quality loss.

* docs(changelog): tighten v2 launch prose, condense bullet groups

* docs(changelog): reframe cloud-first pillar as remote workspaces

* docs(changelog): cut parallel-agents and honest-state pillars, fold into sub-sections

* docs(changelog): tweak title and lead phrasing

* docs(changelog): rewrite v2 launch lede around Twitter narrative

Pull the launch story (physical limits, 3 ex-CTOs, cloud workspaces)
into the lede, restructure pillars around Remote workspaces, Reimagined
diff view, and Superset CLI, and add v2-remote-workspaces and
v2-changes-pane screenshots to back the new sections.

* docs(changelog): add CLI install snippet and docs link

* docs(changelog): cut narrative lede, match standard changelog tone

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kiet Ho <hoakiet98@gmail.com>
saddlepaddle pushed a commit that referenced this pull request May 6, 2026
…-27) (#3792)

* docs: generate weekly changelog 2026-04-27

* docs: reframe weekly changelog around v2 public beta

Lead with v2 public beta + Settings → Experimental enable, restructure
around the v1→v2 migration story, sidebar overhaul, cross-workspace
terminals, and v2 chat. Pull in ~30 v2 PRs the bot missed and demote
non-v2 items (Hosts page, marketing menu) to a brief "Also this week".

* docs: pull in missed v2 features and bug fixes

Add v2 project setup section (#3566, #3605, #3606, #3592, #3626, #3632),
scheduled agent runs (#3576), Opus 4.7 (#3579), v1 review comments in pane
(#3596), configurable v2 link-click (#3600), Copy Branch Name (#3635),
safer terminal preset defaults (#3546), and /pricing page (#3639). Expand
bug fixes with v2 git correctness, cross-fork PR misattribution, terminal
paste/Unicode/Shift+Enter, and security bumps.

* docs(changelog): add v2 public beta hero screenshot

* docs(changelog): add Settings → Experimental screenshot, compress hero

pngquant compression: v2-public-beta.png 704KB → 166KB (76%),
v2-enable-flag.png 160KB → 36KB (78%). No visible quality loss.

* docs(changelog): tighten v2 launch prose, condense bullet groups

* docs(changelog): reframe cloud-first pillar as remote workspaces

* docs(changelog): cut parallel-agents and honest-state pillars, fold into sub-sections

* docs(changelog): tweak title and lead phrasing

* docs(changelog): rewrite v2 launch lede around Twitter narrative

Pull the launch story (physical limits, 3 ex-CTOs, cloud workspaces)
into the lede, restructure pillars around Remote workspaces, Reimagined
diff view, and Superset CLI, and add v2-remote-workspaces and
v2-changes-pane screenshots to back the new sections.

* docs(changelog): add CLI install snippet and docs link

* docs(changelog): cut narrative lede, match standard changelog tone

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kiet Ho <hoakiet98@gmail.com>
@Kitenite Kitenite deleted the charming-blinker branch May 6, 2026 04:52
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