{#if publishError}
Not published — your draft is safe. Try again.
{:else}
Draft saved
{/if} {#if filesTotal !== undefined && filesChecked !== undefined}
{filesChecked}/{filesTotal}
{/if}
{pendingCommentCount} {#if showCommentsTooltip && pendingCommentCount > 0}
{pendingCommentCount} {pendingCommentCount === 1 ? "comment" : "comments"}
{#each pendingComments as comment (comment.id)} {@const body = comment.edits[comment.edits.length - 1]?.body ?? ""}
{#if comment.location} {#if onSelectComment}
{ showCommentsTooltip = false; onSelectComment(comment); }}> {formatLocation(comment.location)}
{:else}
{formatLocation(comment.location)}
{/if} {/if} {#if editingCommentId !== comment.id}
startEdit(comment.id, body)}>
requestDeleteComment(comment.id)}>
{/if}
{#if editingCommentId === comment.id}
Cancel
saveEdit(comment.id)}> Save
{:else}
{body}
{/if}
{/each}
{/if}
{#snippet toggle(onclick)}
Discard
{/snippet} {#snippet popover()}
Discard this draft review? Your comments and verdict will be lost.
(discardMenuExpanded = false)}> Cancel
{ discardMenuExpanded = false; onCancel(); }}>
Discard
{/snippet}
{verdictLabel}
{#snippet toggle(onclick)}
{/snippet} {#snippet popover()}
{#each verdictOptions as option (option.label)}
{ verdict = option.value; draftReviewStorage.update(draftReview.id, { summary, verdict: option.value, labels: draftReview.labels, }); closeFocused(); void onChange(); }}>
{#if verdict === option.value}
{/if}
{option.label}
{option.description}
{/each}
{/snippet}
{#each pendingComments as comment (comment.id)} {@const body = comment.edits[comment.edits.length - 1]?.body ?? ""}-
{#if comment.location}
{#if onSelectComment}
{:else}
{formatLocation(comment.location)}
{/if}
{/if}
{#if editingCommentId !== comment.id}
{/if}
{#if editingCommentId === comment.id}
{:else}
{body}
{/if}
{/each}