From 1fa5442f211fb06548bc51ea3192b5e0b4ffe614 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 15 Apr 2026 01:00:05 +0200 Subject: chore: remove debugging throughout codebase --- apps/web/src/hooks/use-keybindings.ts | 95 ----------------------------------- 1 file changed, 95 deletions(-) (limited to 'apps/web/src/hooks/use-keybindings.ts') diff --git a/apps/web/src/hooks/use-keybindings.ts b/apps/web/src/hooks/use-keybindings.ts index 3f96c340..0c524214 100644 --- a/apps/web/src/hooks/use-keybindings.ts +++ b/apps/web/src/hooks/use-keybindings.ts @@ -21,68 +21,10 @@ export function useKeybindingsListener() { useEffect(() => { const eventOptions: AddEventListenerOptions = { capture: true }; - // #region agent log - fetch("http://127.0.0.1:7245/ingest/669b22f8-172b-4e65-aa3f-1c702ede83f7", { - method: "POST", - headers: { - "Content-Type": "application/json", - "X-Debug-Session-Id": "3997d9", - }, - body: JSON.stringify({ - sessionId: "3997d9", - runId: "initial", - hypothesisId: "H1", - location: "use-keybindings.ts:effect", - message: "Keybindings listener mounted", - data: { - overlayDepth, - isLoadingProject, - isRecording, - keybindingCount: Object.keys(keybindings).length, - }, - timestamp: Date.now(), - }), - }).catch(() => {}); - // #endregion const handleKeyDown = (ev: KeyboardEvent) => { const normalizedKey = (ev.key ?? "").toLowerCase(); - const shouldLogKey = - ev.code === "Space" || - ev.code.startsWith("Key") || - ["escape", "delete", "backspace", "enter"].includes(normalizedKey); if (overlayDepth > 0 || isLoadingProject || isRecording) { - if (shouldLogKey) { - // #region agent log - fetch( - "http://127.0.0.1:7245/ingest/669b22f8-172b-4e65-aa3f-1c702ede83f7", - { - method: "POST", - headers: { - "Content-Type": "application/json", - "X-Debug-Session-Id": "3997d9", - }, - body: JSON.stringify({ - sessionId: "3997d9", - runId: "initial", - hypothesisId: "H2", - location: "use-keybindings.ts:blocked", - message: "Shortcut blocked by runtime gate", - data: { - key: ev.key, - code: ev.code, - overlayDepth, - isLoadingProject, - isRecording, - targetTag: - ev.target instanceof HTMLElement ? ev.target.tagName : null, - }, - timestamp: Date.now(), - }), - }, - ).catch(() => {}); - // #endregion - } return; } @@ -93,43 +35,6 @@ export function useKeybindingsListener() { isTypableDOMElement({ element: activeElement }); const boundAction = binding ? keybindings[binding] : undefined; - if (shouldLogKey || binding || boundAction) { - // #region agent log - fetch( - "http://127.0.0.1:7245/ingest/669b22f8-172b-4e65-aa3f-1c702ede83f7", - { - method: "POST", - headers: { - "Content-Type": "application/json", - "X-Debug-Session-Id": "3997d9", - }, - body: JSON.stringify({ - sessionId: "3997d9", - runId: "initial", - hypothesisId: !binding ? "H3" : isTextInput ? "H5" : "H4", - location: "use-keybindings.ts:keydown", - message: "Shortcut keydown observed", - data: { - key: ev.key, - code: ev.code, - binding, - boundAction: boundAction ?? null, - isTextInput, - keybindingCount: Object.keys(keybindings).length, - activeTag: - activeElement instanceof HTMLElement - ? activeElement.tagName - : null, - targetTag: - ev.target instanceof HTMLElement ? ev.target.tagName : null, - }, - timestamp: Date.now(), - }), - }, - ).catch(() => {}); - // #endregion - } - if (normalizedKey === "escape" && isTextInput) { activeElement.blur(); return; -- cgit v1.3.1