{{define "header"}}
{{/* The wordmark is the way back to the front door (owner decision 2026-08-02): "/" holds no page of its own — it forwards to /madnetwork or /library depending on the node (webui.homeHandler) — so this is the one link that means "wherever this server starts". It carries no .nav-link class, so setActiveNav never marks it: it stands for no single page. */}} {{/* "Library" is a section: it stays active across its subtabs (Music, Playlists, …), which live in the in-page subtab bar (library-subnav). data-section lets the shell router keep it active after a client-side swap (shell.js setActiveNav, which scans all `header .nav-link`). It is PINNED outside .nav-collapse (owner decision 2026-06-22): at every width the logo + Library stay inline on the left, and only the secondary controls fold into the ☰ menu below the narrow breakpoint. */}} Library {{/* Madnetwork (federation F2): the merged catalog of this node's friends. Server-gated on madnetwork.access like the other privileged links, and reconciled client-side by auth.js applyNavPermissions (which scans the whole header, not just .main-nav, precisely because this link sits outside it). PINNED between Library and About (owner decision 2026-08-02): the two libraries a person moves between — this server's and the network's — are the header's primary pair, so the network tab must not be a page down inside the ☰ menu on a phone. It is a SECTION like Library (Network · Nodes · one node's page), so the tab keys on .Section, with data-section so shell.js keeps it active after a client-side swap too. Keying it on .Page left the tab unmarked on a node page. */}} {{if .CanMadnetwork}}Madnetwork{{end}} {{/* About: a mini-menu gathering the project links (GitRepo, the AGPL §13 Source archive, the License) plus a Version entry that opens the About modal. PINNED outside .nav-collapse next to Library (owner decision 2026-06-26): it stays a visible "About ▾" button at every width and never folds into the ☰ menu. The flyout (.about__menu) is an absolute dropdown toggled by about-menu.js (initAboutMenu), loaded on the shell and admin pages alike. */}}
{{/* Narrow-width overflow toggle. Hidden on wide screens (CSS) — there it is a no-box element while .nav-collapse is display:contents, so .main-nav and .header-actions lay out inline in the header row exactly as before. Below the breakpoint this shows (pushed right) and opens .nav-collapse as a dropdown panel. Wired by nav-menu.js (initNavMenu). */}}
{{template "header-insert" .}}
{{/* The collapsible group: every header control EXCEPT the logo and the pinned Library link. Wide screens: display:contents dissolves this wrapper so its children participate directly in the header flex (main-nav's margin-right: auto still pushes header-actions to the far right). Narrow: it becomes the ☰ dropdown panel. */}}
{{/* About modal — opened from the About menu's Version entry (about-menu.js). Lives in the header partial so it ships on every page that has the header, with no per-page include. Version/Commit come from internal/version; an em-dash shows when the value was unknown at build time. */}} {{end}} {{define "auth-modals"}}
{{end}} {{define "header-insert"}}{{end}} {{define "header-actions-extra"}}{{end}} {{/* The listening section's subtab bar (shared .subtabs / .subtab component). Music (the artist/album browse at "/library") and Playlists today; Most played / Recently added / Podcasts can be added as more entries + their routes. Rendered at the top of
on each library subtab page, so the shell swaps it with the page and the server-rendered active state (.Page) stays correct after a client-side navigation. */}} {{define "library-subnav"}} {{end}} {{/* The madnetwork section's subtab bar (docs/ui/madnetwork-nodes.md). Network is the merged catalog — lanes, search, Browse all — and Nodes is the directory of the libraries behind it. Same shared .subtabs component as the library section, for the same reason: the header lists SECTIONS, and a section's pages are reached from inside it. A node's own page keeps Nodes marked. */}} {{define "madnetwork-subnav"}} {{end}} {{/* player-bar: the shared audio player markup driven by player.js. Include it on any page that wants playback, then create the player in JS. Carries its own