Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Add Releases sidebar tab + auto-seed setting toggle
Daniel Norman committed 7 days ago
commit 40d0a9677c27f37fb68680d01baadc7dcaf25148
parent ff0807c784ef137e1f5ea56c980e22c7b3e75f70
3 files changed +79 -1
added src/components/AutoSeedSwitch.svelte
@@ -0,0 +1,50 @@
+
<script lang="ts">
+
  import { onMount } from "svelte";
+

+
  import Button from "@app/components/Button.svelte";
+
  import { invoke } from "@app/lib/invoke";
+

+
  let enabled = $state<boolean | undefined>(undefined);
+

+
  onMount(async () => {
+
    try {
+
      enabled = await invoke<boolean>("get_auto_seed_artifacts");
+
    } catch (err) {
+
      console.error("get_auto_seed_artifacts failed", err);
+
      enabled = true;
+
    }
+
  });
+

+
  async function set(value: boolean) {
+
    enabled = value;
+
    try {
+
      await invoke("set_auto_seed_artifacts", { enabled: value });
+
    } catch (err) {
+
      console.error("set_auto_seed_artifacts failed", err);
+
    }
+
  }
+
</script>
+

+
<style>
+
  .container {
+
    display: flex;
+
    align-items: center;
+
  }
+
</style>
+

+
<div class="container">
+
  <Button
+
    variant="ghost"
+
    flatRight
+
    active={enabled === true}
+
    onclick={() => set(true)}>
+
    On
+
  </Button>
+
  <Button
+
    variant="ghost"
+
    flatLeft
+
    active={enabled === false}
+
    onclick={() => set(false)}>
+
    Off
+
  </Button>
+
</div>
modified src/components/SidebarRepoList.svelte
@@ -209,6 +209,14 @@
      activeRid() === rid
    );
  }
+

+
  function isReleases(rid: string): boolean {
+
    return (
+
      ($activeRoute.resource === "repo.releases" ||
+
        $activeRoute.resource === "repo.release") &&
+
      activeRid() === rid
+
    );
+
  }
</script>

<style>
@@ -630,12 +638,22 @@
      isPatches(repo.rid),
      activeProject?.meta.patches.open || undefined,
    )}
+
    {@render subItem(
+
      router.routeToPath({
+
        resource: "repo.releases",
+
        rid: repo.rid,
+
      }),
+
      "binary",
+
      "Releases",
+
      isReleases(repo.rid),
+
      undefined,
+
    )}
  {/if}
{/snippet}

{#snippet subItem(
  href: string,
-
  icon: "branch" | "issue" | "patch",
+
  icon: "branch" | "issue" | "patch" | "binary",
  label: string,
  active: boolean,
  count: number | undefined,
modified src/modals/Settings.svelte
@@ -3,6 +3,7 @@
  import { updateChecker } from "@app/lib/updateChecker.svelte";

  import AnnounceSwitch from "@app/components/AnnounceSwitch.svelte";
+
  import AutoSeedSwitch from "@app/components/AutoSeedSwitch.svelte";
  import BadgeCounterSwitch from "@app/components/BadgeCounterSwitch.svelte";
  import Button from "@app/components/Button.svelte";
  import CodeFontSwitch from "@app/components/CodeFontSwitch.svelte";
@@ -113,6 +114,15 @@
    </div>
    <div class="row">
      <div class="row-label">
+
        <span class="row-title">Auto-seed artifacts</span>
+
        <span class="row-description">
+
          Serve artifacts you publish over iroh automatically
+
        </span>
+
      </div>
+
      <AutoSeedSwitch />
+
    </div>
+
    <div class="row">
+
      <div class="row-label">
        <span class="row-title">Code font</span>
        <span class="row-description">Use a monospace font in code views</span>
      </div>