Compare commits

..

2 Commits

Author SHA1 Message Date
8556a80868 sscrol 2026-03-08 23:28:56 +01:00
84cc40b472 zoom handle 2026-03-08 23:27:34 +01:00
2 changed files with 42 additions and 1 deletions

View File

@@ -259,6 +259,15 @@ export default function App() {
}
}, [])
// Disable canvas zoom when the cursor is over a node (scroll/pinch only zooms when over the pane)
const onWheelCapture = React.useCallback((ev: React.WheelEvent) => {
const target = ev.target as HTMLElement
if (target.closest('.react-flow__node')) {
ev.preventDefault()
ev.stopPropagation()
}
}, [])
const onCanvasContextMenu = React.useCallback((ev: React.MouseEvent) => {
ev.preventDefault()
const clientX = ev.clientX
@@ -381,7 +390,7 @@ export default function App() {
<FlowContext.Provider value={flowContextValue}>
<ContextMenu>
<ContextMenuTrigger asChild>
<div className="flex-1 min-h-0 w-full">
<div className="flex-1 min-h-0 w-full" onWheelCapture={onWheelCapture}>
<ReactFlowProvider initialNodes={nodes} initialEdges={edges} fitView>
<ReactFlow
nodes={nodes}

View File

@@ -128,6 +128,38 @@ pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
}
/* Compact scrollbars that respect light/dark mode */
* {
scrollbar-width: thin;
scrollbar-color: hsl(var(--muted-foreground) / 0.35) transparent;
}
.dark * {
scrollbar-color: hsl(var(--muted-foreground) / 0.4) transparent;
}
*::-webkit-scrollbar {
width: 6px;
height: 6px;
}
*::-webkit-scrollbar-track {
background: transparent;
}
*::-webkit-scrollbar-thumb {
background: hsl(var(--muted-foreground) / 0.35);
border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover {
background: hsl(var(--muted-foreground) / 0.5);
}
*::-webkit-scrollbar-corner {
background: transparent;
}
.dark *::-webkit-scrollbar-thumb {
background: hsl(var(--muted-foreground) / 0.4);
}
.dark *::-webkit-scrollbar-thumb:hover {
background: hsl(var(--muted-foreground) / 0.55);
}
@layer base {
:root {
--background: 0 0% 100%;