diff --git a/app/src/ui/layouts/AppShell/AppShell.tsx b/app/src/ui/layouts/AppShell/AppShell.tsx index a161356..d749ac3 100644 --- a/app/src/ui/layouts/AppShell/AppShell.tsx +++ b/app/src/ui/layouts/AppShell/AppShell.tsx @@ -367,6 +367,34 @@ export const SectionHeaderTabs = ({ title, items }: SectionHeaderTabsProps) => { ); }; +export function MaxHeightContainer(props: ComponentPropsWithoutRef<"div">) { + const scrollRef = useRef>(null); + const [offset, setOffset] = useState(0); + const [height, setHeight] = useState(window.innerHeight); + + function updateHeaderHeight() { + if (scrollRef.current) { + // get offset to top of window + const offset = scrollRef.current.getBoundingClientRect().top; + const height = window.innerHeight; + setOffset(offset); + setHeight(height); + } + } + + useEffect(updateHeaderHeight, []); + + if (typeof window !== "undefined") { + window.addEventListener("resize", throttle(updateHeaderHeight, 500)); + } + + return ( +
+ {props.children} +
+ ); +} + export function Scrollable({ children, initialOffset = 64, @@ -379,7 +407,9 @@ export function Scrollable({ function updateHeaderHeight() { if (scrollRef.current) { - setOffset(scrollRef.current.offsetTop); + // get offset to top of window + const offset = scrollRef.current.getBoundingClientRect().top; + setOffset(offset); } } diff --git a/app/src/ui/routes/tools/mcp/mcp.tsx b/app/src/ui/routes/tools/mcp/mcp.tsx index f799223..8b46657 100644 --- a/app/src/ui/routes/tools/mcp/mcp.tsx +++ b/app/src/ui/routes/tools/mcp/mcp.tsx @@ -36,16 +36,18 @@ export default function ToolsMcp() {
- setFeature("tools")} /> - setFeature("resources")} - > -
- Resources -
-
+ + setFeature("tools")} /> + setFeature("resources")} + > +
+ Resources +
+
+
{feature === "tools" && }