Move agent section to fab (#6597)

This commit is contained in:
EthanHealy01
2026-06-10 15:47:47 +01:00
committed by GitHub
parent da4b84962c
commit 9b877d4f8d
15 changed files with 1149 additions and 0 deletions
@@ -0,0 +1,45 @@
import type { CSSProperties, MouseEventHandler, ReactNode } from "react";
import "@shared/components/ChatFABWindow.css";
export interface ChatFABWindowProps {
/** Whether the window is in its expanded/visible state. Controls the CSS transition. */
open: boolean;
children: ReactNode;
className?: string;
style?: CSSProperties;
onDoubleClick?: MouseEventHandler<HTMLDivElement>;
}
/**
* Visual frame for the floating chat panel.
*
* Renders a card shell (rounded corners, shadow, border) that animates in and
* out via CSS transitions. The caller controls open/closed state; this component
* owns only the appearance and animation — no drag logic, no context.
*/
export function ChatFABWindow({
open,
children,
className,
style,
onDoubleClick,
}: ChatFABWindowProps) {
const classes = [
"chat-fab-window",
open ? "chat-fab-window--open" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<div
className={classes}
style={style}
aria-hidden={!open}
onDoubleClick={onDoubleClick}
>
{children}
</div>
);
}