refactor/design #2
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/design"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR Type Selection
Select the type of change (check one):
Summary
Adopt the shared BlackHatMagic design system (
Main-Theme/feat/npm/DESIGN.md)across lukeh.xyz: correct the semantic color tokens for all eleven themes,
self-host the three typefaces, and bring the header, pages, and rendered
artifacts in line with the spec. The audit also turned up several defects,
which are fixed here (theme flash, hover-only popovers, a missing page
heading, and stale copy).
Related Issues
N/A — no tracked issue. Design source:
BlackHatMagic/Main-Theme,feat/npm/DESIGN.md.Intent/Motivation/Rationale
The site already used the Main-Theme palette names but had drifted from the
spec: wrong token values, missing roles, ad-hoc Tailwind colors/radii/shadows,
Google-hosted fonts, and hover-only popovers. Consolidating on the spec's
semantic roles lets the eleven themes drop in unchanged and keeps future
visual changes localized to
static/css/main.css.Scope
static/css/main.css— token layer + shared component stylesstatic/js/theme-init.js— shared pre-paint theme resolver (new)package.json,bun.lock,build:assets— font/asset pipelinesrc/App.svelte,src/lib/*.svelte,src/lib/stat-blocks/preview/stat-block.csssrc/pages/**/*.html— inline theme script replaced by the shared resolvertests/e2e/stat-blocks.spec.ts— nav assertion updated from hover to clickUpdates/Changes
#1e66f5vs#135cea,#ccd0davs#c2c6d0, …) and omittedborder-strong/error; the headerwas ~74px with a blurred shadow; popovers opened on hover; fonts came from
Google; components mixed
rounded-*,shadow-*,bg-blue-*,font-black.roles; a 72px border-only header with click-based, keyboard-dismissible
popovers; self-hosted Space Grotesk / Figtree / Noto Serif; square controls
with hard offset shadows and semantic roles only.
systemand follows OSchanges; the pre-paint script no longer flashes
dracula/strawberry-dark;reduced-motion is honored (typewriter, shimmer, spinner); prose links keep a
visible underline; inputs use
border-strong; the USTU page regained itsh1; the stat block uses the artifact serif.Checklist
Three boxes above are intentionally unchecked: the refactor carries a small
set of deliberate behavior changes (listed in Additional Notes), and one e2e
assertion was updated to match the new click-based navigation.
Additional Notes
Intentional behavior changes (required for spec conformance or bug fixes):
pointer-down, or focus-out (spec: "Open them on click (not on hover)").
System/Light/Dark;systemis the defaultand tracks
prefers-color-scheme.prefers-reduced-motion.alert();its tabs follow the APG keyboard pattern.
Verification:
bun run check(tsc + eslint) — cleanbun test tests/stat-blocks.test.ts— 3/3bunx playwright test— 6/6refactor/design— successRisks: the visual delta is broad by nature, but the token layer is centralized
so regressions are easy to isolate. No API, database, or dependency behavior
changed.
Pi code review
4 new actionable findings
static/css/main.css:203static/css/main.css:530static/css/main.css:203static/css/main.css:530Reviewed head
6462413against base9f71625, including theme resolution, asset/deployment wiring, shared styles, page components, and navigation tests. Verification was read-only: builds, tests, and browser rendering were unavailable, and the external design specification could not be checked. Reviewed the design refactor at6462413against9f71625, including theme initialization, asset delivery, navigation, math controls, and selected page components. The supplied diff was partial and repository inspection was budget-limited; no checks or browser rendering were run, and the external design specification was unavailable.Change walkthrough
package.json,bun.lockstatic/css/main.css,static/js/theme-init.js,src/App.svelte,src/lib/Nav.svelte(+9 more)tests/e2e/stat-blocks.spec.tsReview effort: 4/5.
Static observations (not validation results)
Reviewed
6462413871ff708f2f788f138efe1ee1a83a4a9dwithproxy/gpt-6.1-sol. Automated advisory review; no project commands or tests were executed.@ -97,0 +200,4 @@min-width: 0;}.site-nav__links > li { position: relative; }.site-nav__links a,[P2] Restrict top-level navigation styles to top-level controls
Quality regression: the Projects dropdown now lives inside
.site-nav__links, so this descendant selector also styles every project card. Its higher specificity overrides.site-nav__project { display: block }, placing each title and description beside one another in a fixed-height, non-wrapping flex row. The resulting oversized grid columns push project entries outside the dropdown and viewport. Restrict these navigation-control selectors to direct children of the top-level list items.Trigger: Open Projects on any page using the shared header, particularly at a desktop viewport around 1024px wide.
Impact: Project descriptions overflow instead of wrapping, and links in the second dropdown column can be pushed off-screen, obstructing navigation to featured projects.
Evidence: src/lib/Nav.svelte:150-178 nests the dropdown and all six project anchors under
.site-nav__links; at base, the dropdown was a sibling of that list. static/css/main.css:203-220 appliesdisplay: inline-flex,height: 40px, andwhite-space: nowrapto all descendant anchors. This selector outranks the later.site-nav__projectblock rule. The dropdown uses two1frgrid columns with content-based minimum sizes, whilebodyclips horizontal overflow; the responsive rules do not remove the inherited non-wrapping flex layout.[P2] Projects links inherit top-level navigation sizing and overflow
[Quality] Moving the Projects dropdown inside .site-nav__links makes every project link match the top-level navigation rule. Its higher specificity overrides .site-nav__project's block layout with inline-flex, a fixed 40px height, and nowrap text, putting each title and description alongside one another instead of stacking and wrapping them.
Trigger: Open Projects on any page using Nav.svelte, particularly on a phone or a desktop viewport narrower than the resulting unwrapped dropdown content.
Impact: Project entries overflow their dropdown columns and can extend beyond the clipped viewport, making navigation labels unreadable and some links unavailable to pointer users.
Evidence: Current Nav.svelte nests .site-nav__dropdown and its .site-nav__project anchors inside the Projects li under ul.site-nav__links; the base version placed the dropdown outside that ul. static/css/main.css:203 applies display:inline-flex, height:40px, and white-space:nowrap to all descendant anchors. This selector is more specific than .site-nav__project's display:block rule, and neither the two-column dropdown grid nor the mobile one-column override resets those inherited link styles. body retains overflow-x:clip.
@ -154,0 +527,4 @@.social-links a:hover { border-color: var(--border); background: var(--muted); }/* ---------- Math tools ---------- */.math-page .math-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }[P2] Keep vector-operation tabs reachable on narrow screens
Quality regression: all eight vector-operation tabs are now placed in one horizontal flex row without wrapping or horizontal scrolling. Their combined minimum widths exceed a phone viewport, leaving later calculator tabs outside the visible page. Allow the tab list to wrap or provide an accessible horizontal scrolling layout.
Trigger: Visit
/projects/mathat a narrow viewport such as 375px wide and try to choose a later operation using touch.Impact: Phone users cannot reach operations such as Cross Product, Triple Scalar Product, and Vector Projection through the visible tab controls.
Evidence: src/lib/Math.svelte:143-147 renders all eight operation buttons in
.math-tabs--sub. static/css/main.css:530-543 makes the list a non-wrapping flex row with padded buttons and default content-based minimum widths. The page and panel constrain the available width,bodyusesoverflow-x: clip, and neither responsive media query adds wrapping or scrolling for this list. The base implementation displayed these operation buttons vertically in a single-column inline grid.[P2] Vector-operation tabs are clipped on narrow screens
[Quality] The eight vector-operation tabs now occupy a single horizontal flex row without wrapping or horizontal scrolling. Their combined minimum content widths exceed a phone viewport, so later operations extend off-screen.
Trigger: Visit /projects/math on a narrow viewport such as 375px and try to select a later operation, such as Cross Product, Triple Scalar Product, or Vector Projection.
Impact: Touch and pointer users cannot reach calculator operations whose tabs are outside the viewport.
Evidence: Math.svelte renders all eight operations in .math-tabs.math-tabs--sub. static/css/main.css:530 sets .math-tabs to display:flex with no flex-wrap or overflow handling; the buttons have horizontal padding, and the enclosing panel further reduces available width. Neither responsive media query changes this layout, while body uses overflow-x:clip. The base Math.svelte displayed the operation buttons in a vertical inline-grid, so the operation selector did not require this wide horizontal row.
Pi code review
1 new actionable finding
src/lib/Nav.svelte:159Earlier findings: 4 rechecked
static/css/main.css:530, first reported in review #46) — Current static/css/main.css sets flex-wrap: wrap on .math-page .math-tabs. This applies to the eight operation buttons rendered inside .math-tabs--sub in src/lib/Math.svelte, allowing later operations to wrap rather than extend beyond the clipped viewport.static/css/main.css:203, first reported in review #46) — Current static/css/main.css restricts inline-flex, fixed-height, and nowrap navigation styling to .site-nav__links > li > a and > button. The nested project anchors in src/lib/Nav.svelte no longer match these rules, so .site-nav__project retains its block layout and its title and description can stack and wrap.static/css/main.css:203, first reported in review #46) — The current top-level navigation selectors use direct-child combinators, excluding the project anchors nested inside .site-nav__dropdown. The remaining narrow-screen descendant rule only adjusts font size and padding; it does not reintroduce inline-flex, a fixed height, or nowrap on project cards.static/css/main.css:530, first reported in review #46) — Current static/css/main.css explicitly enables flex-wrap: wrap for .math-page .math-tabs, including the vector-operation list in src/lib/Math.svelte. The previously reported single-row clipping mechanism is therefore removed.Reviewed
9af4da5against9f71625across the theme and asset pipeline, navigation, page layouts, calculators, and artifact styling; no new evidence-supported findings were identified, and all four prior reports are fixed in current code. Verification was read-only: builds, tests, and browser rendering were not run, and the external Main-Theme specification was unavailable. Reviewed the supplied patch and surrounding navigation, theme, asset-build, math, contact, and stat-block code, comparing relevant behavior with the pinned base. No checks were run; repository-read limits prevented complete coverage, and the external design specification was unavailable.Change walkthrough
package.json,bun.lockstatic/css/main.css,static/js/theme-init.js,src/App.svelte,src/lib/Nav.svelte(+9 more)tests/e2e/stat-blocks.spec.tsReview effort: 4/5.
Static observations (not validation results)
Reviewed
9af4da5068ea7ad87d0e07e2d36cf78cb7d72cbbwithproxy/gpt-6.1-sol. Automated advisory review; no project commands or tests were executed.@ -121,0 +156,4 @@<HugeiconsIcon class={`chevron${dropdownOpen ? ' is-open' : ''}`} icon={ArrowDown01Icon} size={14} strokeWidth={1.8} aria-hidden="true" /></button>{#if dropdownOpen}<div class="popover site-nav__dropdown">[P2] Mobile Projects menu expands inside a narrow flex item
[Quality] The dropdown now lives inside the Projects list item, but the mobile stylesheet changes it to
position: static; width: 100%. That percentage is relative to the list item, not the navigation or viewport. On narrow phones, the six descriptive links consequently wrap into a very tall column inside the sticky header instead of using the available screen width.Trigger: Open Projects on a narrow mobile viewport, such as 320 × 568, where the stylesheet's max-width: 820px rules apply.
Impact: The expanded header obscures the page and places lower project destinations below the viewport, requiring whole-page scrolling to reach links that previously fit substantially better in the viewport-width dropdown.
Evidence: src/lib/Nav.svelte:153–159 nests the dropdown in a
<li>alongside Home, Blog, and Contact. static/css/main.css keeps.site-nav__linksas a horizontal flex container with centered cross-axis alignment, while its mobile rule makes.site-nav__dropdownstatic and 100% wide; neither the dropdown nor the sticky header has a height limit or internal scrolling. At base, the mobile dropdown remained absolutely positioned and usedwidth: calc(100vw - 32px)below 520px, so its width was not constrained by the Projects flex item.Pi code review
0 new actionable findings
No new actionable findings. Previously reported issues, if any, are tracked below.
Earlier findings: 1 rechecked
src/lib/Nav.svelte:159, first reported in review #47) — At head, static/css/main.css:591–611 replaces the mobile static dropdown layout: navigation list items become position: static, while the dropdown is absolutely positioned with top: 100%, left: 0, right: 0, width: auto, and transform: none. Its containing block is now the positioned .site-header rather than the narrow Projects list item, removing the reported width constraint and in-flow header expansion. This was verified by code inspection, not browser execution.Reviewed head
2d90ae8against base9f71625, covering theme resolution, asset delivery, navigation, shared styling, and interactive pages; no new evidence-supported bugs were found. The previous mobile dropdown-width defect is fixed, but browser behavior and checks were not exercised, and the external DESIGN.md was unavailable for exact specification comparison. Reviewed the supplied diff and surrounding theme, navigation, asset-build, page, and demo code at the pinned head/base; no evidence-supported actionable bugs were identified. Builds, tests, and browser rendering were unavailable, and the complete commit diff and external design specification were not provided.Change walkthrough
static/css/main.css,static/js/theme-init.js,src/App.svelte,src/lib/Nav.svelte(+8 more)package.json,bun.locktests/e2e/stat-blocks.spec.tsReview effort: 4/5.
Static observations (not validation results)
Reviewed
2d90ae8d43fb9920c00197deced8cdd565c7f1afwithproxy/gpt-6.1-sol. Automated advisory review; no project commands or tests were executed.Pi code review
1 new actionable finding
static/css/main.css:612Reviewed the supplied base-to-head changes, including theme initialization, shared styles, navigation, page components, asset packaging, and existing test coverage. Review was read-only; builds, tests, and browser rendering were unavailable, and the external Main-Theme specification could not be independently verified. Reviewed the design-system refactor at the supplied head against the supplied base, including theme resolution, navigation, asset delivery, calculator interactions, and stat-block styling; no evidence-supported bugs were identified. Verification was limited to read-only source inspection: no checks or browser tests were run, and the external Main-Theme specification was unavailable.
Change walkthrough
static/css/main.css,static/js/theme-init.js,src/App.svelte,src/lib/Nav.svelte(+8 more)package.json,bun.locktests/e2e/stat-blocks.spec.tsReview effort: 4/5.
Static observations (not validation results)
Reviewed
9855881a98c833868964c8c5a4b00976f9b284fcwithproxy/gpt-6.1-sol. Automated advisory review; no project commands or tests were executed.@ -156,0 +609,4 @@box-shadow: none;padding: 8px var(--gutter);}.site-nav__dropdown-inner { grid-template-columns: 1fr; }[P2] Landscape navigation hides lower project links
Quality regression: the responsive breakpoint now stacks all six project links below a two-row sticky header without constraining or scrolling the popover. In a short landscape viewport, the lower links extend below the visible screen; scrolling the page leaves the header and its popover pinned in place. Keep the dropdown within the available viewport height and allow it to scroll.
Trigger: Open Projects in a viewport around 800 × 430 CSS pixels, such as a landscape mobile browser or a short desktop window.
Impact: Pointer and touch users cannot reach the lower project-navigation entries, including View All, through the open menu.
Evidence: static/css/main.css:593 makes the header wrap into two rows below 820px, while lines 599–612 anchor the absolute dropdown below that sticky header and change its grid to one column. Nav.svelte renders six links with descriptions; their padding and text heights exceed the remaining viewport height, and the dropdown styles provide neither a height limit nor overflow scrolling. At the base commit, an 800px-wide viewport retained the two-column dropdown, so these entries occupied only three rows.
Pi code review
0 new actionable findings
No new actionable findings. Previously reported issues, if any, are tracked below.
Earlier findings: 1 rechecked
static/css/main.css:612, first reported in review #49) — Current static/css/main.css constrains .site-nav__dropdown below the 820px breakpoint with max-height: calc(100dvh - 100%) and overflow-y: auto. The dropdown remains positioned below the sticky header, but its six project links in src/lib/Nav.svelte can now scroll within the remaining viewport instead of extending into an unreachable pinned region; browser verification was not available.Reviewed head
4c0e098against base9f71625, including the design refactor, theme initialization, asset pipeline, affected components, and surrounding callers; no evidence-supported bugs meeting the reporting threshold were found. This was a read-only review: builds, tests, and browser checks were not run, and exact conformance to the external Main-Theme specification could not be verified. Reviewed the supplied diff and relevant theme, navigation, build, math, and demo code against the pinned base; no new actionable findings were identified. This was a static, access-budget-limited review: no checks or browser tests were run, and the external design specification was unavailable.Change walkthrough
static/css/main.css,static/js/theme-init.js,src/App.svelte,src/lib/Nav.svelte(+9 more)package.json,bun.locktests/e2e/stat-blocks.spec.tsReview effort: 3/5.
Static observations (not validation results)
Reviewed
4c0e098e6cbd8f5b2d9721e63e0e65ec824fd9adwithproxy/gpt-6.1-sol. Automated advisory review; no project commands or tests were executed.