From b6c58b13c62cbbeef301cf285cf4e63c889593f9 Mon Sep 17 00:00:00 2001 From: moltenhub-bot Date: Fri, 10 Apr 2026 15:40:00 -0700 Subject: [PATCH] logo --- internal/hubui/server_test.go | 41 ++++++++++++++++++++++++++++++ internal/hubui/static/index.html | 3 +++ internal/hubui/static/logos/pi.svg | 6 +++++ 3 files changed, 50 insertions(+) create mode 100644 internal/hubui/static/logos/pi.svg diff --git a/internal/hubui/server_test.go b/internal/hubui/server_test.go index 0fa1117d..8ba4f063 100644 --- a/internal/hubui/server_test.go +++ b/internal/hubui/server_test.go @@ -1267,6 +1267,28 @@ func TestHandlerIndexInjectsConfiguredHarness(t *testing.T) { } } +func TestHandlerIndexInjectsPiHarness(t *testing.T) { + t.Parallel() + + srv := NewServer("", NewBroker()) + srv.ConfiguredHarness = "pi" + req := httptest.NewRequest(http.MethodGet, "/", nil) + resp := httptest.NewRecorder() + srv.Handler().ServeHTTP(resp, req) + + if resp.Code != http.StatusOK { + t.Fatalf("status = %d", resp.Code) + } + + markup := resp.Body.String() + if !strings.Contains(markup, `window.__HUB_UI_CONFIG__ = {"automaticMode":false,"configuredHarness":"pi","configuredAgentLabel":"Pi","defaultRepository":"`+config.DefaultRepositoryURL+`"};`) { + t.Fatalf("expected pi harness UI config, got %q", markup) + } + if !strings.Contains(markup, `pi: "/static/logos/pi.svg"`) { + t.Fatalf("expected index html to include pi logo mapping") + } +} + func TestHandlerIndexIncludesClaudeBrowserCodeFlow(t *testing.T) { t.Parallel() @@ -1642,6 +1664,25 @@ func TestHandlerServesStaticLogoAsset(t *testing.T) { } } +func TestHandlerServesStaticPiLogoAsset(t *testing.T) { + t.Parallel() + + srv := NewServer("", NewBroker()) + req := httptest.NewRequest(http.MethodGet, "/static/logos/pi.svg", nil) + resp := httptest.NewRecorder() + srv.Handler().ServeHTTP(resp, req) + + if resp.Code != http.StatusOK { + t.Fatalf("status = %d", resp.Code) + } + if ct := resp.Header().Get("Content-Type"); !strings.Contains(ct, "image/svg+xml") { + t.Fatalf("content-type = %q", ct) + } + if body := resp.Body.String(); !strings.Contains(body, " + + + + + \ No newline at end of file