Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
12bc3d4
feat(web): reply to review threads and quote comments from the PR Sum…
TonybynMp4 Nov 11, 2026
4c4d11b
fix(web): keep reply drafts across collapse and quotes made while pos…
TonybynMp4 Nov 11, 2026
ceda428
test(web): cover an unsent PR reply surviving collapse
TonybynMp4 Nov 11, 2026
a247325
fix(web): keep HTML comments written inside code when quoting
TonybynMp4 Nov 11, 2026
a912104
fix(web): preserve visible code in selected PR quotes
maria-rcks Nov 11, 2026
e209dca
fix(web): escape selected PR quote text for rendering
maria-rcks Nov 11, 2026
443e29a
fix(web): keep quotes and reply drafts through posts and resolution
TonybynMp4 Nov 11, 2026
946ae4c
fix(web): clear a remounted thread reply once its post succeeds
TonybynMp4 Nov 11, 2026
5e9d6ab
fix(web): keep a quote made as posting settles, and code in tilde fences
TonybynMp4 Nov 11, 2026
4e7ada9
test(web): move the late-quote test into the PR summary browser tests
TonybynMp4 Nov 12, 2026
97d0cf6
test(web): reset stored thread replies between PR Code tab tests
TonybynMp4 Nov 17, 2026
f2ca8ab
fix(web): translate the PR summary quote and reply failure copy
TonybynMp4 Nov 18, 2026
612ab11
feat(web): nest review threads under their review in the PR Summary tab
TonybynMp4 Nov 11, 2026
8e43dd9
fix(web): stop reply dictation when its review thread collapses
TonybynMp4 Nov 12, 2026
5330018
fix(web): stop summary reply dictation when its conversation closes
TonybynMp4 Nov 12, 2026
3a4c927
fix(web): translate the review thread count and reviewed label
TonybynMp4 Nov 18, 2026
b1bafb6
fix(web): guard review replies across tabs
maria-rcks Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ import { WorkerPoolManager } from "@pierre/diffs/worker";
import { createWorkspaceFocusController, workspaceAreaProps } from "~/lib/workspaceFocus";
import { render, stubGlobal } from "../../../test/render";
import PullRequestCodeTab from "./PullRequestCodeTab";
import { usePullRequestReviewStore } from "./pullRequestReviewStore";

