From 1567367481985483f5629ebbd105732c2b35e62c Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Mon, 5 Oct 2026 12:45:40 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20dashboard:=20surface=20alert?= =?UTF-8?q?s=20at=20top?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andy Anderson --- .../fixed-dashboard-alerts-section-top.md | 1 + .../dashboard_alerts_placement_test.go | 28 +++++++++++++++++++ src/pkg/dashboard/static/index.html | 9 +++--- .../dashboard/webstatic/style_ratchet_test.go | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 src/changelog.d/fixed-dashboard-alerts-section-top.md create mode 100644 src/pkg/dashboard/dashboard_alerts_placement_test.go diff --git a/src/changelog.d/fixed-dashboard-alerts-section-top.md b/src/changelog.d/fixed-dashboard-alerts-section-top.md new file mode 100644 index 0000000000..29d4b16bf4 --- /dev/null +++ b/src/changelog.d/fixed-dashboard-alerts-section-top.md @@ -0,0 +1 @@ +- Surface dashboard GitHub auth and rate-limit alerts in the pinned top notices area instead of below all dashboard sections. diff --git a/src/pkg/dashboard/dashboard_alerts_placement_test.go b/src/pkg/dashboard/dashboard_alerts_placement_test.go new file mode 100644 index 0000000000..4d428fa78c --- /dev/null +++ b/src/pkg/dashboard/dashboard_alerts_placement_test.go @@ -0,0 +1,28 @@ +package dashboard + +import ( + "strings" + "testing" +) + +func TestDashboardRateLimitAlertRendersBeforeFirstContentSection(t *testing.T) { + html := indexHTML(t) + + notices := strings.Index(html, `id="dash-notices"`) + rateAlert := strings.Index(html, `id="gh-rate-alert"`) + authAlert := strings.Index(html, `id="gh-auth-alert"`) + firstSection := strings.Index(html, `id="overview-section"`) + if notices < 0 || rateAlert < 0 || authAlert < 0 || firstSection < 0 { + t.Fatalf("markup missing: dash-notices=%d gh-rate-alert=%d gh-auth-alert=%d overview-section=%d", notices, rateAlert, authAlert, firstSection) + } + noticesEnd := notices + strings.Index(html[notices:], `
`) + if noticesEnd < notices { + t.Fatalf("dash-notices end marker missing after offset %d", notices) + } + if rateAlert < notices || authAlert < notices || rateAlert > noticesEnd || authAlert > noticesEnd { + t.Fatalf("GitHub alert markup must stay inside the pinned top notices area: dash-notices=%d gh-auth-alert=%d gh-rate-alert=%d", notices, authAlert, rateAlert) + } + if rateAlert > firstSection || authAlert > firstSection { + t.Fatalf("GitHub alerts must render before the first content section: gh-auth-alert=%d gh-rate-alert=%d overview-section=%d", authAlert, rateAlert, firstSection) + } +} diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 7040b3d876..cce05998d4 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -502,7 +502,7 @@ body.light-mode { box-sizing: border-box; } - body.light-mode > .gh-rate-alert { margin-left: var(--sp-0); } + body.light-mode .gh-rate-alert { margin-left: var(--sp-0); } /* Light mode keeps the shared responsive agent grid; beads still wrap. */ body.light-mode .beads { flex-wrap: wrap; } @@ -2345,7 +2345,7 @@ .gh-auth-alert a { color: var(--blue); text-decoration: underline; } .gh-rate-alert { background: color-mix(in srgb, var(--yellow) 14%, var(--panel)); border: 1px solid var(--yellow); - border-radius: 8px; padding: 10px 16px; margin-bottom: var(--sp-6); + border-radius: 8px; padding: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-6); display: none; /* hidden by default, shown via JS */ } .gh-rate-alert.active { display: block; } @@ -4095,6 +4095,8 @@
Required Permissions (Organization)
+
GitHub API authentication failed. Check GitHub App key or token configuration.
+
@@ -4188,9 +4190,6 @@

🐝 Getting StartedGitHub API authentication failed. Check GitHub App key or token configuration. -
-