From 144fc4297053428f0533611b220ac35fa4a18740 Mon Sep 17 00:00:00 2001 From: Samuel Shuert Date: Wed, 2 Oct 2024 19:26:26 -0400 Subject: [PATCH] fix(web): Provide visual response to old reviews 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. --- src/views/repos/Cob/Reviews.svelte | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/views/repos/Cob/Reviews.svelte b/src/views/repos/Cob/Reviews.svelte index a1ef6547f..67d680f80 100644 --- a/src/views/repos/Cob/Reviews.svelte +++ b/src/views/repos/Cob/Reviews.svelte @@ -7,6 +7,16 @@ export let baseUrl: BaseUrl; export let reviews: PatchReviews; + + $: sortedReviews = Array.from(Object.values(reviews)).sort((a, b) => { + if (a.latest === b.latest) { + return 0; + } else if (b.latest) { + return 1; + } else { + return -1; + } + });