@@ -60,21 +60,53 @@ export const SidebarChromeHeader = memo(function SidebarChromeHeader({
variant={backdropVariant ? "media-navigation" : "ghost"}
className="relative top-auto z-10 translate-y-0 md:hidden"
/>
-
- {pillLabel ? (
-
- {pillLabel}
-
- ) : null}
+ {/* One visible line: the pill wraps onto the clipped second line once it no longer fits.
+ The padding keeps the brand's focus ring inside the clip. */}
+
+
+ {pillLabel ? (
+
+
+ {pillLabel}
+
+
+ ) : null}
+
);
});
+// Measures the brand at its titlebar inset, plus the header's right padding and the
+// sidebar border, so the sidebar minimum follows font size, zoom and macOS window controls.
+export function SidebarBrandWidthProbe({
+ onWidthChange,
+}: {
+ onWidthChange: (width: number) => void;
+}) {
+ const observeWidth = useCallback(
+ (probe: HTMLDivElement) => {
+ const observer = new ResizeObserver(([entry]) => {
+ if (entry) onWidthChange(entry.borderBoxSize[0]?.inlineSize ?? probe.offsetWidth);
+ });
+ observer.observe(probe);
+ return () => observer.disconnect();
+ },
+ [onWidthChange],
+ );
+
+ return (
+