From e2d2130f5c9f6233af524bad0e3f6c8cb8a616aa Mon Sep 17 00:00:00 2001 From: Walter Pearce Date: Mon, 26 Oct 2026 16:38:27 -0700 Subject: [PATCH] Add a mobile layout and touch zoom to the render UI. --- render/src/App.tsx | 12 ++- render/src/components/MapView.tsx | 16 ++- render/src/components/Toolbar.tsx | 22 +++- render/src/styles.css | 168 ++++++++++++++++++++++++++++++ render/src/touch.ts | 96 +++++++++++++++++ 5 files changed, 309 insertions(+), 5 deletions(-) create mode 100644 render/src/touch.ts diff --git a/render/src/App.tsx b/render/src/App.tsx index 85c9f51..9bc4e22 100644 --- a/render/src/App.tsx +++ b/render/src/App.tsx @@ -15,6 +15,7 @@ import { type View, } from './api'; import { emptyStore, mergePayload, removeNode, toNvl, type GraphStore } from './graph'; +import { useTouchZoomPan } from './touch'; import { Toolbar } from './components/Toolbar'; import { DetailsPanel } from './components/DetailsPanel'; import { CypherPanel } from './components/CypherPanel'; @@ -40,6 +41,8 @@ const errorMessage = (err: unknown): string => { export function App() { const nvlRef = useRef(null); + const [canvasEl, setCanvasEl] = useState(null); + useTouchZoomPan(canvasEl, nvlRef); const [store, setStore] = useState(emptyStore); const [selectedId, setSelectedId] = useState(null); const [options, setOptions] = useState(DEFAULT_OPTIONS); @@ -367,7 +370,7 @@ export function App() { /> ) : ( <> -
+
{nodes.length === 0 && view === 'deps' ? (

crate dependency chain

@@ -405,7 +408,12 @@ export function App() { style={{ width: '100%', height: '100%' }} />
-