From 7250fc035425c8f4c6a647717b4dca579504ea27 Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Sat, 8 Nov 2025 23:40:50 +0800 Subject: [PATCH] viz: double click on kernel run goes to codegen (#13147) --- tinygrad/viz/js/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index 3b509ba3c3..4e5cc9dd7b 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -488,12 +488,15 @@ async function renderProfiler() { } } - canvas.addEventListener("click", e => { + const clickShape = (e) => { e.preventDefault(); const foundRect = findRectAtPosition(e.clientX, e.clientY); - if (foundRect?.step != null && foundRect?.key == null) { return switchCtx(foundRect.ctx, foundRect.step); } + if (foundRect?.step != null && (foundRect?.key == null || e.type == "dblclick")) { return switchCtx(foundRect.ctx, foundRect.step); } if (foundRect?.key != focusedShape) { focusShape(foundRect); } - }); + } + canvas.addEventListener("click", clickShape); + + canvas.addEventListener("dblclick", clickShape); canvas.addEventListener("mousemove", e => { const foundRect = findRectAtPosition(e.clientX, e.clientY);