Skip to content

Commit 525a30e

Browse files
bpamiriclaude
andauthored
fix(docs): restore search bar in starlight header (closes #2299) (#2302)
* fix(docs): restore search bar in api/guides starlight header (closes #2299) Custom Header override replaced Starlight's default header without re-mounting <Search />, so api.wheels.dev and guides.wheels.dev lost the search/filter field. Add a conditional `search` slot to the shared Header and fill it from the Starlight override using `virtual:starlight/components/Search`, matching the pattern already used in Footer.astro for EditLink / LastUpdated / Pagination. Landing/blog/packages sites are unaffected — they don't pass a search slot, so the container is not rendered (Astro.slots.has guard). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(docs): refresh guides visual baseline for restored search button Header now renders Pagefind's <Search /> button per #2299 fix. Diff confirms only the new search button area changed (202px > 200 threshold). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e264f89 commit 525a30e

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

web/packages/ui/src/components/Header.astro

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ const links = [
2323
<slot name="after-brand" />
2424
</div>
2525

26+
{
27+
Astro.slots.has('search') && (
28+
<div class="wd-header__search">
29+
<slot name="search" />
30+
</div>
31+
)
32+
}
33+
2634
<button
2735
class="wd-header__toggle"
2836
type="button"
@@ -112,6 +120,18 @@ const links = [
112120
text-decoration: none;
113121
}
114122

123+
.wd-header__search {
124+
display: flex;
125+
align-items: center;
126+
margin-left: auto;
127+
min-width: 0;
128+
}
129+
130+
.wd-header__search :global(site-search) {
131+
display: flex;
132+
align-items: center;
133+
}
134+
115135
.wd-header__nav {
116136
display: flex;
117137
align-items: center;

web/packages/ui/src/components/starlight/Header.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import { getCollection } from 'astro:content';
3+
import Search from 'virtual:starlight/components/Search';
34
import Header from '../Header.astro';
45
import VersionSwitcher from './VersionSwitcher.astro';
56
import { computeVersionOptions } from '@wheels-dev/ui/data/versions';
@@ -32,6 +33,7 @@ const currentVersion = computed?.currentVersion ?? null;
3233
options={options}
3334
currentVersion={currentVersion}
3435
/>
36+
<Search slot="search" />
3537
<VersionSwitcher
3638
slot="in-nav-drawer"
3739
variant="drawer"
1.92 KB
Loading

0 commit comments

Comments
 (0)