diff --git a/changelog.d/fixed-16690.md b/changelog.d/fixed-16690.md new file mode 100644 index 0000000000..7e939e0d01 --- /dev/null +++ b/changelog.d/fixed-16690.md @@ -0,0 +1 @@ +- The drawer toggle's visible "Navigation" label no longer hides at phone widths (≤600px). The drawer toggle inherited the `.nav-chip--action` class intended for other action chips, which were configured to hide their labels on narrow screens; the fix exempts `#oc-drawer-toggle` from that rule ([#16690](https://github.com/hivecommons/hive/issues/16690)). diff --git a/src/pkg/dashboard/navbar_chip_consistency_test.go b/src/pkg/dashboard/navbar_chip_consistency_test.go index d284a08431..97c388f611 100644 --- a/src/pkg/dashboard/navbar_chip_consistency_test.go +++ b/src/pkg/dashboard/navbar_chip_consistency_test.go @@ -1,6 +1,7 @@ package dashboard import ( + "os" "regexp" "strings" "testing" @@ -204,3 +205,17 @@ func TestNavbarRemovedChipSpecificMetricOverrides(t *testing.T) { } } } + +func TestDrawerToggleLabelVisibleAtPhoneWidths(t *testing.T) { + css, err := os.ReadFile("static-src/css/agent-detail.css") + if err != nil { + t.Fatalf("reading agent-detail.css: %v", err) + } + cssStr := string(css) + + // The rule that hides labels for .nav-chip--action must exempt #oc-drawer-toggle + // at phone widths (max-width: 600px) so the Navigation label remains visible. + if !strings.Contains(cssStr, `.oc-topbar .nav-chip--action:not(#oc-drawer-toggle) .nav-chip__label`) { + t.Error("agent-detail.css is missing :not(#oc-drawer-toggle) exemption; drawer toggle label would be hidden at phone widths") + } +} diff --git a/src/pkg/dashboard/static-src/css/agent-detail.css b/src/pkg/dashboard/static-src/css/agent-detail.css index e06e8b40e9..ea2a7cb208 100644 --- a/src/pkg/dashboard/static-src/css/agent-detail.css +++ b/src/pkg/dashboard/static-src/css/agent-detail.css @@ -330,7 +330,7 @@ .oc-topbar-right { grid-column: auto; flex-wrap: wrap; } .widget-dl { display: none; } #oc-project-name { display: none; } - .oc-topbar .nav-chip--action .nav-chip__label, + .oc-topbar .nav-chip--action:not(#oc-drawer-toggle) .nav-chip__label, .oc-topbar .nav-chip--primary .nav-chip__label { display: none; } /* keep the pill one line so the right group wraps as a unit instead of being clipped at the viewport edge */ diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 7a179d8f2b..c6ae7c93c2 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -929,7 +929,7 @@ .oc-topbar-right { grid-column: auto; flex-wrap: wrap; } .widget-dl { display: none; } #oc-project-name { display: none; } - .oc-topbar .nav-chip--action .nav-chip__label, + .oc-topbar .nav-chip--action:not(#oc-drawer-toggle) .nav-chip__label, .oc-topbar .nav-chip--primary .nav-chip__label { display: none; } /* keep the pill one line so the right group wraps as a unit instead of being clipped at the viewport edge */