Skip to content

Commit ce04f41

Browse files
authored
add a left drag handle on the toolbar (#291)
1 parent f47c28d commit ce04f41

File tree

3 files changed

+61
-4
lines changed

3 files changed

+61
-4
lines changed

ui/src/components/nodes/Code.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ function MyFloatingToolbar({ id, layout, setLayout }) {
308308
<Box
309309
sx={{ display: "flex", alignItems: "center", justifyContent: "center" }}
310310
>
311+
<Box
312+
className="custom-drag-handle"
313+
sx={{
314+
cursor: "grab",
315+
fontSize: "1.5rem",
316+
padding: "8px",
317+
display: "inline-flex",
318+
}}
319+
>
320+
<DragIndicatorIcon fontSize="inherit" />
321+
</Box>
311322
{!isGuest && (
312323
<Tooltip title="Run (shift-enter)">
313324
<IconButton
@@ -384,7 +395,15 @@ function MyFloatingToolbar({ id, layout, setLayout }) {
384395
<ViewComfyIcon fontSize="inherit" />
385396
</IconButton>
386397
</Tooltip>
387-
<Box className="custom-drag-handle" sx={{ cursor: "grab" }}>
398+
<Box
399+
className="custom-drag-handle"
400+
sx={{
401+
cursor: "grab",
402+
fontSize: "1.5rem",
403+
padding: "8px",
404+
display: "inline-flex",
405+
}}
406+
>
388407
<DragIndicatorIcon fontSize="inherit" />
389408
</Box>
390409
</Box>

ui/src/components/nodes/Rich.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,17 @@ function MyFloatingToolbar({ id }: { id: string }) {
624624
const isGuest = useStore(store, (state) => state.role === "GUEST");
625625
return (
626626
<>
627+
<Box
628+
className="custom-drag-handle"
629+
sx={{
630+
cursor: "grab",
631+
fontSize: "1.5rem",
632+
padding: "8px",
633+
display: "inline-flex",
634+
}}
635+
>
636+
<DragIndicatorIcon fontSize="inherit" />
637+
</Box>
627638
{!isGuest && (
628639
<Tooltip title="Delete">
629640
<IconButton
@@ -636,8 +647,16 @@ function MyFloatingToolbar({ id }: { id: string }) {
636647
</IconButton>
637648
</Tooltip>
638649
)}
639-
<Box className="custom-drag-handle" sx={{ cursor: "grab" }}>
640-
<DragIndicatorIcon fontSize="small" />
650+
<Box
651+
className="custom-drag-handle"
652+
sx={{
653+
cursor: "grab",
654+
fontSize: "1.5rem",
655+
padding: "8px",
656+
display: "inline-flex",
657+
}}
658+
>
659+
<DragIndicatorIcon fontSize="inherit" />
641660
</Box>
642661
</>
643662
);

ui/src/components/nodes/Scope.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ function MyFloatingToolbar({ id }: { id: string }) {
9494
alignItems: "center",
9595
}}
9696
>
97+
<Box
98+
className="custom-drag-handle"
99+
sx={{
100+
cursor: "grab",
101+
fontSize: "1.5rem",
102+
padding: "8px",
103+
display: "inline-flex",
104+
}}
105+
>
106+
<DragIndicatorIcon fontSize="inherit" />
107+
</Box>
97108
{!isGuest && (
98109
<Tooltip title="Run (shift-enter)">
99110
<IconButton
@@ -158,7 +169,15 @@ function MyFloatingToolbar({ id }: { id: string }) {
158169
</IconButton>
159170
</Tooltip>
160171
)}
161-
<Box className="custom-drag-handle" sx={{ cursor: "grab" }}>
172+
<Box
173+
className="custom-drag-handle"
174+
sx={{
175+
cursor: "grab",
176+
fontSize: "1.5rem",
177+
padding: "8px",
178+
display: "inline-flex",
179+
}}
180+
>
162181
<DragIndicatorIcon fontSize="inherit" />
163182
</Box>
164183
</Box>

0 commit comments

Comments
 (0)