feat(ui): offer Lighthouse AI help in the add-provider wizard (#13178)

This commit is contained in:
Alejandro Bailo authored and GitHub committed 2026-10-27 16:55:26 +01:00
1 parent d7bffba4ac
commit 4eb468619f
50 files changed
+2214 -170

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
"use client";
import { usePathname } from "next/navigation";
import { useMediaQuery } from "@/hooks/use-media-query";
import { useStore } from "@/hooks/use-store";
import { isLighthouseChatRoute } from "@/lib/lighthouse-routes";
import {
clampSidePanelWidth,
SIDE_PANEL_PUSH_MEDIA_QUERY,
} from "@/lib/ui-layout";
import { useSidePanelStore } from "@/store/side-panel";
// Pixels the open side panel takes from the right edge; undefined while it is
// closed, overlays full-width (below `sm`) or does not exist (full-page chat).
export function useSidePanelPushWidth(): number | undefined {
const pathname = usePathname();
const isOpen = useStore(useSidePanelStore, (state) => state.isOpen);
const width = useStore(useSidePanelStore, (state) => state.width);
const isPushViewport = useMediaQuery(SIDE_PANEL_PUSH_MEDIA_QUERY);
if (!isOpen || width === undefined || !isPushViewport) return undefined;
if (isLighthouseChatRoute(pathname)) return undefined;
// Re-clamp at consumption: a persisted width from a larger monitor
// rehydrates raw and would otherwise collapse the page on this viewport.
return clampSidePanelWidth(width);
}