From ebdf081671c632fdf5fe30a06efab13ae6eafbe2 Mon Sep 17 00:00:00 2001 From: Francesco Renzi Date: Fri, 16 Jan 2026 01:05:30 +0000 Subject: [PATCH] fix indexing --- browser-ext/content/content.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/browser-ext/content/content.js b/browser-ext/content/content.js index 3b695e3bc..a1e064d21 100644 --- a/browser-ext/content/content.js +++ b/browser-ext/content/content.js @@ -492,8 +492,9 @@ async function handleStoppedEvent(body) { let stepElement = findStepByName(rawStepName); if (!stepElement && currentFrame.line > 0) { - // Fallback: use step number from Line property (1-indexed, matches data-number) - stepElement = findStepByNumber(currentFrame.line); + // Fallback: use step number from Line property + // Add 1 to account for "Set up job" which is always step 1 in GitHub UI but not in DAP + stepElement = findStepByNumber(currentFrame.line + 1); } if (stepElement) { @@ -557,8 +558,9 @@ async function loadCurrentDebugState() { let stepElement = findStepByName(rawStepName); if (!stepElement && currentFrame.line > 0) { - // Fallback: use step number from Line property (1-indexed, matches data-number) - stepElement = findStepByNumber(currentFrame.line); + // Fallback: use step number from Line property + // Add 1 to account for "Set up job" which is always step 1 in GitHub UI but not in DAP + stepElement = findStepByNumber(currentFrame.line + 1); } if (stepElement) {