| @@ -1,4 +1,5 @@ | ||
| 1 | +import { useCanvasOpen } from '@agent/components/Canvas'; | |
| 1 | 2 | import { useDraggable } from '@agent/hooks/useDraggable'; |
| 2 | 3 | import { usePortal } from '@agent/hooks/usePortal'; |
| 3 | 4 | import { useResizable } from '@agent/hooks/useResizable'; |
| 4 | 5 | import { useGlobalStore } from '@agent/state/global'; |
| @@ -64,8 +65,10 @@ | ||
| 64 | 65 | observer.observe(el); |
| 65 | 66 | return () => observer.disconnect(); |
| 66 | 67 | }, [el, open, setOpen]); |
| 67 | 68 | |
| 69 | + const canvasOpen = useCanvasOpen(); | |
| 70 | + | |
| 68 | 71 | const closeAgent = () => { |
| 69 | 72 | setOpen(false); |
| 70 | 73 | // External contract: no in-repo listener by design — notifies |
| 71 | 74 | // host-page/analytics consumers the user dismissed the agent. |
| @@ -102,11 +105,12 @@ | ||
| 102 | 105 | <div className="opacity-0 transition-opacity duration-300 group-hover:opacity-100"> |
| 103 | 106 | <DragButton /> |
| 104 | 107 | </div> |
| 105 | 108 | </div> |
| 109 | + {/* Only hidden: removing it shifts the drag handle to the edge. */} | |
| 106 | 110 | <button |
| 107 | 111 | type="button" |
| 108 | - className="relative z-10 flex h-full items-center rounded-none border-0 bg-banner-main py-3 pe-4 ps-2 text-banner-text outline-hidden ring-design-main focus:shadow-none focus:outline-hidden focus-visible:outline-design-main" | |
| 112 | + className={`relative z-10 flex h-full items-center rounded-none border-0 bg-banner-main py-3 pe-4 ps-2 text-banner-text outline-hidden ring-design-main focus:shadow-none focus:outline-hidden focus-visible:outline-design-main ${canvasOpen ? 'invisible' : ''}`} | |
| 109 | 113 | onClick={closeAgent} |
| 110 | 114 | > |
| 111 | 115 | <Icon |
| 112 | 116 | className="pointer-events-none fill-current leading-none" |