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
+11 -3
View File
@@ -4,7 +4,12 @@
import debounce from "lodash/debounce";
import { writeToClipboard } from "@app/lib/invoke";
import { didFromPublicKey, explorerUrl, truncateDid } from "@app/lib/utils";
import {
didFromPublicKey,
explorerHost,
explorerUrl,
truncateDid,
} from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import DropdownListItem from "@app/components/DropdownListItem.svelte";
@@ -60,11 +65,14 @@
style:text-decoration="none"
style:width="100%"
onclick={closeFocused}
href={explorerUrl(`users/${didFromPublicKey(config.publicKey)}`)}
href={explorerUrl(
`users/${didFromPublicKey(config.publicKey)}`,
config,
)}
target="_blank">
<DropdownListItem styleGap="0.5rem" styleWidth="100%" selected={false}>
<Icon name="seed" />
view on iris.radicle.network
Open in {explorerHost(config)}
<span style:margin-left="auto"><Icon name="open-external" /></span>
</DropdownListItem>
</a>