From 2a440b9c5eb5b70ffa5c47c4974cd769cc4e51c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Untersch=C3=BCtz?= Date: Thu, 26 Nov 2026 08:00:38 +0100 Subject: [PATCH 1/3] perf(console): keep the status page editor light with many monitors The editor rendered a group select and label field for every monitor of the organization, about 2 MB of HTML for 3000 monitors. Only monitors on the page carry their fields now; others get them from a template when ticked. A filter field narrows long lists, and "Add all" ticks only the monitors it leaves visible. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3 --- internal/api/dashboard_filter_test.go | 12 +- internal/i18n/locales/de.json | 1 + internal/i18n/locales/en.json | 1 + internal/web/assets/app.js | 28 +- internal/web/statuspages.templ | 41 +- internal/web/statuspages_templ.go | 726 ++++++++++++++------------ 6 files changed, 473 insertions(+), 336 deletions(-) diff --git a/internal/api/dashboard_filter_test.go b/internal/api/dashboard_filter_test.go index 5202c51..92b77cd 100644 --- a/internal/api/dashboard_filter_test.go +++ b/internal/api/dashboard_filter_test.go @@ -74,7 +74,8 @@ func TestPageEditorOffersAddAndRemoveAll(t *testing.T) { _, region := e.platformChecker(t, uniq("eu-")) owner := e.browser(t) owner.signup("o@"+uniq("pa")+".test", uniq("pa-")) - owner.do("POST", "/api/v1/org/monitors", map[string]any{"name": "Shop", "type": "http", "target": "https://shop.test", "interval_seconds": 60, "regions": []string{region}}) + _, mon := owner.do("POST", "/api/v1/org/monitors", map[string]any{"name": "Shop", "type": "http", "target": "https://shop.test", "interval_seconds": 60, "regions": []string{region}}) + shop := mon["id"].(string) _, p := owner.do("POST", "/api/v1/org/statuspages", map[string]any{"slug": uniq("pa-"), "title": "Status"}) _, _, html := owner.page("/statuspages/" + p["id"].(string)) for _, want := range []string{`data-check-all="on"`, `data-check-all="off"`, "Add all", "Remove all"} { @@ -82,6 +83,15 @@ func TestPageEditorOffersAddAndRemoveAll(t *testing.T) { t.Errorf("the page editor lacks %q", want) } } + // Monitors not on the page get their fields from the template only + // when ticked, so thousands of them stay light. + if n := strings.Count(html, `data-field="label"`); n != 1 || !strings.Contains(html, "