mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Separate the search seed from the viewed node
Picking a seed only set the stored preference and left the page on whatever node the URL named, so the node could not be changed from the UI at all. The two are now independent: you can browse a repo on one node while searching a larger index on another.
This commit is contained in:
+25
-2
@@ -9,6 +9,7 @@
|
||||
followSystemTheme,
|
||||
loadTheme,
|
||||
} from "@app/lib/appearance";
|
||||
import { activeUnloadedRouteStore, routeBaseUrl } from "@app/lib/router";
|
||||
import { determineSeed, selectedSeed } from "@app/views/nodes/SeedSelector";
|
||||
|
||||
import Button from "@app/components/Button.svelte";
|
||||
@@ -19,6 +20,9 @@
|
||||
return `${seed.scheme}://${seed.hostname}:${seed.port}`;
|
||||
}
|
||||
|
||||
// The node serving the page on screen. Undefined on routes that name no node
|
||||
// in their URL (explore, landing, docs), where the row is hidden.
|
||||
$: currentNode = routeBaseUrl($activeUnloadedRouteStore);
|
||||
$: searchSeed = $selectedSeed ?? determineSeed();
|
||||
|
||||
// Whether the selected seed exposes the search backend (drives the callout).
|
||||
@@ -99,11 +103,30 @@
|
||||
</style>
|
||||
|
||||
<div class="settings">
|
||||
{#if currentNode}
|
||||
<div class="seed-setting">
|
||||
<div class="seed-setting-row">
|
||||
<div>Current node</div>
|
||||
<div class="right">
|
||||
<SeedPicker
|
||||
baseUrl={currentNode}
|
||||
mode="node"
|
||||
ariaLabel="Current node selector"
|
||||
title="Switch the node serving this page" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="description">The node serving the page you’re viewing.</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="seed-setting">
|
||||
<div class="seed-setting-row">
|
||||
<div>Explore seed</div>
|
||||
<div>Search seed</div>
|
||||
<div class="right">
|
||||
<SeedPicker baseUrl={searchSeed} navigateOnApply={false} />
|
||||
<SeedPicker
|
||||
baseUrl={searchSeed}
|
||||
mode="search"
|
||||
ariaLabel="Search seed selector"
|
||||
title="Switch the seed used for search and explore" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
Reference in New Issue
Block a user