@@ -14,10 +14,23 @@ export interface PublishedHeaderSlots {
1414 joinWithFollowingRow ?: boolean ;
1515}
1616
17+ const DRAG_STYLE = { WebkitAppRegion : "drag" } as React . CSSProperties ;
18+
1719interface PublishedHeaderSlotsViewProps {
1820 slots : PublishedHeaderSlots | null ;
1921 /** Left inset for host-specific chrome alignment. */
2022 paddingLeftClassName ?: string ;
23+ /**
24+ * Hand the space after `content` to the host window as a drag handle
25+ * instead of stretching `content` across it.
26+ *
27+ * `content` normally carries the `flex-1`, which makes the whole middle of
28+ * the row one no-drag region. That is fine while a tab bar sits above and
29+ * owns dragging, but a row that is its own pane's only chrome has to offer
30+ * a handle of its own — exactly as the tab strip does, where the strip is
31+ * draggable and only the pills opt out.
32+ */
33+ dragFiller ?: boolean ;
2134}
2235
2336/**
@@ -26,7 +39,11 @@ interface PublishedHeaderSlotsViewProps {
2639 */
2740export const PublishedHeaderSlotsView : React . FC < PublishedHeaderSlotsViewProps > =
2841 memo (
29- ( { slots, paddingLeftClassName = HEADER_CONTENT_LEFT_PADDING_CLASS } ) => {
42+ ( {
43+ slots,
44+ paddingLeftClassName = HEADER_CONTENT_LEFT_PADDING_CLASS ,
45+ dragFiller = false ,
46+ } ) => {
3047 return (
3148 < div
3249 className = { `flex min-w-0 flex-1 items-center ${ paddingLeftClassName } ` }
@@ -36,9 +53,20 @@ export const PublishedHeaderSlotsView: React.FC<PublishedHeaderSlotsViewProps> =
3653 { slots . leading }
3754 </ NoDragRegion >
3855 ) }
39- < NoDragRegion className = "flex min-w-0 flex-1 items-center" >
56+ < NoDragRegion
57+ className = { `flex min-w-0 items-center ${ dragFiller ? "" : "flex-1" } ` }
58+ >
4059 { slots ?. content }
4160 </ NoDragRegion >
61+ { dragFiller && (
62+ < div
63+ className = "h-full min-w-0 flex-1"
64+ data-tauri-drag-region
65+ data-testid = "published-header-drag-filler"
66+ style = { DRAG_STYLE }
67+ aria-hidden
68+ />
69+ ) }
4270 { slots ?. trailing && (
4371 < NoDragRegion className = "flex shrink-0 items-center gap-px" >
4472 { slots . trailing }
0 commit comments