Skip to content

Commit

Permalink
fix(web): Provide visual response to old reviews
Browse files Browse the repository at this point in the history
Previously radicle-explorer kept old reviews the exact same style as new
ones (greyed out text like). This change sets the new review color to be
the same as users are normally while greying out old ones (both the user
and the icon).

To provide further clarity we've added a tooltip for explaining that a
review is old, and started sorting the reviews so that outdated reviews
sink to the bottom/end.

In review, it was mentioned that this would go well with jumping to the
review by clicking on the checks/crosses. This is a larger and
more-different change than we believe fits in this patch. We'll make
a followup for it in the future.
  • Loading branch information
TheCodedProf authored and Minion3665 committed Oct 10, 2024
1 parent 5657a6f commit 8091b14
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/views/repos/Cob/Reviews.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
font-size: var(--font-size-small);
}
.review {
color: var(--color-fill-gray);
display: inline-flex;
align-items: center;
gap: 0.5rem;
Expand All @@ -32,6 +31,10 @@
.review-reject {
color: var(--color-foreground-red);
}
.txt-missing .review-accept,
.txt-missing .review-reject {
color: var(--color-foreground-dim);
}
@media (max-width: 1349.98px) {
.wrapper {
display: flex;
Expand All @@ -58,8 +61,21 @@
<div class="wrapper">
<div class="header">Reviews</div>
<div class="body">
{#each Object.values(reviews) as { latest, review }}
<div class="review" class:txt-missing={!latest}>
{#each Array.from(Object.values(reviews)).sort((a, b) => {
if (a.latest === b.latest) {
return 0;
} else if (b.latest) {
return 1;
} else {
return -1;
}
}) as { latest, review }}
<div
class="review"
class:txt-missing={!latest}
title={!latest
? `This review was on a previous revision. Please ask ${review.author.alias} to re-review`
: ""}>
<span
class:review-accept={review.verdict === "accept"}
class:review-reject={review.verdict === "reject"}>
Expand Down

0 comments on commit 8091b14

Please sign in to comment.