Use configured explorer and seed for links

explorerUrl() hardcoded both the seed ("iris.radicle.network") and
the explorer base ("https://radicle.network"), so every "Copy Link"
and "Open in …" action ignored the user's config and could point at
a host that does not replicate the repo.

Expose publicExplorer and preferredSeeds on the Config type (both
already carried by radicle::profile::Config) and thread config
through to every explorerUrl() call site. URLs are now built from
the publicExplorer template, filling $host from the first preferred
seed (falling back to rosa only when none are configured), and link
labels show the configured explorer's host.

Co-authored-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
hlatimer266
2026-07-21 13:26:31 +02:00
committed by Rūdolfs Ošiņš
co-authored by Rūdolfs Ošiņš
parent 7fe26dc4e5
commit 74aaa6ef14
13 changed files with 109 additions and 28 deletions
+5 -3
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import type { Config } from "@bindings/config/Config";
import type { RepoInfo } from "@bindings/repo/RepoInfo";
import debounce from "lodash/debounce";
@@ -15,9 +16,10 @@
interface Props {
repo: RepoInfo;
config: Config;
}
const { repo }: Props = $props();
const { repo, config }: Props = $props();
const project = $derived(repo.payloads["xyz.radicle.project"]!);
@@ -27,7 +29,7 @@
}, 1000);
async function copyLink() {
await writeToClipboard(explorerUrl(repo.rid));
await writeToClipboard(explorerUrl(repo.rid, config));
copyIcon = "checkmark";
restoreCopyIcon();
}
@@ -131,7 +133,7 @@
style:white-space="nowrap"
style:text-decoration="none"
style:width="100%"
href={explorerUrl(`users/${delegate.did}`)}
href={explorerUrl(`users/${delegate.did}`, config)}
target="_blank">
{#if delegate.alias}
<span class="txt-overflow alias">