mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-17 18:25:42 +02:00
[eric] canvas: NOTHING drags in fullscreen (untileForDrag chokepoint + guards on app and window cards; exit is the pill, green dot, or Escape)
This commit is contained in:
@@ -85,6 +85,8 @@ const CanvasWindowCard: React.FC<CanvasWindowCardProps> = ({
|
||||
|
||||
const onHeaderPointerDown = useCallback((e: React.PointerEvent) => {
|
||||
if (e.button !== 0) return;
|
||||
// Fullscreen has no drag (macOS rule); same guard as AgentCard/BrowserCard.
|
||||
if (tiling.zone === 'fullscreen') return;
|
||||
const target = e.target as HTMLElement;
|
||||
if (target.closest('[data-no-drag], button, [role="button"], input, textarea, select')) return;
|
||||
e.preventDefault();
|
||||
|
||||
@@ -396,6 +396,8 @@ const DashboardViewCard: React.FC<Props> = ({
|
||||
|
||||
const handleDragPointerDown = useCallback((e: React.PointerEvent) => {
|
||||
if (e.button !== 0) return;
|
||||
// Fullscreen has no drag (macOS rule); same guard as AgentCard/BrowserCard.
|
||||
if (tiling.zone === 'fullscreen') return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const cs = getCanvasState();
|
||||
|
||||
@@ -70,6 +70,8 @@ export function useCardTiling({ cardId, getCanvasState, commitPosition }: CardTi
|
||||
}, [tiledFrame, dispatch, cardId]);
|
||||
|
||||
const untileForDrag = useCallback((clientX: number, clientY: number, preTileWidth: number): { x: number; y: number } | null => {
|
||||
// Fullscreen never drag-untiles (macOS rule; also every card's own drag guard): exiting is the pill/green dot/Escape, never a stray header wiggle.
|
||||
if (zone === 'fullscreen') return null;
|
||||
const frame = tiledFrame();
|
||||
if (!frame) return null;
|
||||
const cam = getCanvasState();
|
||||
|
||||
Reference in New Issue
Block a user