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:
Daniel Norman
2026-09-22 11:53:17 +02:00
committed by Rūdolfs Ošiņš
parent f1ee718886
commit d36b064dd1
9 changed files with 186 additions and 58 deletions
+25 -2
View File
@@ -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">