Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Hide releases whose artifacts are all author/delegate-redacted
Daniel Norman committed 7 days ago
commit 859e5bff2090c102a1783e9a51a102236f739ce5
parent fdb11f2c6b1156904a9685783a0d8efcb51f67c8
1 file changed +16 -1
modified src/views/repo/Releases.svelte
@@ -27,10 +27,25 @@
  let searchInput = $state("");
  let showSearch = $state(false);

+
  const delegateDids = $derived(repo.delegates.map(d => d.did));
+

+
  // A redaction is "trusted" when its peer is the artifact author or a
+
  // repo delegate. The detail view already blurs the artifact in that
+
  // case; here we hide the whole release if every artifact has been
+
  // redacted that way so the list isn't cluttered with withdrawn rows.
+
  function isFullyRedacted(release: (typeof releases)[number]): boolean {
+
    if (release.artifacts.length === 0) return false;
+
    return release.artifacts.every(a =>
+
      a.redactions.some(
+
        r => r.peer.did === a.author.did || delegateDids.includes(r.peer.did),
+
      ),
+
    );
+
  }
+

  // Releases without artifacts are placeholders the user hasn't published
  // anything to yet — keep them off the list so it shows actual deliverables.
  const visibleReleases = $derived(
-
    releases.filter(r => r.artifacts.length > 0),
+
    releases.filter(r => r.artifacts.length > 0 && !isFullyRedacted(r)),
  );

  const searchable = $derived(