const detail: PullRequestDetailView = {
provider: SourceControlProviderKind.make("github"),
Expand Down Expand Up @@ -201,6 +202,7 @@ function setup({ paged }: { paged: boolean }) {
mocks.diffCommits = [];
mocks.viewedPaths = null;
mocks.viewedListeners.clear();
usePullRequestReviewStore.setState({ replies: {} });
}

const tab = (
Expand Down
34 changes: 34 additions & 0 deletions apps/web/src/components/pullRequest/PullRequestCommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ import { useInlineActionConfirm } from "./useInlineActionConfirm";

import { changeRequestTermKind } from "./changeRequestTerm";

/** A fresh object each time, so quoting the same comment twice still lands. */
export type PullRequestQuoteRequest = { readonly text: string };

export function PullRequestCommentForm({
environmentId,
active,
reference,
detail,
actionPending,
textareaRef,
quoteRequest,
onCommentAction,
onCommented,
onClose,
onQuoted,
}: {
environmentId: EnvironmentId;
/** False while the form stays mounted but hidden; dictation is cancelled then. */
Expand All @@ -40,17 +45,46 @@ export function PullRequestCommentForm({
detail: PullRequestDetailView;
actionPending: boolean;
textareaRef: RefObject<HTMLTextAreaElement | null>;
quoteRequest?: PullRequestQuoteRequest | undefined;
onCommentAction: (
body: string,
action: "close" | "reopen",
) => Promise<{ readonly commentPosted: boolean }>;
onCommented: () => void;
onClose: () => void;
/** A quote deferred past a successful post lands after `onClose`, so the form asks to be shown again. */
onQuoted: () => void;
}) {
const gt = useGT();
const [body, setBody] = useState("");
const [submitting, setSubmitting] = useState<"comment" | "close" | "reopen" | null>(null);
const locked = submitting !== null || actionPending;
const [answeredQuoteRequest, setAnsweredQuoteRequest] = useState(quoteRequest);
const [pendingQuotes, setPendingQuotes] = useState<ReadonlyArray<string>>([]);
const [caretAfterQuote, setCaretAfterQuote] = useState(false);
let quotes = pendingQuotes;
if (quoteRequest !== answeredQuoteRequest) {
setAnsweredQuoteRequest(quoteRequest);
if (quoteRequest) quotes = [...quotes, quoteRequest.text];
}
// A successful post clears the draft, so quotes wait until posting settles.
if (quotes.length > 0 && !locked) {
setPendingQuotes([]);
setBody((draft) => [draft.trimEnd(), ...quotes].filter((part) => part.length > 0).join("\n\n"));
setCaretAfterQuote(true);
} else if (quotes !== pendingQuotes) {
setPendingQuotes(quotes);
}
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- reveals the composer and moves the DOM caret after a quote lands
useEffect(() => {
const textarea = textareaRef.current;
if (!caretAfterQuote || !textarea) return;
setCaretAfterQuote(false);
onQuoted();
textarea.focus({ preventScroll: true });
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
textarea.scrollTop = textarea.scrollHeight;
}, [caretAfterQuote, textareaRef, onQuoted]);
const speech = useTextFieldSpeech({
environmentId,
projectId: reference.projectId,
Expand Down
15 changes: 14 additions & 1 deletion apps/web/src/components/pullRequest/PullRequestComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useRef, useState } from "react";
import { Button } from "../ui/button";
import { Popover, PopoverClose, PopoverPopup, PopoverTitle, PopoverTrigger } from "../ui/popover";
import { Toggle, ToggleGroup } from "../ui/toggle-group";
import { PullRequestCommentForm } from "./PullRequestCommentForm";
import { PullRequestCommentForm, type PullRequestQuoteRequest } from "./PullRequestCommentForm";
import { PullRequestReviewForm } from "./PullRequestReviewForm";
import {
pullRequestReviewKey,
Expand All @@ -27,6 +27,7 @@ export function PullRequestComposer({
onCommented,
onReviewSubmitted,
openReviewRequest,
quoteRequest,
}: {
environmentId: EnvironmentId;
reference: PullRequestRef;
Expand All @@ -39,6 +40,7 @@ export function PullRequestComposer({
onCommented: () => void;
onReviewSubmitted: () => void;
openReviewRequest?: number | undefined;
quoteRequest?: PullRequestQuoteRequest | undefined;
}) {
const gt = useGT();
const term = changeRequestTermKind(sourceControlClients.get(detail.provider).changeRequest);
Expand All @@ -61,6 +63,12 @@ export function PullRequestComposer({
setRequestedMode("review");
setOpen(true);
}
const [answeredQuoteRequest, setAnsweredQuoteRequest] = useState(quoteRequest);
if (quoteRequest !== answeredQuoteRequest) {
setAnsweredQuoteRequest(quoteRequest);
setRequestedMode("comment");
setOpen(true);
}

const canComment = detail.capabilities.comment && detail.viewerPermissions.comment;
const verdicts = detail.capabilities.review.verdicts.filter((verdict) =>
Expand Down Expand Up @@ -205,9 +213,14 @@ export function PullRequestComposer({
detail={detail}
actionPending={actionPending}
textareaRef={commentRef}
quoteRequest={quoteRequest}
onCommentAction={onCommentAction}
onCommented={onCommented}
onClose={() => setOpen(false)}
onQuoted={() => {
setRequestedMode("comment");
setOpen(true);
}}
/>
</div>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ import { openOnHostLabel } from "./pullRequestLinkContextMenu";
import { PullRequestMarkdownContext } from "./PullRequestMarkdown";
import { pullRequestMarkdownExtensions } from "./pullRequestMarkdown.logic";
import { PullRequestComposer } from "./PullRequestComposer";
import type { PullRequestQuoteRequest } from "./PullRequestCommentForm";
import { PullRequestSummaryTab } from "./PullRequestSummaryTab";
import { PullRequestTimelineTab } from "./PullRequestTimelineTab";
import {
Expand Down Expand Up @@ -434,6 +435,7 @@ export function PullRequestDetailPanel({
useEnvironmentQuery(pullRequestEnvironment.changeBreakdown({ environmentId, input: reference }));
const [threadPickerOpen, setThreadPickerOpen] = useState(false);
const [openReviewRequest, setOpenReviewRequest] = useState(0);
const [quoteRequest, setQuoteRequest] = useState<PullRequestQuoteRequest>();
const {
canWriteSourceControl,
detailQuery,
Expand Down Expand Up @@ -2088,6 +2090,7 @@ export function PullRequestDetailPanel({
{mountedTabs.has("summary") ? (
<div className={cn("absolute inset-0", tab !== "summary" && "invisible")}>
<PullRequestSummaryTab
active={tab === "summary"}
scrollerRef={scrollerRefs.summary}
revealUrl={tab === "summary" ? revealUrl : undefined}
onRevealSettled={settleReveal}
Expand All @@ -2103,6 +2106,9 @@ export function PullRequestDetailPanel({
fixCheckLabel={handoffLabels.fixCheck}
{...(canFixFindings ? { onFixFinding: startFixFinding } : {})}
{...(attachTarget === null ? {} : { onAddToChat: addCommentToChat })}
{...(detail.capabilities.comment && detail.viewerPermissions.comment
? { onQuoteReply: (text: string) => setQuoteRequest({ text }) }
: {})}
onRefresh={refreshDetail}
onRefreshChecks={refreshFromHost}
/>
Expand Down Expand Up @@ -2229,6 +2235,7 @@ export function PullRequestDetailPanel({
onCommented={refreshDetail}
onReviewSubmitted={refreshDetail}
openReviewRequest={openReviewRequest}
quoteRequest={quoteRequest}
/>
</div>
) : null}
Expand Down
Loading
Loading