Skip to content

Fix search modal alignment and match keyboard hints to design - #36

Open
jbouder wants to merge 3 commits into
mainfrom
misc-fixes
Open

Fix search modal alignment and match keyboard hints to design#36
jbouder wants to merge 3 commits into
mainfrom
misc-fixes

Conversation

@jbouder

@jbouder jbouder commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the search dialog defects tracked in #35:

  • Magnifier icon and clear button were positioned from the form's corner and ended up on the padded input's edge; both are now offset by the form padding.
  • Keyboard hints now render as a footer bar pinned to the bottom of the dialog with ↑↓ navigate, ↵ open, esc close keycap chips, via a new Search component override.
  • An esc keycap sits at the end of the input row on desktop and closes the dialog. It replaces Pagefind's clear button there, per the design; mobile keeps "Cancel" and the clear button and hides the footer.
  • Pagefind's filled magnifier is swapped for an outline icon matching the header trigger.
  • Results scroll between the input and the footer instead of the whole frame scrolling.
  • / move a highlight across result links while focus stays in the input, wrapping at either end; opens the highlighted (or first) result. Neither Pagefind nor Starlight provided this, so the footer hints now describe real behavior.

Closes #35

Test plan

  • bun run test (74 + 2 pass)
  • Production build (cd docs && bun run build && bunx astro preview) checked in Chrome at desktop width: empty state, results state, light and dark
  • Playwright check at 600px viewport: footer hidden, Cancel label and clear button shown
  • esc keycap click closes the dialog
  • Playwright check: / move and wrap the highlight, typing clears it, navigates to the highlighted page and closes the dialog

🤖 Generated with Claude Code

jbouder and others added 3 commits September 1, 2026 15:24
…rched

At min-width 50rem the theme pads .pagefind-ui__form by 1.5rem, but
Pagefind/Starlight position the magnifier icon and clear button
absolutely from the form's corner, so they sat on the input's edge.
Offset both by the padding.

Also only draw the hairline above the "↵ open esc close" hints once
results are showing; before a search it doubled up with the input's
own underline.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Override Starlight's Search component to inject a footer bar pinned to
the bottom of the dialog with keycap chips (↑↓ navigate, ↵ open,
esc close), replacing the plain-text ::after hint. On desktop the
hidden Cancel button is shown as an `esc` keycap at the end of the
input row and takes the place of Pagefind's clear button; mobile keeps
Cancel and the clear button, and hides the footer.

Also swaps Pagefind's filled magnifier for an outline icon matching
the header trigger, and lets results scroll between the input and the
footer.

Refs #35

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Neither Pagefind's default UI nor Starlight handle ↑↓ in the search
dialog, so the footer hints were not yet true. Move a highlight across
result links while focus stays in the input, wrap at either end, clear
it when the query changes or the dialog closes, and follow the
highlighted (or first) link on Enter.

Refs #35

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

Fix Visual Issues Found During Manual Testing

2 participants