The "top search bar doesn't work" report had TWO stacked causes, found by reproducing with real keypress-by-keypress typing instead of Playwright's fill() (which fires a single input event and masked both): 1. htmx.min.js was included PER PAGE. The header's live search is htmx-driven on every page, but five pages rendering @Header — series, admin, admin hash-conflicts, admin processing-issues, browse-detail — never loaded it: the input's hx-* attributes were inert (htmx-internal-data absent), so typing produced no request at all. The include now lives in the header partial itself (classic script, before the module bundle); the sixteen per-page copies on @Header pages are removed (double-processing guard). Non-header pages (login/register/setup/reader/index) keep their own. 2. htmx's delay: modifier on a PROGRAMMATICALLY dispatched custom event (htmx.trigger) loses the request entirely under rapid successive triggers — every re-fire canceled the pending timer and the last never issued, so fast typing (the normal kind) never opened the dropdown while one-shot fill() worked. The debounce moved into the Alpine component (client-local state, where it belongs); htmx now executes the bare `search` event immediately. Also made bundle staleness structurally impossible: each bundle's script stamp is a content hash computed at startup (templates/ bundles.go), so a rebuild that changes bundle bytes changes its cache key with no manual ?v=N bump — the manual stamp was how the first dropdown fix stayed invisible for a deploy. The reader bundle (never stamped at all) is covered too. HTML pages additionally send Cache-Control: no-cache (they are dynamic), so a stale page can no longer reference a stale stamp; /api, /static and /uploads keep their native caching, pinned by a middleware test.
49 lines
1.9 KiB
Templ
49 lines
1.9 KiB
Templ
package templates
|
|
|
|
templ Profile(user User) {
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<title>Profile Settings - Bookhoard</title>
|
|
<link href="/static/style.css" rel="stylesheet"/>
|
|
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg"/>
|
|
</head>
|
|
<body class={ "theme-" + user.Theme } x-data="profile">
|
|
@Header(user, "/profile")
|
|
<main class="mx-auto max-w-4xl px-4 sm:px-6 lg:px-8 py-8">
|
|
<div class="mb-8 flex items-center gap-3">
|
|
<span class="grid place-items-center h-10 w-10 rounded-xl shrink-0" style="background-color: var(--accent-muted); color: var(--accent);">
|
|
@Icon("user", "h-5 w-5")
|
|
</span>
|
|
<div>
|
|
<h1 class="text-2xl font-bold tracking-tight" style="color: var(--text-primary)">Profile Settings</h1>
|
|
<p class="text-sm mt-0.5" style="color: var(--text-secondary)">Manage your account information and preferences</p>
|
|
</div>
|
|
</div>
|
|
<div class="space-y-6">
|
|
<div class="card p-6">
|
|
@ProfileForm(user, "/api/auth/profile", true, false, false)
|
|
</div>
|
|
<div class="card p-6">
|
|
<div class="flex items-start gap-3 mb-4">
|
|
<span class="grid place-items-center h-10 w-10 rounded-xl shrink-0" style="background-color: color-mix(in srgb, var(--status-danger) 18%, transparent); color: var(--status-danger);">
|
|
@Icon("alert", "h-5 w-5")
|
|
</span>
|
|
<div>
|
|
<h3 class="text-lg font-semibold" style="color: var(--text-primary)">Danger Zone</h3>
|
|
<p class="text-sm mt-0.5" style="color: var(--text-secondary)">Once you delete your account, there is no going back. Please be certain.</p>
|
|
</div>
|
|
</div>
|
|
<button @click="confirmDeleteAccount()" class="btn btn-danger">
|
|
@Icon("trash", "h-4 w-4")
|
|
Remove My Account
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
}
|