Research: how far htmx and the existing filter.js carry a filterable Series list #123
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Part of #114
Question
Can the Series list's filtering, sorting, and paging be built with what the frontend already
has, or does it need something new?
In tree:
backend/internal/web/static/htmx.min.jsandstatic/filter.js, plus the existinghtmx patterns in
templates/—hx-get/hx-trigger every 30s/hx-swap outerHTMLfor the Lanesfragment, and
hx-postwithhx-target="#readers"for roster actions.Report:
static/filter.jsactually does today and whether it is client-side over a rendered listor driven by the server.
per-row action that re-renders one row rather than the whole list) htmx covers idiomatically,
and which it does not.
swaps do not change the address bar without
hx-push-url.first and a new module needs a stated reason.
Facts and file citations only; the decisions belong to the tickets that consume this.
Research done on branch
research/htmx-series-list— note:docs/research/htmx-filterable-admin-series-list.md.Findings: vendored htmx is 2.0.4 (only version string in the file). filter.js is a pure client-side title filter over the already-rendered list (filter.js:1-2) — it issues no requests and never touches the URL; it depends on #search + .card[data-title] + #list and re-applies on htmx:afterSwap.
All six needs are covered by the vendored 2.0.4, verified in the file itself, no new dependency:
Only caveat: filter.js is loaded on the library page only, not on /admin (admin.html:16); and client-side filter state is not URL-addressable without hand-written pushState JS. No PR opened, main untouched.
Resolved. Findings in
docs/research/htmx-filterable-admin-series-list.md, committed as00ddbcaon the throwaway branchresearch/htmx-series-list(not pushed, no PR,mainuntouched).Answer: nothing new is needed. The vendored htmx is 2.0.4, and every primitive a filterable Series list wants is present in that build and already used somewhere in tree.
hx-getplushx-push-url/hx-replace-url— a swap alone never touches the address bar, and the docs require a pushed URL to render a full page, which this repo's handlers do. The tab links already prove the pattern (templates/app.html:55-56).hx-trigger="keyup changed delay:500ms", server-driven.hx-get+hx-swap="beforeend"(orrevealed); numbered pages are the tab pattern plushx-push-url. Same primitives, different swap and URL semantics — so this is an IA decision, not a capability limit.hx-target+hx-swap="outerHTML", orhx-swap-oob— both already incard.html/chrome.html.hx-trigger="every 30s"scoped to its own fragment, aslanes.html:11does.hx-confirm(zero JS) or the existing inline confirm row.Two caveats the consuming tickets must absorb:
static/filter.jsis a pure client-side title filter over an already-rendered list (contract:#search+.card[data-title]+#list, re-applied onhtmx:afterSwap) — it issues no requests and changes no URL. It is also not loaded on/admin(admin.html:16). So it is not reusable for the Series view as-is: client-side filter state cannot be bookmarkable without hand-writtenpushState, which is exactly what the IA ticket asked for. Server-side filtering withhx-push-urlis the path that satisfies both.No dependency implied.
Correction to the resolution comment above: the branch is pushed, not local-only.
research/htmx-series-listis onoriginat00ddbca— https://gitea.violetcrown.my.id/sulthan/mangaBookmark/src/branch/research/htmx-series-list/docs/research/htmx-filterable-admin-series-list.md. It is still deliberately not merged tomainand has no PR: charting should not land build artifacts, and the ticket comment carries the finding. Delete the branch once #115/#116/#118 have consumed it.