import React from 'react'; import type { TFunction } from 'i18next'; import { PanelRight, PanelRightClose } from 'lucide-react'; import { shouldSuppressQueueResizerMouseDown } from '../utils/componentHelpers/appShellHelpers'; interface Props { isQueueVisible: boolean; queueWidth: number; queueHandleTop: number | null; isMainScrolling: boolean; setIsDraggingQueue: React.Dispatch>; handleQueueHandleMouseDown: (e: React.MouseEvent) => void; t: TFunction; } /** * The seam between the main column and the queue panel — a 6px resizer * strip and the round resize/toggle handle floating over it. Desktop-only. * * The strip's mousedown is intentionally elaborate: it has to ignore * clicks aimed at the main viewport's overlay scrollbar thumb (which sits * inside the resizer's overlap region) and self-heal a stale * `is-overlay-scrollbar-thumb-drag` body flag if no thumb is actually * dragging. The handle is fixed-positioned and aligned with the sidebar's * collapse button so the two visually pair across resizes. */ export function AppShellQueueResizerSeam({ isQueueVisible, queueWidth, queueHandleTop, isMainScrolling, setIsDraggingQueue, handleQueueHandleMouseDown, t, }: Props) { return ( <>
{ e.preventDefault(); if (document.body.classList.contains('is-overlay-scrollbar-thumb-drag')) { const activeThumbDrag = document.querySelector('.overlay-scroll__thumb.is-thumb-dragging'); if (!activeThumbDrag) { document.body.classList.remove('is-overlay-scrollbar-thumb-drag'); } else { return; } } if (shouldSuppressQueueResizerMouseDown(e.clientX, e.clientY, queueWidth)) return; setIsDraggingQueue(true); }} style={{ display: isQueueVisible ? 'block' : 'none', right: `${Math.max(0, queueWidth - 3)}px`, }} /> {isQueueVisible && ( )} ); }