fix ordering for first step

This commit is contained in:
Francesco Renzi
2026-01-15 23:56:23 +00:00
parent ff85ab7fe0
commit 2525a1f9a3

View File

@@ -165,8 +165,10 @@ function injectDebuggerPane() {
pane.className = 'dap-debugger-pane mx-2 mb-2 border rounded-2'; pane.className = 'dap-debugger-pane mx-2 mb-2 border rounded-2';
pane.innerHTML = createDebuggerPaneHTML(); pane.innerHTML = createDebuggerPaneHTML();
// Insert at the top of steps container // Insert before the first real workflow step (skip "Set up job" at index 0)
stepsContainer.insertBefore(pane, stepsContainer.firstChild); const steps = stepsContainer.querySelectorAll('check-step');
const targetStep = steps.length > 1 ? steps[1] : stepsContainer.firstChild;
stepsContainer.insertBefore(pane, targetStep);
// Setup event handlers // Setup event handlers
setupPaneEventHandlers(pane); setupPaneEventHandlers(pane);
@@ -569,10 +571,21 @@ async function loadCurrentDebugState() {
currentFrameId = currentFrame.id; currentFrameId = currentFrame.id;
// Move pane to current step // Move pane to current step
const stepName = currentFrame.name; // Strip result indicator from step name for DOM lookup
const stepElement = findStepByName(stepName); const rawStepName = stripResultIndicator(currentFrame.name);
let stepElement = findStepByName(rawStepName);
if (!stepElement) {
// Fallback: use step index (skip "Set up job" at index 0)
const steps = getAllSteps();
const adjustedIndex = currentFrame.id; // 1-based, matches after skipping "Set up job"
if (adjustedIndex > 0 && adjustedIndex < steps.length) {
stepElement = steps[adjustedIndex];
}
}
if (stepElement) { if (stepElement) {
moveDebuggerPane(stepElement, stepName); moveDebuggerPane(stepElement, rawStepName);
} }
// Update step counter // Update step counter
@@ -609,6 +622,7 @@ function handleStatusChange(status) {
isConnected = true; isConnected = true;
updateStatus('PAUSED'); updateStatus('PAUSED');
enableControls(true); enableControls(true);
loadCurrentDebugState();
break; break;
case 'running': case 'running':