console: fleet tag chip — add missing chip-env modifier
Review finding (Important): the tag chip's bare class="chip" has no colour/border/background — layout.html's .chip supplies shape only, every visual treatment lives in a modifier class, and this was the one bare use in the template set (all 12 others already pair one). chip-env is the documented neutral bordered chip (layout.html:177-179) — a fact about the box, not a warning, exactly the tag case. Fix: class="chip" -> class="chip chip-env" in fleetdetail.html, plus the three fleets_test.go assertions that matched the literal chip markup. go build ./..., go vet ./..., go test ./... -count=1 all clean; targeted fleet-page tests re-run and pass.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2 files changed,
+4
−4
internal/console/fleets_test.go+3 −3internal/console/templates/fleetdetail.html+1 −1
diff --git a/internal/console/fleets_test.go b/internal/console/fleets_test.go| index 93b4bf4a2..274fb8214 100644 |
| --- a/internal/console/fleets_test.go |
| +++ b/internal/console/fleets_test.go |
| @@ -982,7 +982,7 @@ func TestFleetPageTagsChipsRender(t *testing.T) { |
| if st != http.StatusOK { |
| t.Fatalf("GET /fleets/acme = %d, want 200:\n%s", st, body) |
| } |
| - for _, want := range []string{`<span class="chip">office</span>`, `<span class="chip">free</span>`} { |
| + for _, want := range []string{`<span class="chip chip-env">office</span>`, `<span class="chip chip-env">free</span>`} { |
| if !strings.Contains(body, want) { |
| t.Fatalf("tagged box missing chip %q in:\n%s", want, body) |
| } |
| @@ -1005,7 +1005,7 @@ func TestFleetPageTagsChipsRender(t *testing.T) { |
| if memberStatus != http.StatusOK { |
| t.Fatalf("member GET /fleets/acme = %d, want 200:\n%s", memberStatus, memberBody) |
| } |
| - for _, want := range []string{`<span class="chip">office</span>`, `<span class="chip">free</span>`} { |
| + for _, want := range []string{`<span class="chip chip-env">office</span>`, `<span class="chip chip-env">free</span>`} { |
| if !strings.Contains(memberBody, want) { |
| t.Fatalf("member view missing chip %q in:\n%s", want, memberBody) |
| } |
| @@ -1053,7 +1053,7 @@ func TestFleetPageTagBoxOwnerUpdatesAndRedirects(t *testing.T) { |
| if !strings.Contains(body, "Tagged acme/pi-1.") { |
| t.Fatalf("no tag flash after redirect:\n%s", body) |
| } |
| - if !strings.Contains(body, `<span class="chip">office</span>`) { |
| + if !strings.Contains(body, `<span class="chip chip-env">office</span>`) { |
| t.Fatalf("new tags did not render as chips after the redirect:\n%s", body) |
| } |
| } |
diff --git a/internal/console/templates/fleetdetail.html b/internal/console/templates/fleetdetail.html| index 613fa78a8..efcae53df 100644 |
| --- a/internal/console/templates/fleetdetail.html |
| +++ b/internal/console/templates/fleetdetail.html |
| @@ -31,7 +31,7 @@ |
| <tr> |
| <td>{{.Label}}</td> |
| <td>{{.Status}}</td> |
| - <td>{{range .Tags}}<span class="chip">{{.}}</span> {{end}}{{if not .Tags}}—{{end}}</td> |
| + <td>{{range .Tags}}<span class="chip chip-env">{{.}}</span> {{end}}{{if not .Tags}}—{{end}}</td> |
| {{if .Reachable}} |
| <td>{{emptyOrDash .Tunnel}}</td> |
| <td>{{if .Metrics}}{{bytesOrDash .Metrics.MemAvailBytes}} / {{bytesOrDash .Metrics.MemTotalBytes}}{{else}}—{{end}}</td> |