Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
451e095
feat(web): reply to review threads and quote comments from the PR Sum…
TonybynMp4 Nov 11, 2026
0c2448c
fix(web): keep reply drafts across collapse and quotes made while pos…
TonybynMp4 Nov 11, 2026
fa6fcf7
test(web): cover an unsent PR reply surviving collapse
TonybynMp4 Nov 11, 2026
1e84373
fix(web): keep HTML comments written inside code when quoting
TonybynMp4 Nov 11, 2026
c7400b1
fix(web): preserve visible code in selected PR quotes
maria-rcks Nov 11, 2026
97c4f6f
fix(web): escape selected PR quote text for rendering
maria-rcks Nov 11, 2026
8e016fd
fix(web): keep quotes and reply drafts through posts and resolution
TonybynMp4 Nov 11, 2026
8e87977
fix(web): clear a remounted thread reply once its post succeeds
TonybynMp4 Nov 11, 2026
bba9fb8
fix(web): keep a quote made as posting settles, and code in tilde fences
TonybynMp4 Nov 11, 2026
a649f06
test(web): move the late-quote test into the PR summary browser tests
TonybynMp4 Nov 12, 2026
1a95c83
test(web): reset stored thread replies between PR Code tab tests
TonybynMp4 Nov 17, 2026
a61fb7d
fix(web): translate the PR summary quote and reply failure copy
TonybynMp4 Nov 18, 2026
258fc79
feat(web): nest review threads under their review in the PR Summary tab
TonybynMp4 Nov 11, 2026
bc62b05
fix(web): stop reply dictation when its review thread collapses
TonybynMp4 Nov 12, 2026
85649bd
fix(web): stop summary reply dictation when its conversation closes
TonybynMp4 Nov 12, 2026
9df4d16
fix(web): translate the review thread count and reviewed label
TonybynMp4 Nov 18, 2026
93bed8c
Merge remote-tracking branch 'github/main' into takeover-34567
maria-rcks Nov 18, 2026
71efabc
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 @@ -116,6 +116,7 @@ vi.mock(import("~/state/pullRequests"), async (original) => {

import { render } from "../../../test/render";
import PullRequestCodeTab from "./PullRequestCodeTab";
import { usePullRequestReviewStore } from "./pullRequestReviewStore";

const detail: PullRequestDetailView = {
provider: SourceControlProviderKind.make("github"),
Expand Down Expand Up @@ -176,6 +177,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 @@ -114,6 +114,7 @@ import { openOnHostLabel } from "./pullRequestLinkContextMenu";
import { PullRequestMarkdownContext } from "./PullRequestMarkdown";
import { pullRequestMarkdownPlugins } 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 @@ -433,6 +434,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 @@ -2081,6 +2083,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 @@ -2096,6 +2099,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 @@ -2217,6 +2223,7 @@ export function PullRequestDetailPanel({
onCommented={refreshDetail}
onReviewSubmitted={refreshDetail}
openReviewRequest={openReviewRequest}
quoteRequest={quoteRequest}
/>
</div>
) : null}
Expand Down
Loading
Loading