Repository navigation
feat(nav): add shared top bar with search and menu - #44
Merged
Merged
Conversation
Replace the per-page headers with one sticky top bar rendered by BaseLayout: back link, page header, search, and a menu on every page except the home page, which gets a floating search button instead. - TopBar/SearchDialog/SearchFab components plus src/scripts/topbar.ts for the menu disclosure, client-side search, and scroll-aware bar - Search indexes tools, projects, pages, and /design/ sections straight from the existing registries, so there is no separate index to keep in sync; "/" and Cmd/Ctrl-K open it, arrows navigate, Enter opens, Esc closes - src/data/nav.ts is the single source for site links and design sections, shared by the menu, search, and the /design/ pill nav - Retire BackLinkFit.astro and back-link.ts: a three-slot 1fr auto 1fr grid gives the back label room to breathe, so it no longer needs measuring, and the label can collapse in CSS instead of by script - Promote the shared chrome tokens (surface ladder, border, radius, motion) into global.css so the bar and footer never depend on tool.css - Accent-red ::selection site-wide, replacing the copy scoped to /tools/ - /design/ gains live specimens for the bar, menu, FAB, and search field, plus updated token and typography tables
The bar and the content are now independent widths rather than one number driving both. Every page with a bar runs it at 900px; the page column below keeps whatever its own shell uses. On the tools and projects listings the bar is therefore deliberately wider than the cards, and on the tool pages it is wider than the panels. The bar's 20px side padding still matches the page columns, so wherever the two measures do match — the design, policy, and Icon Maker pages — they still line up exactly.
…680 column
Those three pinned maxWidth={640} on ToolLayout, overriding its 680
default, so they were 40px narrower than Case Converter for no stated
reason. Dropping the override puts all four standard tools on one
measure; Icon Maker keeps its 900 column.
✅ PR Checks passedTypecheck ( |
Brings the top-bar branch up to date with main (PR #45 and the tool-card polish commit). Conflict resolutions: - src/components/BackLinkFit.astro, src/scripts/back-link.ts — deleted. The bar measures nothing at runtime; the label collapses in CSS under 580px, so the fit component and its script have no callers left. This also retires main's resize-reflow fix on back-link.ts, which only existed to throttle that script. - src/styles/tool.css — dropped the .back-link fit rules along with the component; the bar's back label is styled in global.css. - src/pages/design.astro — kept ColorField (main) and dropped the BackLinkFit import; the colour specimens now use the shared picker. - AGENTS.md, docs/README.md — merged both sides: the top-bar entries stay, and main's ColorField, color-picker and range-fill entries are added alongside them.
PR #45 gated `.tool-item:hover` behind `@media (hover: hover)` so the accent wash and the 3px arrow nudge would not stick after a tap on touch. The later tool-card polish commit rewrote both rules and dropped the gate, so the fix was lost on main. Put the gate back around the wash and the arrow nudge. The `:focus-visible` rule stays outside the media query, so keyboard focus still moves the arrow.
4 tasks done
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.
Every page except the home page now gets a sticky top bar rendered by
BaseLayout: back link, page header, search, and a menu. Home gets a floating search button instead, so the landing page stays a clean hero. The old per-page headers, and the script that measured whether the back-link label would collide with the title, are both gone.Search (
/orCmd/Ctrl-K) indexes tools, projects, pages, and/design/sections straight from the existing registries — there is no separate index to keep in sync, so a new tool or section is searchable as soon as it's registered.Before / after
What changed, in short:
h1on each page becomes one sticky bar rendered byBaseLayout.BackLinkFit.astroandback-link.tsare deleted. The control is a rounded-square button with the same accent hover/press as the rest of the bar./or Cmd/Ctrl-K over tools, projects, pages, and/designsections. Verdana input, one line box whether empty or filled, ✕ clears and is hidden with no query. Design sections stay out of the menu and are reachable by search, so the menu stays short enough to scan in one glance./tools/).Touched
src/components/— newTopBar.astro,SearchDialog.astro,SearchFab.astro;BackLinkFit.astroremovedsrc/layouts/BaseLayout.astro— renders the bar (or the FAB) and the dialog once for every pagesrc/scripts/topbar.ts— new: menu disclosure, search, scroll-aware bar, global keys;back-link.tsremovedsrc/data/nav.ts— new: site links and/design/sections, shared by the menu, search, and the/design/pill navsrc/icons.ts—bars,search,xmarkglyphssrc/pages/**— pages passbarTitle/backHref/barWidthinstead of hand-rolling headers;/tools/,/projects/, and three tool pages adjusted to the 680 columnsrc/styles/global.css— bar + menu + search + FAB styles; chrome tokens promoted here; accent::selectionsite-widesrc/styles/tool.css,src/styles/design.css— retired.back-link/.tool-header/.ds-hero; anchor offset for the sticky bardocs/,README.md,AGENTS.md— architecture map, the bar/content measure rule, and the token tableMerge with
mainmainmoved ahead while this PR was open (PR #45 and the tool-card polish commit), so the branch now carries a merge ofmain(97f49b5). The conflicts were resolved like this:src/components/BackLinkFit.astroandsrc/scripts/back-link.ts— deleted. The bar measures nothing at runtime, so the fit component and its script have no callers left. This also retiresmain's resize-reflow fix onback-link.ts, which only existed to throttle that script.src/styles/tool.css— dropped the.back-linkfit rules along with the component; the bar's back label is styled inglobal.css.src/pages/design.astro— keptColorFieldfrommain, dropped theBackLinkFitimport; the colour specimens use the shared picker.AGENTS.md,docs/README.md— merged both sides: the top-bar entries stay, andmain'sColorField,color-pickerandrange-fillentries are added alongside them.Nothing from either side was dropped:
main's colour picker, the slider fill trails and the100svhmobile-scroll fix all survive the merge, and the bar is unchanged.One extra fix
Merging surfaced a regression that was already on
main: PR #45 gated.tool-item:hoverbehind@media (hover: hover)so the accent wash and the arrow nudge would not stick after a tap on touch, but the later tool-card polish commit rewrote both rules and dropped the gate. This branch restores the gate in its own commit — the:focus-visiblerule stays outside the media query, so keyboard focus still moves the arrow.Notes for review
AGENTS.mdso it doesn't get "fixed" later.translateYis the optical correction; the comment inglobal.cssrecords the measured numbers so it isn't re-derived.Testing
npx astro check— 0 errorsnpm run build— 12 pages, clean/and design sections reachable/andCmd/Ctrl-K, arrow navigation, Enter opens the active result, Escape and backdrop close/design/section) closes the dialog as well as navigatingnpx astro checkandnpm run buildon the merged branch — 0 errors, 12 pages, clean.tool-item:hoverand the arrow nudge are behind@media (hover: hover);:focus-visiblestill moves the arrow outside the queryBuilt with space-bunny-free in the OpenCode harness, running in T3 Code.