diff --git a/TODO.md b/TODO.md index 26506dd..196aba3 100644 --- a/TODO.md +++ b/TODO.md @@ -20,6 +20,10 @@ regress. # Completed Steps +- 2026-10-02: In a window too narrow for the top bar, such as 390 px, the New + App and Logout buttons move to a second row instead of running into "by + @sneak"; the bar keeps a gap between its two sides at every width (#272). + - 2026-10-02: App names may contain dots, such as `sneak.berlin`: lowercase letters and numbers joined by single dots or by hyphens, 2 to 63 characters. Docker accepts every such name in the image name `upaas-`; a dot needs a diff --git a/internal/handlers/dashboard_layout_test.go b/internal/handlers/dashboard_layout_test.go index 2ab09da..1d572b8 100644 --- a/internal/handlers/dashboard_layout_test.go +++ b/internal/handlers/dashboard_layout_test.go @@ -52,3 +52,26 @@ func TestDashboardTableFitsCard(t *testing.T) { assert.Contains(t, cellTag, "whitespace-normal") assert.Contains(t, cellTag, "break-all") } + +// TestTopBarWrapsWhenNarrow checks that the top bar keeps a gap between the +// µPaaS title and the New App and Logout buttons, and puts the buttons on a +// second row in a window too narrow for one, instead of letting them meet. +func TestTopBarWrapsWhenNarrow(t *testing.T) { + t.Parallel() + + testCtx := setupTestHandlers(t) + + request := httptest.NewRequestWithContext(t.Context(), http.MethodGet, "/", nil) + recorder := httptest.NewRecorder() + + testCtx.handlers.HandleDashboard().ServeHTTP(recorder, request) + + require.Equal(t, http.StatusOK, recorder.Code) + + _, afterNav, found := strings.Cut(recorder.Body.String(), `