Skip to content

fix: chrome polish — theme toggle, palette layout, missing space token#14

Merged
koray-devecioglu merged 1 commit into
mainfrom
fix/chrome-polish
Apr 30, 2026
Merged

fix: chrome polish — theme toggle, palette layout, missing space token#14
koray-devecioglu merged 1 commit into
mainfrom
fix/chrome-polish

Conversation

@koray-devecioglu
Copy link
Copy Markdown
Owner

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.

  • Theme toggle stopped working after the first SPA navigation. ThemeToggle.astro bound its click handler 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 were 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, 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.
  • Removed unused 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.
  • 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.

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 errors
  • pnpm test — 83/83 pass
  • pnpm build — clean, 21 pages indexed by Pagefind
  • Cloudflare Pages preview: open /, hit ⌘K, click the theme toggle, navigate to /cv via the header, click the theme toggle on /cv, scroll to the footer, click the Now link.
  • Confirm g-chord chips are gone from the palette Jump rows.

🤖 Generated with Claude Code

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>
@koray-devecioglu koray-devecioglu merged commit 81f86fb into main Apr 30, 2026
0 of 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