{
+ await saveSummary(content);
+ }
+ : undefined} />
{:else}
No summary.
{/if}
diff --git a/src/components/Revision.svelte b/src/components/Revision.svelte
index 3a3aa7aca..b12a1a458 100644
--- a/src/components/Revision.svelte
+++ b/src/components/Revision.svelte
@@ -4,6 +4,7 @@
import type { Operation } from "@bindings/cob/Operation";
import type { Action } from "@bindings/cob/patch/Action";
import type { Revision } from "@bindings/cob/patch/Revision";
+ import type { Verdict } from "@bindings/cob/patch/Verdict";
import type { CodeLocation } from "@bindings/cob/thread/CodeLocation";
import type { Embed } from "@bindings/cob/thread/Embed";
import type { Thread } from "@bindings/cob/thread/Thread";
@@ -36,6 +37,7 @@
import {
groupCommitsByAuthor,
isCommitListDescription,
+ replaceDescriptionBody,
splitDescription,
visibleCommitsOf,
} from "@app/lib/revisionDescription";
@@ -596,6 +598,31 @@
}
}
+ async function editReviewSummary(
+ reviewId: string,
+ summary: string,
+ review: { verdict?: Verdict; labels?: string[] },
+ ) {
+ try {
+ await invoke("edit_patch", {
+ rid,
+ cobId: patchId,
+ action: {
+ type: "review.edit",
+ review: reviewId,
+ summary,
+ verdict: review.verdict,
+ labels: review.labels ?? [],
+ },
+ opts: { announce: $nodeRunning && $announce },
+ });
+ } catch (error) {
+ console.error("Editing review summary failed: ", error);
+ } finally {
+ await loadPatch();
+ }
+ }
+
async function createComment(
body: string,
embeds: Embed[],
@@ -1024,7 +1051,17 @@
{:else}
{#if body.trim() !== ""}
-
+ {
+ await editRevision(
+ content,
+ revision.description.slice(-1)[0]?.embeds ?? [],
+ );
+ }
+ : undefined} />
{:else}
No description
{/if}
@@ -1087,6 +1124,7 @@
repoDelegates.map(d => d.did),
targetRev.author.did,
)}
+ {@const fullDescription = data.op.description}
{@const descriptionSubject = splitDescription(
data.op.description,
).subject}
@@ -1140,7 +1178,19 @@
{:else if descriptionVisible}
-
+
{
+ await editRevision(
+ replaceDescriptionBody(fullDescription, content),
+ targetRev?.description.slice(-1)[0]?.embeds ?? [],
+ revId,
+ );
+ }
+ : undefined} />
{#if canEditRevision}