diff --git a/app/src/components/BriefingFindings.tsx b/app/src/components/BriefingFindings.tsx index 48f87e3..e955c76 100644 --- a/app/src/components/BriefingFindings.tsx +++ b/app/src/components/BriefingFindings.tsx @@ -33,6 +33,14 @@ interface BriefingFindingsProps { * Briefing tab list. */ readonly limit?: number; + /** + * Adopt a finding as a review comment (explicit click; outward posting still + * rides the guarded Mirror / Submit-review flows). Omitted by read-only + * surfaces (the board preview rail) and when the gate is not InReview. + */ + readonly onAdopt?: ((finding: ReviewFinding) => void) | undefined; + /** Ids of findings that already have an adopted comment. */ + readonly adoptedIds?: ReadonlySet | undefined; } // --------------------------------------------------------------------------- @@ -55,9 +63,13 @@ function locationLabel(finding: ReviewFinding): string { function FindingRow({ finding, onJumpTo, + onAdopt, + adopted, }: { readonly finding: ReviewFinding; readonly onJumpTo: (path: string, side: DiffSide, line: number) => void; + readonly onAdopt?: ((finding: ReviewFinding) => void) | undefined; + readonly adopted: boolean; }) { const meta = severityMeta(finding.severity); const [start] = finding.range; @@ -94,6 +106,27 @@ function FindingRow({ > {locationLabel(finding)} + {onAdopt !== undefined && + hasLine && + (adopted ? ( + + Added ✓ + + ) : ( + + ))} {hasLine ? ( + ))} {hasLine ? (