diff --git a/packages/kilo-vscode/src/agent-manager/pr/PRActions.ts b/packages/kilo-vscode/src/agent-manager/pr/PRActions.ts index 5135a7db80..3dd92b9ff7 100644 --- a/packages/kilo-vscode/src/agent-manager/pr/PRActions.ts +++ b/packages/kilo-vscode/src/agent-manager/pr/PRActions.ts @@ -4,10 +4,10 @@ import { GH_MUTATION_TIMEOUT } from "./pr-constants" export async function resolveComment(threadId: string, cwd: string): Promise { const mutation = `mutation($id: ID!) { resolveReviewThread(input: { threadId: $id }) { thread { isResolved } } }` try { - await execGhRead( - ["api", "graphql", "-f", `query=${mutation}`, "-F", `id=${threadId}`], - { cwd, timeout: GH_MUTATION_TIMEOUT }, - ) + await execGhRead(["api", "graphql", "-f", `query=${mutation}`, "-F", `id=${threadId}`], { + cwd, + timeout: GH_MUTATION_TIMEOUT, + }) } catch (err) { const msg = err instanceof Error ? err.message : String(err) const stderr = (err as Record).stderr @@ -18,10 +18,10 @@ export async function resolveComment(threadId: string, cwd: string): Promise { const mutation = `mutation($id: ID!) { unresolveReviewThread(input: { threadId: $id }) { thread { isResolved } } }` try { - await execGhRead( - ["api", "graphql", "-f", `query=${mutation}`, "-F", `id=${threadId}`], - { cwd, timeout: GH_MUTATION_TIMEOUT }, - ) + await execGhRead(["api", "graphql", "-f", `query=${mutation}`, "-F", `id=${threadId}`], { + cwd, + timeout: GH_MUTATION_TIMEOUT, + }) } catch (err) { const msg = err instanceof Error ? err.message : String(err) const stderr = (err as Record).stderr diff --git a/packages/kilo-vscode/tests/unit/am-pr-status-bridge.test.ts b/packages/kilo-vscode/tests/unit/am-pr-status-bridge.test.ts index 6edfb4f145..0b03bfd837 100644 --- a/packages/kilo-vscode/tests/unit/am-pr-status-bridge.test.ts +++ b/packages/kilo-vscode/tests/unit/am-pr-status-bridge.test.ts @@ -205,13 +205,17 @@ describe("PRStatusBridge.handleMessage resolveComment", () => { it("returns true for agentManager.resolveComment", () => { const { bridge } = harness() resolveComment.mockResolvedValueOnce(undefined) - expect(bridge.handleMessage({ type: "agentManager.resolveComment", worktreeId: "wt1", threadId: "PRT_1" })).toBe(true) + expect(bridge.handleMessage({ type: "agentManager.resolveComment", worktreeId: "wt1", threadId: "PRT_1" })).toBe( + true, + ) }) it("returns true for agentManager.unresolveComment", () => { const { bridge } = harness() unresolveComment.mockResolvedValueOnce(undefined) - expect(bridge.handleMessage({ type: "agentManager.unresolveComment", worktreeId: "wt1", threadId: "PRT_1" })).toBe(true) + expect(bridge.handleMessage({ type: "agentManager.unresolveComment", worktreeId: "wt1", threadId: "PRT_1" })).toBe( + true, + ) }) it("posts resolveCommentResult with success:true on resolve success", async () => { @@ -220,7 +224,14 @@ describe("PRStatusBridge.handleMessage resolveComment", () => { bridge.handleMessage({ type: "agentManager.resolveComment", worktreeId: "wt1", threadId: "PRT_1" }) await Promise.resolve() const result = sent.find((m) => m.type === "agentManager.resolveCommentResult") - expect(result).toEqual(expect.objectContaining({ type: "agentManager.resolveCommentResult", worktreeId: "wt1", threadId: "PRT_1", success: true })) + expect(result).toEqual( + expect.objectContaining({ + type: "agentManager.resolveCommentResult", + worktreeId: "wt1", + threadId: "PRT_1", + success: true, + }), + ) }) it("posts unresolveCommentResult with success:true on unresolve success", async () => { diff --git a/packages/kilo-vscode/tests/unit/am-pr-utils.test.ts b/packages/kilo-vscode/tests/unit/am-pr-utils.test.ts index d5f8bf3096..21bf23b56c 100644 --- a/packages/kilo-vscode/tests/unit/am-pr-utils.test.ts +++ b/packages/kilo-vscode/tests/unit/am-pr-utils.test.ts @@ -255,9 +255,7 @@ describe("parseComments", () => { }) it("uses comment id as threadId fallback when thread has no id", () => { - const threads: GhThread[] = [ - { isResolved: false, comments: { nodes: [{ id: "c2", body: "note" }] } }, - ] + const threads: GhThread[] = [{ isResolved: false, comments: { nodes: [{ id: "c2", body: "note" }] } }] const result = parseComments(threads) expect(result[0]?.threadId).toBe("c2") }) diff --git a/packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx b/packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx index e1e31fcdec..736b9bc748 100644 --- a/packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx +++ b/packages/kilo-vscode/webview-ui/agent-manager/pr/PRComments.tsx @@ -13,14 +13,13 @@ function DiffHunk(props: { hunk: string }) {
{(line) => { - const cls = - line.startsWith("+") - ? "am-pr-diff-line-add" - : line.startsWith("-") - ? "am-pr-diff-line-del" - : line.startsWith("@@") - ? "am-pr-diff-line-meta" - : "am-pr-diff-line-ctx" + const cls = line.startsWith("+") + ? "am-pr-diff-line-add" + : line.startsWith("-") + ? "am-pr-diff-line-del" + : line.startsWith("@@") + ? "am-pr-diff-line-meta" + : "am-pr-diff-line-ctx" return
{line || " "}
}}
@@ -34,10 +33,16 @@ function CommentCard(props: { comment: PRComment; worktreeId: string }) { const [actionError, setActionError] = createSignal(undefined) // Clear optimistic state if the comment at this position changes (Index tracks by position) - createEffect(on(() => props.comment.threadId, () => { - setOptimisticResolved(undefined) - setActionError(undefined) - }, { defer: true })) + createEffect( + on( + () => props.comment.threadId, + () => { + setOptimisticResolved(undefined) + setActionError(undefined) + }, + { defer: true }, + ), + ) const resolved = createMemo(() => optimisticResolved() ?? props.comment.resolved) @@ -54,7 +59,11 @@ function CommentCard(props: { comment: PRComment; worktreeId: string }) { setActionError(undefined) } else { setOptimisticResolved(undefined) - setActionError(msg.type === "agentManager.resolveCommentResult" ? "Failed to resolve thread." : "Failed to unresolve thread.") + setActionError( + msg.type === "agentManager.resolveCommentResult" + ? "Failed to resolve thread." + : "Failed to unresolve thread.", + ) } } window.addEventListener("message", handler) @@ -74,9 +83,7 @@ function CommentCard(props: { comment: PRComment; worktreeId: string }) { return (
- - {(hunk) => } - + {(hunk) => }
{props.comment.author} @@ -90,9 +97,7 @@ function CommentCard(props: { comment: PRComment; worktreeId: string }) {
- - {(err) =>
{err()}
} -
+ {(err) =>
{err()}
}
diff --git a/packages/kilo-vscode/webview-ui/agent-manager/pr/PRPanel.tsx b/packages/kilo-vscode/webview-ui/agent-manager/pr/PRPanel.tsx index 08c6575637..b37d72948d 100644 --- a/packages/kilo-vscode/webview-ui/agent-manager/pr/PRPanel.tsx +++ b/packages/kilo-vscode/webview-ui/agent-manager/pr/PRPanel.tsx @@ -83,7 +83,9 @@ export const PRPanel: Component = (props) => {
- +
diff --git a/packages/kilo-vscode/webview-ui/agent-manager/pr/PRSummary.tsx b/packages/kilo-vscode/webview-ui/agent-manager/pr/PRSummary.tsx index d249dcad88..687e20315e 100644 --- a/packages/kilo-vscode/webview-ui/agent-manager/pr/PRSummary.tsx +++ b/packages/kilo-vscode/webview-ui/agent-manager/pr/PRSummary.tsx @@ -70,9 +70,7 @@ export function PRSummary(props: PRSummaryProps) { > {row.label} - {row.isComments && props.onJumpToComments && ( - Jump to comments ↓ - )} + {row.isComments && props.onJumpToComments && Jump to comments ↓} ))}