diff --git a/browser-ext/content/content.css b/browser-ext/content/content.css index f652ac21a..950fa4536 100644 --- a/browser-ext/content/content.css +++ b/browser-ext/content/content.css @@ -723,6 +723,14 @@ html[data-color-mode="light"] .dap-debug-btn.selected { color: var(--fgColor-success, #3fb950); } +.dap-step-status-icon.completed.success { + color: var(--fgColor-success, #3fb950); +} + +.dap-step-status-icon.completed.failed { + color: var(--fgColor-danger, #f85149); +} + .dap-step-status-icon.current { color: var(--fgColor-accent, #58a6ff); } diff --git a/browser-ext/content/content.js b/browser-ext/content/content.js index ba199fe72..e46e9bd35 100644 --- a/browser-ext/content/content.js +++ b/browser-ext/content/content.js @@ -156,6 +156,7 @@ const Icons = { arrowUp: ``, arrowDown: ``, copy: ``, + x: ``, }; /** @@ -458,10 +459,14 @@ function closeDebuggerPane() { /** * Get status icon for step */ -function getStepStatusIcon(status) { +function getStepStatusIcon(status, result) { switch (status) { case 'completed': - return `${Icons.check}`; + if (result === 'succeeded') { + return `${Icons.check}`; + } else { + return `${Icons.x}`; + } case 'current': return `${Icons.play}`; case 'pending': @@ -485,7 +490,7 @@ function renderStepList(steps) { stepsList = steps; const html = steps.map((step) => { - const statusIcon = getStepStatusIcon(step.status); + const statusIcon = getStepStatusIcon(step.status, step.result); const changeBadge = step.change ? `[${step.change}]` : ''; const typeLabel = step.type === 'uses' ? step.typeDetail || step.type : step.type; const isPending = step.status === 'pending'; diff --git a/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs b/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs index 1ca556fc9..96929a84f 100644 --- a/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs +++ b/src/Runner.Worker/Dap/StepCommands/StepCommandHandler.cs @@ -333,6 +333,7 @@ EXAMPLES: type = s.Type, typeDetail = s.TypeDetail, status = s.Status.ToString().ToLower(), + result = s.Result?.ToString().ToLower(), change = s.Change?.ToString().ToUpper() }).ToList(), totalCount = steps.Count, @@ -378,10 +379,11 @@ EXAMPLES: foreach (var step in steps) { - // Status indicator + // Status indicator - for completed steps, differentiate success vs failure var statusIcon = step.Status switch { - StepStatus.Completed => "\u2713", // checkmark + StepStatus.Completed when step.Result == DistributedTask.WebApi.TaskResult.Succeeded => "\u2713", // checkmark + StepStatus.Completed => "\u2717", // x mark for failed/canceled/skipped StepStatus.Current => "\u25B6", // play arrow StepStatus.Pending => " ", _ => "?" @@ -419,7 +421,7 @@ EXAMPLES: // Legend sb.AppendLine(); - sb.Append("Legend: \u2713 = completed, \u25B6 = current/paused"); + sb.Append("Legend: \u2713 = succeeded, \u2717 = failed, \u25B6 = current/paused"); if (steps.Any(s => s.Change.HasValue)) { sb.Append(", [ADDED] = new, [MODIFIED] = edited, [MOVED] = reordered"); diff --git a/src/Runner.Worker/Dap/StepCommands/StepInfo.cs b/src/Runner.Worker/Dap/StepCommands/StepInfo.cs index 810e4bea5..fb45e8b48 100644 --- a/src/Runner.Worker/Dap/StepCommands/StepInfo.cs +++ b/src/Runner.Worker/Dap/StepCommands/StepInfo.cs @@ -1,4 +1,5 @@ using GitHub.DistributedTask.Pipelines; +using GitHub.DistributedTask.WebApi; namespace GitHub.Runner.Worker.Dap.StepCommands { @@ -61,6 +62,11 @@ namespace GitHub.Runner.Worker.Dap.StepCommands /// public StepStatus Status { get; set; } + /// + /// Result of step execution (for completed steps). + /// + public TaskResult? Result { get; set; } + /// /// Change type if the step was modified during this debug session, null otherwise. /// @@ -93,7 +99,8 @@ namespace GitHub.Runner.Worker.Dap.StepCommands Index = index, Name = step.DisplayName ?? "Unknown step", Status = status, - Step = step + Step = step, + Result = step.ExecutionContext?.Result }; // Try to extract ActionStep from IActionRunner