diff --git a/internal/web/static/app.css b/internal/web/static/app.css index 484bcd5..7c759cd 100644 --- a/internal/web/static/app.css +++ b/internal/web/static/app.css @@ -199,7 +199,12 @@ input:focus, textarea:focus { outline: none; border-color: var(--accent); box-sh /* Bottom tab bar on phones. */ .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; - display: grid; grid-template-columns: repeat(4, 1fr); + /* One column per link, however many there are. This was repeat(4, 1fr) when + there were four tabs; Team and Admin arriving pushed six items into four + columns, which on a phone is how they stopped fitting. Auto columns mean + the next tab cannot break the row either — and Admin is only rendered for + an administrator, so the count genuinely varies between viewers. */ + display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); @@ -212,8 +217,25 @@ input:focus, textarea:focus { outline: none; border-color: var(--accent); box-sh position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint); font-size: 11px; font-weight: 600; + /* min-width lets a column shrink below its label's natural width, which is + what stops six tabs widening the bar past the screen. */ + min-width: 0; padding: 0 2px; } -.nav-link svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } +.nav-label { + max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; +} +.nav-link svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } + +/* Narrow phones, where six tabs each get about 55-65px. Tightening is enough: + the widest label, "On-call", is about 38px at this size, so nothing has to + be hidden. The ellipsis above is the backstop if a future tab is named + something longer. */ +@media (max-width: 420px) { + .nav-link { font-size: 10px; gap: 1px; } + .nav-link svg { width: 21px; height: 21px; } + .nav-badge { left: calc(50% + 4px); min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; } +} + .nav-link[aria-current="page"] { color: var(--accent); } .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); diff --git a/internal/web/static/index.html b/internal/web/static/index.html index 74640cd..873aaec 100644 --- a/internal/web/static/index.html +++ b/internal/web/static/index.html @@ -77,31 +77,31 @@ terdut - + Queue - + On-call - + Alerts - + Team - - + Account