diff --git a/changelog.d/fixed-13135-header-overlap.md b/changelog.d/fixed-13135-header-overlap.md new file mode 100644 index 0000000000..1d06f6f3e6 --- /dev/null +++ b/changelog.d/fixed-13135-header-overlap.md @@ -0,0 +1 @@ +- The dashboard header's feedback, theme and other right-hand buttons no longer overlap the project title or ACMM badge at window widths between 769px and 900px; those widths now show icon-only Settings, Health and Guide chips ([#13135](https://github.com/hivecommons/hive/issues/13135)). diff --git a/src/pkg/dashboard/navbar_header_overlap_13135_test.go b/src/pkg/dashboard/navbar_header_overlap_13135_test.go new file mode 100644 index 0000000000..a949f58df6 --- /dev/null +++ b/src/pkg/dashboard/navbar_header_overlap_13135_test.go @@ -0,0 +1,26 @@ +package dashboard + +import ( + "strings" + "testing" +) + +// TestNavbarRightClusterCannotSpillOverTitle guards #13135: between the +// phone block (≤768px) and 1400px the right chip cluster must keep its +// max-content width, otherwise its flex-end overflow paints the feedback and +// theme buttons over the ACMM badge or project title. +func TestNavbarRightClusterCannotSpillOverTitle(t *testing.T) { + html := indexHTML(t) + for _, want := range []string{ + "@media (min-width: 769px) and (max-width: 1400px) {\n .oc-topbar-right { min-width: max-content; }", + "@media (min-width: 769px) and (max-width: 900px) {\n #acmm-badge { display: none; }", + "#welcome-topbar-btn .nav-chip__label { display: none; }\n }", + } { + if !strings.Contains(html, want) { + t.Fatalf("navbar #13135 overlap guard missing %q", want) + } + } + if strings.Contains(html, "@media (min-width: 901px) and (max-width: 1400px) {\n .oc-topbar-right") { + t.Fatal("right cluster min-width guard must also cover 769-900px, where the dashboard was still overlapping") + } +} diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 80f8c20a32..dee1a4c419 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -557,13 +557,17 @@ .oc-topbar-right .widget-dl { margin-left: var(--sp-0); margin-right: var(--sp-0); } } - /* Right chip cluster keeps its full width so it cannot shrink and spill over the left ACMM badge (#13135); the left/center tracks absorb the squeeze. */ - @media (min-width: 901px) and (max-width: 1400px) { + /* Right chip cluster keeps its full width so it cannot shrink and spill over the left ACMM badge or project title (#13135); the left/center tracks absorb the squeeze. Starts at 769px because the ≤768px block clips the cluster instead. */ + @media (min-width: 769px) and (max-width: 1400px) { .oc-topbar-right { min-width: max-content; } } + /* Icon-only chips here so the full-width right cluster still leaves room for the drawer toggle and title (#13135). */ @media (min-width: 769px) and (max-width: 900px) { #acmm-badge { display: none; } + .oc-health-badge .nav-chip__label, + #oc-settings-btn .nav-chip__label, + #welcome-topbar-btn .nav-chip__label { display: none; } } /* Light main content area */