Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Run formatters across new release code
Daniel Norman committed 7 days ago
commit cf005da3b89d9b70c92abb85dbcead93ef27edfb
parent 40d0a9677c27f37fb68680d01baadc7dcaf25148
8 files changed +44 -32
modified crates/radicle-tauri/src/commands/cob/release.rs
@@ -135,11 +135,9 @@ pub async fn redact_artifact(
    reason: String,
) -> Result<(), Error> {
    let ctx = ctx.inner().clone();
-
    tauri::async_runtime::spawn_blocking(move || {
-
        ctx.redact_artifact(rid, release_id, cid, reason)
-
    })
-
    .await
-
    .map_err(|e| Error::Iroh(format!("join: {e}")))?
+
    tauri::async_runtime::spawn_blocking(move || ctx.redact_artifact(rid, release_id, cid, reason))
+
        .await
+
        .map_err(|e| Error::Iroh(format!("join: {e}")))?
}

// Seed / unseed -------------------------------------------------------------
@@ -314,10 +312,7 @@ pub fn get_auto_seed_artifacts(ctx: tauri::State<AppState>) -> Result<bool, Erro
}

#[tauri::command]
-
pub fn set_auto_seed_artifacts(
-
    ctx: tauri::State<AppState>,
-
    enabled: bool,
-
) -> Result<(), Error> {
+
pub fn set_auto_seed_artifacts(ctx: tauri::State<AppState>, enabled: bool) -> Result<(), Error> {
    let mut settings = radicle_types::settings::load(ctx.profile.home().path());
    settings.auto_seed_artifacts = enabled;
    radicle_types::settings::save(ctx.profile.home().path(), &settings)
modified crates/radicle-types/src/fetch.rs
@@ -60,10 +60,9 @@ where
    while let Some(item) = stream.next().await {
        match item {
            DownloadProgressItem::TryProvider { .. } => on_progress(FetchStage::Connecting),
-
            DownloadProgressItem::Progress(bytes) => {
-
                on_progress(FetchStage::Downloading { bytes })
-
            }
-
            DownloadProgressItem::PartComplete { .. } | DownloadProgressItem::ProviderFailed { .. } => {}
+
            DownloadProgressItem::Progress(bytes) => on_progress(FetchStage::Downloading { bytes }),
+
            DownloadProgressItem::PartComplete { .. }
+
            | DownloadProgressItem::ProviderFailed { .. } => {}
            DownloadProgressItem::Error(e) => return Err(Error::Iroh(format!("download: {e}"))),
            DownloadProgressItem::DownloadError => {
                return Err(Error::Iroh("download failed".into()));
modified crates/radicle-types/src/seeder.rs
@@ -115,8 +115,8 @@ pub async fn import_blob(store: &Store, path: &Path, expected: &Cid) -> Result<H

/// Import a directory as a Collection, copying each file's bytes.
pub async fn import_collection(store: &Store, dir: &Path, expected: &Cid) -> Result<Hash, Error> {
-
    let entries = cid_utils::canonical_walk(dir)
-
        .map_err(|e| Error::Iroh(format!("walk directory: {e}")))?;
+
    let entries =
+
        cid_utils::canonical_walk(dir).map_err(|e| Error::Iroh(format!("walk directory: {e}")))?;

    let mut pairs: Vec<(String, Hash)> = Vec::new();
    for (name, abs) in entries {
@@ -150,8 +150,7 @@ pub async fn import_collection(store: &Store, dir: &Path, expected: &Cid) -> Res
/// Mark a CID as seeded by setting the `seeded/{cid}` tag pointing at the
/// blob hash with the format appropriate for its kind (raw vs hash-seq).
pub async fn register_seeded(store: &Store, cid: &Cid, hash: Hash) -> Result<(), Error> {
-
    let kind =
-
        cid_utils::artifact_kind(cid).map_err(|e| Error::Iroh(format!("cid kind: {e}")))?;
+
    let kind = cid_utils::artifact_kind(cid).map_err(|e| Error::Iroh(format!("cid kind: {e}")))?;
    let value = match kind {
        ArtifactKind::Blob => HashAndFormat::raw(hash),
        ArtifactKind::Collection => HashAndFormat::hash_seq(hash),
@@ -187,8 +186,8 @@ pub async fn is_seeded(store: &Store, cid: &Cid) -> Result<bool, Error> {
/// the seeded tag, and returns the import hash as a string for logging.
pub async fn seed(store: &Store, cid: &str, source: &Path) -> Result<(), Error> {
    let parsed_cid = Cid::from_str(cid).map_err(|e| Error::Iroh(format!("invalid cid: {e}")))?;
-
    let kind = cid_utils::artifact_kind(&parsed_cid)
-
        .map_err(|e| Error::Iroh(format!("cid kind: {e}")))?;
+
    let kind =
+
        cid_utils::artifact_kind(&parsed_cid).map_err(|e| Error::Iroh(format!("cid kind: {e}")))?;
    let hash = match kind {
        ArtifactKind::Blob => import_blob(store, source, &parsed_cid).await?,
        ArtifactKind::Collection => import_collection(store, source, &parsed_cid).await?,
modified crates/test-http-api/src/api.rs
@@ -110,14 +110,23 @@ pub fn router(ctx: Context) -> Router {
        .route("/release_by_id", post(release_by_id_handler))
        .route("/releases_by_commit", post(releases_by_commit_handler))
        .route("/compute_artifact_cid", post(compute_artifact_cid_handler))
-
        .route("/create_or_open_release", post(create_or_open_release_handler))
+
        .route(
+
            "/create_or_open_release",
+
            post(create_or_open_release_handler),
+
        )
        .route("/add_artifact", post(add_artifact_handler))
        .route("/add_location", post(add_location_handler))
        .route("/remove_location", post(remove_location_handler))
        .route("/attest_artifact", post(attest_artifact_handler))
        .route("/redact_artifact", post(redact_artifact_handler))
-
        .route("/get_auto_seed_artifacts", post(get_auto_seed_artifacts_handler))
-
        .route("/set_auto_seed_artifacts", post(set_auto_seed_artifacts_handler))
+
        .route(
+
            "/get_auto_seed_artifacts",
+
            post(get_auto_seed_artifacts_handler),
+
        )
+
        .route(
+
            "/set_auto_seed_artifacts",
+
            post(set_auto_seed_artifacts_handler),
+
        )
        .route("/list_notifications", post(list_notifications_handler))
        .route("/notification_count", post(notification_count_handler))
        .route("/clear_notifications", post(clear_notifications_handler))
modified src/components/AutoSeedSwitch.svelte
@@ -1,9 +1,10 @@
<script lang="ts">
  import { onMount } from "svelte";

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

+
  import Button from "@app/components/Button.svelte";
+

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

  onMount(async () => {
modified src/views/repo/NewRelease.svelte
@@ -29,7 +29,7 @@
  };

  let oid = $state("");
-
  let files = $state<StagedFile[]>([]);
+
  const files = $state<StagedFile[]>([]);
  let submitting = $state(false);
  let autoSeed = $state(true);
  let submitError: string | undefined = $state();
modified src/views/repo/Release.svelte
@@ -8,12 +8,12 @@

  import { invoke } from "@app/lib/invoke";

-
  import Layout from "./Layout.svelte";
  import Topbar from "@app/components/Topbar.svelte";

+
  import Layout from "./Layout.svelte";
+

  interface Props {
    repo: RepoInfo;
-
    releases: Release[];
    release: Release;
  }

@@ -245,19 +245,27 @@
        <span class="kind">[{artifact.kind}]</span>
        <span class="cid">{shortCid(artifact.cid)}</span>
        <div class="actions">
-
          <button onclick={() => download(artifact)} disabled={busy[artifact.cid]}>
+
          <button
+
            onclick={() => download(artifact)}
+
            disabled={busy[artifact.cid]}>
            Download
          </button>
          {#if isShared(artifact)}
-
            <button onclick={() => unseed(artifact)} disabled={busy[artifact.cid]}>
+
            <button
+
              onclick={() => unseed(artifact)}
+
              disabled={busy[artifact.cid]}>
              Unseed
            </button>
          {:else}
-
            <button onclick={() => seed(artifact)} disabled={busy[artifact.cid]}>
+
            <button
+
              onclick={() => seed(artifact)}
+
              disabled={busy[artifact.cid]}>
              Seed
            </button>
          {/if}
-
          <button onclick={() => attest(artifact)} disabled={busy[artifact.cid]}>
+
          <button
+
            onclick={() => attest(artifact)}
+
            disabled={busy[artifact.cid]}>
            Attest
          </button>
        </div>
modified src/views/repo/Releases.svelte
@@ -4,11 +4,12 @@

  import * as router from "@app/lib/router";

-
  import Layout from "./Layout.svelte";
-
  import NewRelease from "./NewRelease.svelte";
  import ScrollArea from "@app/components/ScrollArea.svelte";
  import Topbar from "@app/components/Topbar.svelte";

+
  import Layout from "./Layout.svelte";
+
  import NewRelease from "./NewRelease.svelte";
+

  interface Props {
    repo: RepoInfo;
    releases: Release[];