Room under the homepage titles, and the site stops flashing on every click #12

Merged
austin merged 5 commits from home-titles-and-page-transitions into main 2026-07-26 22:21:13 -05:00
5 Commits
Author SHA1 Message Date
austinandClaude Opus 5 7449744682 A test for the class that gets thrown away
build-and-publish / build (pull_request) Successful in 1m57s
The bug this guards has now been written seven times, and the reason is that
nothing tells you: Thymeleaf drops the class, renders the page, and the result
looks nearly right. A reviewer has to know the rule and then spot it.

So the rule is a test. It walks the templates, finds any tag carrying both a
class and a th:replace, and fails with the file, the line and the tag. No Spring
context and no database — it reads files, and costs five milliseconds.

th:insert is deliberately not checked: that one keeps the host tag, so a class
on it is fine.

The second test guards the first. A file-walking assertion that quietly stopped
finding files would pass forever, so it asserts the templates are actually there
to be read.

Verified by putting the catering divider's dropped mt-10 back and watching it
fail with that exact line, then removing it again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 22:17:06 -05:00
austin bf49f857a8 Merge remote-tracking branch 'origin/main' into home-titles-and-page-transitions 2026-07-26 22:13:05 -05:00
austinandClaude Opus 5 68f1ec5961 The classes that were being written and thrown away
A sweep for the bug behind the homepage titles found five more of it, because
the mistake is easy and silent: put a class on the tag you write a th:replace
on, and Thymeleaf hands you back the fragment with its own class attribute and
drops yours. Nothing warns, and the page looks nearly right.

  catering  the divider's mt-10, so the branch mark sat on the paragraph above it
  contact   mt-4 under both "Our hours" and "Find us" — the same flush headings
            the homepage had
  footer    mt-4 between the address and the hours under it
  home      text-bakery-800 on the address, which is why "Find us" rendered a
            shade darker (bakery-900, inherited from body) than "Our hours" in
            the panel beside it

Fixed where the fragments already said it should be: "both fragments take the
classes that vary by where they sit". They now take two — the element's own
class as well as the row's or the link's — so the caller has somewhere to put
this that survives. `divider` takes its spacing the same way.

A class on a th:replace tag now has no reason to exist anywhere in the
templates, and there are none left.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 22:13:05 -05:00
austinandClaude Opus 5 5aa2e4589e The site stops flashing white on every click
build-and-publish / build (pull_request) Successful in 2m15s
Clicking a nav link or a filter chip made the whole site look like it reloaded,
because it did: body carried `opacity: 0` and a half-second fadeIn, so every
navigation went blank, then slid 10px and faded back.

Those two lines are the SPA's. There they ran once, when React booted, and every
navigation afterwards happened inside a document that had already faded in.
Server-rendered, every link is a new document, so a once-per-session animation
became a once-per-click one — and the thing it was decorating was already fast.

Replaced with the cross-document view transition it was reaching for: the
browser holds the old page up until the new one is ready and cross-fades, so
nothing is ever blank. Where it isn't supported the navigation is simply
immediate, which is the right fallback and still better than a blank page.
Reduced motion keeps the navigation and drops the cross-fade; the print rule no
longer has to undo an opacity that isn't set any more.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 22:07:52 -05:00
austinandClaude Opus 5 b344d45978 Room under the homepage titles, which had none
"What people come in for" and "Visit us" were written with an mb-12 and rendered
with nothing: th:replace swaps the whole host element out for the fragment, so
the class attribute on that tag never reaches the page. Both titles sat flush on
the grid below them. Confirmed against the running site — mb-12 appears nowhere
in the served HTML.

The gap moves to the element below, which is where catering already keeps it
(mt-8 on its price grids) and which is the only place th:replace cannot eat it.
A little wider than the twelve that was intended, since the point is the breath:
14, and 18 from md.

The card captions get the same treatment — py-8 rather than py-6, and px-4 so a
longer name than "Cakes" doesn't run to the edges — and the two panel headings
in Visit us go mb-6 to mb-8.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 22:07:42 -05:00