Skip to content

Commit

Permalink
Show revision state icons in revision selector
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfs committed Jan 17, 2025
1 parent aafba92 commit 67b685d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/components/RevisionSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
.dropdown-group:not(:last-of-type) {
margin-bottom: 1rem;
}
.icon {
min-width: 16px;
}
</style>

<Popover popoverPadding="0" popoverPositionTop="2.5rem" popoverPositionLeft="0">
Expand Down Expand Up @@ -82,6 +85,29 @@
selectRevision(revision);
}}>
<div class="global-flex txt-overflow">
<div class="icon">
{#if patch.state.status === "merged" && patch.state.revision === revision.id}
<div style:color="var(--color-fill-primary)">
<Icon name="merge" />
</div>
{:else if revision.reviews && revision.reviews.length > 0 && revision.reviews.every( r => {
return r.verdict === "accept";
}, )}
<div style:color="var(--color-fill-success)">
<Icon name="comment-checkmark" />
</div>
{:else if revision.reviews && revision.reviews.length > 0 && revision.reviews.every( r => {
return r.verdict === "reject";
}, )}
<div style:color="var(--color-foreground-red)">
<Icon name="comment-cross" />
</div>
{:else if revision.reviews && revision.reviews.length}
<div style:color="var(--color-foreground-dim)">
<Icon name="none" />
</div>
{/if}
</div>
<span class="global-oid">
{formatOid(revision.id)}
</span>
Expand Down

0 comments on commit 67b685d

Please sign in to comment.