fix(master): review fixes for the Ledger UI (#18)

- icons/gen writes to the current directory so `go generate
  ./internal/master/web/icons` works (output verified byte-identical)
- share the registry-host check as imageref.IsRegistryHost (with test)
- agents fragment refreshes the "N machines" header count out of band
- ignore the saved machine filter at <=760px where the machine list is hidden
- aria-current on the active machine filter link, aria-pressed on theme toggle
- CLAUDE.md: icons package, SSE ping event, swarm_cluster_id

Claude-Session: https://claude.ai/code/session_01GAZsp3P7Qto6JnhipxWUJQ
This commit is contained in:
2026-10-13 10:25:02 +02:00
parent dd2b90bece
commit cdda174178
11 changed files with 71 additions and 16 deletions
+9 -1
View File
@@ -1,7 +1,7 @@
{{define "content"}}
<div class="hdr ruled">
<h1>Agents</h1>
<span class="sub">{{.Nav.AgentsTotal}} {{if eq .Nav.AgentsTotal 1}}machine{{else}}machines{{end}}{{if .MasterVersion}} · master {{.MasterVersion}}{{end}}</span>
<span class="sub" id="agents-sub">{{template "agents-sub" .}}</span>
<div class="end"><a class="btn pri" href="/agents?add=1">Add agent</a></div>
</div>
<div id="agents" hx-get="/fragments/agents" hx-trigger="sse:agents" hx-swap="innerHTML">
@@ -9,6 +9,14 @@
</div>
{{end}}
{{define "agents-sub"}}{{.Nav.AgentsTotal}} {{if eq .Nav.AgentsTotal 1}}machine{{else}}machines{{end}}{{if .MasterVersion}} · master {{.MasterVersion}}{{end}}{{end}}
{{/* What /fragments/agents returns: the list, and the header count swapped in out of band. */}}
{{define "agents-fragment"}}
{{template "agents" .}}
<span class="sub" id="agents-sub" hx-swap-oob="true">{{template "agents-sub" .}}</span>
{{end}}
{{define "agents"}}
{{range .Agents}}
<div class="agent">