htmx: shelve toggle, library search, header sign-in #14

Merged
arne merged 15 commits from htmx-shelve-search into main 2026-04-13 15:42:01 +02:00
Owner

Summary

  • Spec: docs/superpowers/specs/2026-04-13-htmx-shelve-search-design.md
  • Vendors htmx 4 as a static asset; loads it from base.html.
  • Library search: debounced, fragment-swap on input via htmx.
  • Shelve toggle on book detail page: htmx-driven partial swap.
  • Shelf page rows: htmx delete swap removes the row inline.
  • Header: visible sign-in / sign-out link for visitors and users.

Test plan

  • go test ./... green
  • Manual: type into the library search box; grid updates without reload, URL updates.
  • Manual: shelve / unshelve from book detail page; toggle button updates inline.
  • Manual: remove a book from the shelf page; row vanishes inline.
  • Manual: log out; verify "sign in" link appears in header.
## Summary - Spec: `docs/superpowers/specs/2026-04-13-htmx-shelve-search-design.md` - Vendors htmx 4 as a static asset; loads it from `base.html`. - Library search: debounced, fragment-swap on input via htmx. - Shelve toggle on book detail page: htmx-driven partial swap. - Shelf page rows: htmx `delete` swap removes the row inline. - Header: visible sign-in / sign-out link for visitors and users. ## Test plan - [ ] `go test ./...` green - [ ] Manual: type into the library search box; grid updates without reload, URL updates. - [ ] Manual: shelve / unshelve from book detail page; toggle button updates inline. - [ ] Manual: remove a book from the shelf page; row vanishes inline. - [ ] Manual: log out; verify "sign in" link appears in header.
arne added 14 commits 2026-04-13 15:20:21 +02:00
Third spec in the auth/admin/htmx roadmap. Narrow first slice of the
htmx migration: shelve toggle on book + shelf pages, debounced library
search, and a visible sign-in/out affordance for visitors and users.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
htmx 4 ships hx-swap="delete" which removes the target on a successful
response and ignores the body — replaces the hand-rolled
hx-on::after-request hook. Detail page and shelf row now have distinct
inline forms; only the detail-page form needs to be a partial since
the server renders it as a fragment on HX requests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Task-by-task TDD plan for the htmx shelve toggle, library search, and
header sign-in. Notes one spec assumption that didn't match reality:
the renderer needs a new RenderPartial method for fragment responses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Wrap _books_grid.html in <div id="books-grid"> so outerHTML swap
  replaces the count line too, instead of stacking it.
- Move sign-out from header to bottom of /shelf; not important enough
  for top-of-page.
- Header link order: shelf, library, errata (owner) — shelf first.
- Sign-in joins the right-anchored slot alongside upload (visitor only).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
arne merged commit 384881d6df into main 2026-04-13 15:42:01 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
arne/books!14
No description provided.