From 37558659da540e2444b9fecf7dfd3ae369c7cd6f Mon Sep 17 00:00:00 2001 From: Dotta Date: Sun, 7 Jun 2026 02:38:12 +0000 Subject: [PATCH] Wire Resolve onto anchored suggestion cards (PAP-10568) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit onResolveSuggestion was only passed to the orphaned-suggestion SuggestionCard branch, so the Resolve action only appeared on orphaned suggestions — the opposite of where it's useful, since orphaned suggestions can't be applied. Wire it onto the non-orphan render path too, and add a rail regression test asserting the Resolve button renders on anchored suggestion cards. Co-Authored-By: Claude Opus 4.8 --- .../documents/DocumentReviewRail.test.tsx | 20 +++++++++++++++++++ .../documents/DocumentReviewRail.tsx | 7 +++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ui/src/components/documents/DocumentReviewRail.test.tsx b/ui/src/components/documents/DocumentReviewRail.test.tsx index fb27531612b..befc591e4a8 100644 --- a/ui/src/components/documents/DocumentReviewRail.test.tsx +++ b/ui/src/components/documents/DocumentReviewRail.test.tsx @@ -224,6 +224,26 @@ describe("DocumentReviewRail", () => { expect(container.textContent).toContain("added text"); }); + it("wires Resolve onto anchored (non-orphan) suggestion cards", async () => { + // Regression: onResolveSuggestion was only wired on the orphaned-suggestion + // branch, so Resolve never appeared on healthy/anchored cards where it's + // most useful. Assert the non-orphan render path exposes it. + await act(() => + root.render( + , + ), + ); + expect(container.querySelector('[data-testid="suggestion-resolve-sug-1"]')).not.toBeNull(); + }); + it("pins orphaned anchors into a collapsible group when the orphan filter is on", async () => { const index = makeIndex({ annotationThreads: [ diff --git a/ui/src/components/documents/DocumentReviewRail.tsx b/ui/src/components/documents/DocumentReviewRail.tsx index ecf118e2869..c6e8519d6b6 100644 --- a/ui/src/components/documents/DocumentReviewRail.tsx +++ b/ui/src/components/documents/DocumentReviewRail.tsx @@ -15,7 +15,7 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import { cn } from "@/lib/utils"; +import { cn, isApplePlatform } from "@/lib/utils"; import type { ReviewAuthorMaps } from "@/lib/document-review-authors"; import { DocumentThreadCard, type RailThread } from "./DocumentThreadCard"; import { SuggestionCard } from "./SuggestionCard"; @@ -371,6 +371,7 @@ function ReviewRailBody({ authorMaps={authorMaps} onAccept={onAcceptSuggestion} onReject={onRejectSuggestion} + onResolve={onResolveSuggestion} onReply={onReplySuggestion} onViewDiff={onViewSuggestionDiff} /> @@ -447,10 +448,12 @@ function OrphanGroup({ count, children }: { count: number; children: React.React } function RailEmpty({ message }: { message: string }) { + // Platform-aware hint: macOS/iOS reviewers see ⌘⇧M, Windows/Linux see Ctrl+Shift+M. + const hotkey = isApplePlatform() ? "⌘⇧M" : "Ctrl+Shift+M"; return (

{message}

-

⌘⇧M to comment from a selection

+

{hotkey} to comment from a selection

); }