fix: chrome polish — theme toggle, palette layout, missing space token#14
Merged
Conversation
Four small fixes spotted while reviewing the live site post-CV-update. Theme toggle stopped working after the first SPA navigation. The click handler was bound on DOMContentLoaded only, so once Astro's ClientRouter swapped in fresh HTML the new button had no listener. Mirrors the pattern already used by CommandPalette: also re-init on `astro:after-swap`. Command palette result rows rendered unstyled — kbd hints, post-type subtitles, and the keyboard-navigation highlight all collapsed into the title row. Root cause: the rules for `.palette__item`, `.palette__item-title`, `.palette__item-sub`, `.palette__item-hint` and `.palette__group` lived inside a scoped <style> block, but those class names only ever appear on elements built at runtime via `document.createElement` — Astro's style scoper never tags those. Fix by moving just the dynamic-element rules into a sibling <style is:global> block, keeping the rest of the palette CSS scoped. While in there, dropped the `g h` / `g p` / etc. chord hints from the Jump items. They were advertised in the UI but had no keyboard handler backing them — pressing the chord did nothing. Removing the hints also lets the palette row drop its 1fr/auto grid for a simpler flex column layout. The footer's indie-web nav (Now / Uses / Reading / Colophon) rendered as one concatenated underline. Five sites in the codebase referenced `var(--space-5)` but the token was missing from `tokens.css` — the scale jumped 4 → 6. The undefined column-gap fell through to 0, so flex items sat edge-to-edge and their underlines touched. Adding `--space-5: 20px` (a smooth 16 → 20 → 24 step) restores spacing in the footer nav, the command-palette padding, and the 404 page action grid in one shot. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four small fixes spotted while reviewing the live site after merging the real CV. All four were observable bugs, found by clicking around (
/cv, the ⌘K palette, the footer) — not from CI or tests catching them.DOMContentLoadedonly, so once Astro'sClientRouterswapped in fresh HTML, the new button had no listener. Mirrors the pattern already used byCommandPalette— also re-init onastro:after-swap..palette__item,.palette__item-title,.palette__item-sub,.palette__item-hint, and.palette__groupwere inside a scoped<style>block, but those class names only ever appear on elements built at runtime viadocument.createElement— Astro's style scoper never tags those, so the rules matched nothing. Fix by moving just the dynamic-element rules into a sibling<style is:global>block, keeping the rest of the palette CSS scoped.g h/g p/ etc. chord hints from the Jump items. They were advertised in the UI but had no keyboard handler backing them — pressing the chord did nothing. Removing the hints also lets the palette row drop its1fr / autogrid for a simpler flex column layout.var(--space-5)but the token was missing fromtokens.css— the scale jumped 4 → 6. The undefined column-gap fell through to0, so flex items sat edge-to-edge and their underlines touched. Adding--space-5: 20px(a smooth 16 → 20 → 24 step) restores spacing in the footer nav, the command-palette padding, and the 404 page action grid in one shot.Why this lot together
All four are tiny, all four are user-visible chrome bugs, and all four turned up in the same pass over the site. Splitting them across four PRs would be more noise than signal.
Test plan
pnpm typecheck— 0 errorspnpm test— 83/83 passpnpm build— clean, 21 pages indexed by Pagefind/, hit ⌘K, click the theme toggle, navigate to/cvvia the header, click the theme toggle on/cv, scroll to the footer, click the Now link.g-chord chips are gone from the palette Jump rows.🤖 Generated with Claude Code