feat(header): S7 — container-query fix for the narrow Plex header

The floating header's search box collapsed to ~0 width when the filter sidebar
was open on a narrow window (~768px): the content column shrinks with the
SIDEBAR, not the viewport, so Tailwind viewport breakpoints can't see it, and
SearchBar's `flex-1 min-w-0` shrank rather than wrapped.

Fix with Tailwind v4 container queries (no plugin):
- App.tsx: mark the content column `@container/appmain` (container-type:
  inline-size) — the width that actually shrinks when the sidebar opens.
- SearchBar: once the column has room (≥420px) enforce a `min-w-[15rem]` floor
  so the box WRAPS to its own line via the header's flex-wrap instead of
  collapsing the input; on a narrow column (≤640px) it takes a full line of its
  own (basis-full) and sorts last, so the small pills (module name + Plex scope
  toggle / feed sync chip) share the line above it — a tidy two-row header.

Verified live at 375 / 768 / 1024 / 1280 on Plex (search usable, scope toggle
reachable at every width) and on Feed (shared SearchBar, no regression). Desktop
stays a single row. tsc / knip / lint clean.
This commit is contained in:
2026-08-17 21:06:33 +02:00
parent 9fb4db2546
commit 14913a6447
2 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -351,7 +351,10 @@ export default function App() {
/>
</Suspense>
)}
<div className="relative flex-1 min-w-0 flex flex-col">
{/* `@container/appmain`: the floating header + its search box adapt to THIS column's width
(which shrinks when the filter sidebar is open), not the viewport — a viewport breakpoint
can't see the sidebar-driven narrowing (E5 S7). */}
<div className="@container/appmain relative flex-1 min-w-0 flex flex-col">
{channelView ? (
<PageShell scrollKey={`channel:${channelView.id}`}>
<Suspense fallback={pageFallback}>
+6 -1
View File
@@ -56,7 +56,12 @@ export default function SearchBar({
if (onGo && !goDisabled) onGo();
};
return (
<div className="pointer-events-auto relative flex-1 min-w-0 max-w-xl">
// `min-w-0` by default so it never forces overflow on a truly tiny column; once the content
// column (@container/appmain) has room (≥420px) enforce a usable floor so the box WRAPS to its
// own line via the header's flex-wrap instead of shrinking the input to ~0. On a narrow column
// (≤640px) it also takes a full line of its own (basis-full) and sorts LAST, so the small pills
// (module name + Plex scope toggle) share the line above it — a tidy two-row header (E5 S7).
<div className="pointer-events-auto relative flex-1 min-w-0 max-w-xl @min-[420px]/appmain:min-w-[15rem] @max-[640px]/appmain:order-last @max-[640px]/appmain:basis-full">
<div className="h-11 pl-3 pr-2 rounded-2xl glass-menu flex items-center gap-2 focus-within:outline-2 focus-within:outline-accent/60 focus-within:outline-offset-2">
{leading ?? <Search className="w-4 h-4 shrink-0 text-muted" />}
<input