Skip to content

feat(docs): dynamic version badge + command-palette search empty state#410

Merged
vishr merged 2 commits into
masterfrom
homepage-version-search
Jun 15, 2026
Merged

feat(docs): dynamic version badge + command-palette search empty state#410
vishr merged 2 commits into
masterfrom
homepage-version-search

Conversation

@vishr

@vishr vishr commented Jun 15, 2026

Copy link
Copy Markdown
Member

Two homepage/UX polish items.

Dynamic version badge

The hero badge was hardcoded Echo v5.2 — now released. It now pulls the latest released echo/v5 at build time (via the Go module proxy — canonical and v5-only, with a graceful fallback) in src/data/github.ts, the same mechanism as the GitHub star count. The daily deploy cron keeps it fresh. (Live latest is currently v5.2.1.)

Command-palette search empty state

The Pagefind search modal showed a large empty void before typing. Replaced it with a launchpad (the Algolia/cmdk pattern — research showed the empty state should give fast access to content, not just a hint):

  • Start here — Quickstart · Routing · Binding
  • Popular — JWT · CORS · Hello World
  • Keyboard-shortcut footer ( open · ↑↓ navigate · esc close)

Injected via a Search component override; shown only while the query is empty (keyed off Pagefind's pagefind-ui__hidden), hidden the moment results appear.

Verified (production build + preview)

  • Launchpad renders in the empty modal (6 links), hides on typing while results show (5 results for "jwt").
  • Version badge renders the live tag; star count still works.

🤖 Generated with Claude Code

vishr and others added 2 commits June 15, 2026 16:39
- Hero version badge pulled at build time (latest echo/v5 via Go module proxy,
  with fallback) instead of hardcoded v5.2 — refreshes via the daily cron.
- Replace the empty Pagefind search modal with a command-palette launchpad
  (Start here / Popular quick links + shortcut footer); shown only while the
  query is empty, hidden once results appear.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- github.ts: require a 'vX' tag (reject empty/garbage so the badge can't render
  blank), and add a 5s fetch timeout to both build-time fetches so a hung
  connection falls back instead of stalling the build.
- Search.astro: bound the empty-state MutationObserver with a 10s timeout +
  dev-only warning, so it can't watch the whole body forever if Pagefind never
  mounts (dev) or selectors change upstream. Mark decorative icons aria-hidden.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vishr vishr merged commit b3df436 into master Jun 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant