Skip to content

Commit 4fc8659

Browse files
committed
feat: show the run command for local reports
Adds a bit of text that shows the user how they can run an app locally for debugging.
1 parent 914c8fc commit 4fc8659

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

report-app/src/app/pages/report-viewer/report-viewer.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,21 @@ <h4>{{ journey.name }}</h4>
461461

462462
<div class="app-details-section">
463463
<h4>Debugging Tools</h4>
464+
464465
<button
465466
class="neutral-button"
466467
title="Download a ZIP for debugging. You can upload the ZIP to AI Studio for further analysis of a specific app."
467-
(click)="downloadDebuggingZip(result)"
468-
>
468+
(click)="downloadDebuggingZip(result)">
469469
Download ZIP for debugging
470470
</button>
471+
472+
@let debugCommand = getDebugCommand(report, result);
473+
474+
@if (debugCommand) {
475+
<p>To see the app locally, run the following command:</p>
476+
<pre class="callout neutral code">{{debugCommand}}</pre>
477+
}
478+
471479
@if (result.toolLogs && result.toolLogs.length > 0) {
472480
<expansion-panel>
473481
<expansion-panel-header>Tool Logs</expansion-panel-header>

report-app/src/app/pages/report-viewer/report-viewer.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ import { ExpansionPanel } from '../../shared/expansion-panel/expansion-panel';
4444
import { ExpansionPanelHeader } from '../../shared/expansion-panel/expansion-panel-header';
4545
import { ProviderLabel } from '../../shared/provider-label';
4646

47+
const localReportRegex = /-l\d+$/;
48+
4749
@Component({
4850
imports: [
4951
StackedBarChart,
@@ -439,4 +441,16 @@ export class ReportViewer {
439441
return 'failed';
440442
}
441443
}
444+
445+
protected getDebugCommand(
446+
report: RunInfo,
447+
result: AssessmentResult
448+
): string | null {
449+
// Only show the command for local reports.
450+
if (!localReportRegex.test(report.group)) {
451+
return null;
452+
}
453+
454+
return `wcs run --prompt=${result.promptDef.name} --env=<path to ${report.details.summary.environmentId} config>`;
455+
}
442456
}

0 commit comments

Comments
 (0)