Action key under the tabs, plus the brand mark (#12)

The card action strip is icon-only, so nothing on screen said what the six
glyphs do. This adds a permanent key line under the tabs naming each one.

The key is tab-shaped, not row-shaped: archived and finished swap Archive
for Restore, and finished drops Done — the same conditions card.html already
uses for the buttons. It rides along in writeChromeOOB, otherwise an htmx
tab switch would leave the previous bucket's key behind.

Also from the Claude Design pass:

• per-action accent on hover/press — slate archive, moss finished, clay
chapter — so a press says which lane it belongs to; ember stays reserved for
new-chapter heat
• cover 74→80px desktop / 86→93px phone, title 19→21px, meta 10→11px
• favourite mark pinned to the right edge of the measure instead of trailing
the title, which drifted whenever a new-chapter title shrink-wrapped
• recent strip sizes now derive from --cover-w instead of repeating magic
numbers

### Brand mark

The design project grew a logo, so it lands in three places with three
different colour sources:

• `backend/static/logo.svg` — fixed palette, because a favicon has no page to
inherit from. Linked as `rel="icon"` from both the app and the login page.
• `{{define "mark"}}` in chrome.html — takes `--ink`/`--ember`/currentColor, so
the header mark flips with the light/dark theme. Used by app.html and
login.html.
• the userscript panel header — same drawing inside the shadow root, next to
the tokens it uses.

`.brand` becomes a flex row in both stylesheets and the topbar aligns centre
rather than baseline. The 5px stroke on the 200-unit grid thins out at brand
size, so it is nudged to 6.5 instead of scaled blindly. No mark on the edge
tab: a 7px sliver has nowhere to put one.

go test ./... passes (static-asset test now covers logo.svg), node --test on
the userscript logic suite passes 14/14. Verified live at 412px and desktop:
key renders, per-tab variant correct on /?tab=finished (play/star/pencil/undo/
trash, no Done), and the OOB swap fires on /ui/list.

Reviewed-on: #12
Co-authored-by: Sulthan Zaki <sultankiki05@gmail.com>
Co-committed-by: Sulthan Zaki <sultankiki05@gmail.com>
This commit was merged in pull request #12.
This commit is contained in:
2026-07-31 17:14:15 +07:00
committed by sulthan
parent f3b55fd883
commit 3c935ba7c3
8 changed files with 207 additions and 32 deletions
+4 -1
View File
@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="color-scheme" content="dark light">
<title>mangaBookmark</title>
<link rel="icon" href="/static/logo.svg" type="image/svg+xml">
<link rel="stylesheet" href="/static/style.css">
<link rel="preload" href="/static/fonts/instrument-serif-400-latin.woff2" as="font" type="font/woff2" crossorigin>
{{/* Body text before meta lines: DM Sans is the biggest face and the one
@@ -18,7 +19,7 @@
{{template "icons" .}}
<div class="sheet">
<header class="topbar">
<h1 class="brand">manga<em>Bookmark</em></h1>
<h1 class="brand">{{template "mark" .}}<span>manga<em>Bookmark</em></span></h1>
<form method="post" action="/logout">
<button type="submit" class="ghost">Log out</button>
</form>
@@ -61,6 +62,8 @@
</nav>
</div>
{{template "keyrow" .}}
{{template "recent" .}}
<main id="list" class="list">
+53 -5
View File
@@ -1,9 +1,9 @@
{{/* The two regions that live outside the swapped #list: the "Continue
reading" strip and the Updated badge. Both are rendered inline by app.html
and again, out of band, on every /ui/ response — a mutation must not leave
them describing the library as it was before the tap.
{{/* The regions that live outside the swapped #list: the "Continue reading"
strip, the Updated badge and the action key. All are rendered inline by
app.html and again, out of band, on every /ui/ response — a mutation must
not leave them describing the library as it was before the tap.
Both always render, hidden when they have nothing to say, so an out-of-band
All always render, hidden when they have nothing to say, so an out-of-band
swap always has an element with the right id to replace. */}}
{{define "recent"}}
@@ -27,4 +27,52 @@
</section>
{{end}}
{{/* The action key. The icon strip on a card is unlabelled, so one permanent
line under the tabs names every glyph. It follows the tab rather than the
row: the archived and finished buckets swap Archive for Restore, and a
finished series has no Done to offer. */}}
{{define "keyrow"}}
<div class="keyrow" id="keyrow" aria-label="Action key"{{if .OOB}} hx-swap-oob="true"{{end}}>
<span class="pair"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-play"/></svg><span>Read</span></span>
<span class="pair brass"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-star"/></svg><span>Fav</span></span>
<span class="pair"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-pencil"/></svg><span>Chapter</span></span>
{{if or (eq .Tab "archived") (eq .Tab "finished")}}
<span class="pair"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-undo"/></svg><span>Restore</span></span>
{{else}}
<span class="pair"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-box"/></svg><span>Archive</span></span>
{{end}}
{{if ne .Tab "finished"}}
<span class="pair"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-check"/></svg><span>Done</span></span>
{{end}}
<span class="pair trash"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-trash"/></svg><span>Delete</span></span>
</div>
{{end}}
{{/* The brand mark, inline so it takes the page's ink and ember rather than the
fixed palette of /static/logo.svg (which the favicon needs). */}}
{{define "mark"}}
<svg class="mark" viewBox="0 0 200 172" aria-hidden="true">
<g fill="var(--ink)" stroke="currentColor" stroke-width="5" stroke-linejoin="round" stroke-linecap="round">
<path fill="none" d="M28 36H4v114h192V36h-24"></path>
<path fill="none" d="M28 23H17v127h166V23h-11"></path>
<g id="mb-half">
<path d="M28 7 88 55v97L28 138z"></path>
<g fill="currentColor" stroke="none">
<path d="M37 25 55 39v41L37 66z"></path>
<path d="M60 42 79 57v42L60 84z"></path>
<path d="M37 75 79 108v13L37 88z"></path>
<path d="M37 98 79 129v11L37 131z"></path>
</g>
</g>
<use href="#mb-half" transform="matrix(-1 0 0 1 200 0)"></use>
<g stroke="var(--ember)">
<path d="M100 4l9 5v11l-9 5-9-5V9z"></path>
<path d="M94 24h12v24H94z"></path>
<path d="M70 47h60v14H70z"></path>
<path d="M91 61h18v87l-9 20-9-20z"></path>
</g>
</g>
</svg>
{{end}}
{{define "newcount"}}<span class="count" id="new-count"{{if .OOB}} hx-swap-oob="true"{{end}}{{if not .NewCount}} hidden{{end}}>{{.NewCount}}</span>{{end}}
+2 -1
View File
@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="color-scheme" content="dark light">
<title>mangaBookmark</title>
<link rel="icon" href="/static/logo.svg" type="image/svg+xml">
<link rel="stylesheet" href="/static/style.css">
<link rel="preload" href="/static/fonts/instrument-serif-400-latin.woff2" as="font" type="font/woff2" crossorigin>
</head>
@@ -13,7 +14,7 @@
<main class="login-card">
<div>
<span class="eyebrow">Private library</span>
<h1>manga<em>Bookmark</em></h1>
<h1 class="brand">{{template "mark" .}}<span>manga<em>Bookmark</em></span></h1>
</div>
<form method="post" action="/login">
<div>