Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-10640.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- dashboard: surface alerts section at top of page (#10640)
1 change: 1 addition & 0 deletions src/changelog.d/fixed-dashboard-alerts-section-top.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Surface dashboard GitHub auth and rate-limit alerts in the pinned top notices area instead of below all dashboard sections.
28 changes: 28 additions & 0 deletions src/pkg/dashboard/dashboard_alerts_placement_test.go
Original file line number Diff line number Diff line change
@@ -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:], `<div id="toast-container"></div>`)
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)
}
}
9 changes: 4 additions & 5 deletions src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -4095,6 +4095,8 @@ <h5>Required Permissions (Organization)</h5>
</div>
<div id="hub-banner" style="display:none"></div>
<div id="system-alerts-banner" style="display:none"></div>
<div class="gh-auth-alert" id="gh-auth-alert">GitHub API authentication failed. Check GitHub App key or token configuration.</div>
<div class="gh-rate-alert" id="gh-rate-alert"></div>
</div>
<div id="toast-container"></div>
<!-- Hive Chat FAB + Panel -->
Expand Down Expand Up @@ -4188,9 +4190,6 @@ <h2 class="config-title">馃悵 Getting Started<span id="welcome-progress" class="
</div>
</div>
</div>
<div class="gh-auth-alert" id="gh-auth-alert">GitHub API authentication failed. Check GitHub App key or token configuration.</div>
<div class="gh-rate-alert" id="gh-rate-alert"></div>

<!-- Light sidebar (hidden by default) -->
<div class="oc-sidebar-resize" id="ocSidebarResize"></div>
<nav id="oc-sidebar" class="oc-sidebar">
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/webstatic/style_ratchet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var styleRatchetBaselines = map[string]styleRatchetCounts{
inlineStyles: 1588,
rawColors: 143,
rawFontSizes: 666,
rawPadding: 229,
rawPadding: 227,
rawBorderRadii: 176},
"contributor landing": {
inlineStyles: 95,
Expand Down
Loading