Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 33af3c6

Browse files
committedJun 19, 2025··
fix(vscode): add 'Fix Creation Failed' state and improve UI elements
1 parent eb5d4fa commit 33af3c6

File tree

3 files changed

+59
-28
lines changed

3 files changed

+59
-28
lines changed
 

‎libs/vscode/nx-cloud-fix-webview/src/nx-cloud-fix-component.stories.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,23 @@ export const InProgress: Story = {
188188
},
189189
};
190190

191+
export const FixCreationFailed: Story = {
192+
args: {
193+
details: {
194+
...mockDetails,
195+
runGroup: {
196+
...mockDetails.runGroup,
197+
aiFix: {
198+
...mockDetails.runGroup.aiFix!,
199+
validationStatus: 'FAILED',
200+
suggestedFix: undefined,
201+
suggestedFixDescription: undefined,
202+
},
203+
},
204+
},
205+
},
206+
};
207+
191208
export const NoTerminalOutput: Story = {
192209
args: {
193210
details: {

‎libs/vscode/nx-cloud-fix-webview/src/nx-cloud-fix-component.ts

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ export class NxCloudFixComponent extends LitElement {
117117
flex-shrink: 0;
118118
}
119119
120+
.cipe-link {
121+
cursor: pointer;
122+
color: var(--vscode-button-primaryForeground);
123+
}
124+
120125
.branch-badge {
121126
background-color: var(--vscode-button-secondaryBackground);
122127
color: var(--vscode-button-secondaryForeground);
@@ -649,6 +654,8 @@ export class NxCloudFixComponent extends LitElement {
649654
}
650655
651656
.loading-dots {
657+
width: 24px;
658+
text-align: left;
652659
display: inline-block;
653660
}
654661
@@ -741,7 +748,7 @@ export class NxCloudFixComponent extends LitElement {
741748
<p class="explanation-text" style="margin-top: 8px;">
742749
You can
743750
<span class="diff-link" @click="${() => this.handleShowDiff()}">
744-
review the resulting git diff of the suggested changes </span
751+
review the resulting git diff of the suggested changes</span
745752
>&nbsp;and choose to apply or reject them.
746753
</p>
747754
</div>
@@ -786,6 +793,14 @@ export class NxCloudFixComponent extends LitElement {
786793
></path>
787794
</svg>
788795
Nx Cloud AI Fix
796+
<a
797+
class="cipe-link"
798+
target="_blank"
799+
href="${cipe.cipeUrl}"
800+
title="View CI Pipeline Execution"
801+
>
802+
<icon-element icon="link-external"></icon-element>
803+
</a>
789804
</h1>
790805
<div class="branch-badge">
791806
<icon-element icon="git-branch"></icon-element>
@@ -861,19 +876,7 @@ export class NxCloudFixComponent extends LitElement {
861876
return html`
862877
<div class="creating-fix-section">
863878
<div class="creating-fix-icon">
864-
<svg
865-
class="codicon-modifier-spin"
866-
role="img"
867-
xmlns="http://www.w3.org/2000/svg"
868-
stroke="currentColor"
869-
fill="none"
870-
stroke-width="2"
871-
viewBox="0 0 24 24"
872-
>
873-
<path
874-
d="M12 2v4m0 12v4m10-10h-4M6 12H2m15.364-6.364l-2.828 2.828M9.464 14.536l-2.828 2.828m12.728 0l-2.828-2.828M9.464 9.464L6.636 6.636"
875-
/>
876-
</svg>
879+
<i class="codicon codicon-loading codicon-modifier-spin"></i>
877880
</div>
878881
<h2 class="creating-fix-title">
879882
Creating Fix<span class="loading-dots"></span>
@@ -971,30 +974,40 @@ export class NxCloudFixComponent extends LitElement {
971974
}
972975

973976
private getStatusSection(aiFix: NxAiFix): TemplateResult {
974-
if (!aiFix.suggestedFix) {
977+
const hasAiFix = !!aiFix.suggestedFix;
978+
979+
if (!hasAiFix && aiFix.validationStatus === 'NOT_STARTED') {
975980
// Show creating fix state
976981
return this.getCreatingFixSection();
977982
}
978983

984+
// if the fix creation failed, show the proper error state
985+
if (!hasAiFix && aiFix.validationStatus === 'FAILED') {
986+
return html`
987+
<div class="creating-fix-section">
988+
<div class="creating-fix-icon">
989+
<i
990+
class="codicon codicon-error"
991+
style="color: var(--error-color);"
992+
></i>
993+
</div>
994+
<h2 class="creating-fix-title">Fix Creation Failed</h2>
995+
<p class="creating-fix-description">
996+
Nx Cloud was unable to generate a fix for the error. You can try
997+
running the task again or investigate the issue manually on the Nx
998+
Cloud UI
999+
</p>
1000+
</div>
1001+
`;
1002+
}
1003+
9791004
// Fix exists, show verification status
9801005
switch (aiFix.validationStatus) {
9811006
case 'IN_PROGRESS':
9821007
return html`
9831008
<div class="creating-fix-section">
9841009
<div class="creating-fix-icon">
985-
<svg
986-
class="codicon-modifier-spin"
987-
role="img"
988-
xmlns="http://www.w3.org/2000/svg"
989-
stroke="currentColor"
990-
fill="none"
991-
stroke-width="2"
992-
viewBox="0 0 24 24"
993-
>
994-
<path
995-
d="M12 2v4m0 12v4m10-10h-4M6 12H2m15.364-6.364l-2.828 2.828M9.464 14.536l-2.828 2.828m12.728 0l-2.828-2.828M9.464 9.464L6.636 6.636"
996-
/>
997-
</svg>
1010+
<i class="codicon codicon-loading codicon-modifier-spin"></i>
9981011
</div>
9991012
<h2 class="creating-fix-title">
10001013
Verifying Fix<span class="loading-dots"></span>

‎libs/vscode/nx-cloud-view/src/nx-cloud-fix-webview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export class NxCloudFixWebview {
151151
'nxCloud.applyAiFixLocally',
152152
this.currentFixDetails,
153153
);
154+
this.webviewPanel?.dispose();
154155
break;
155156
}
156157
}

0 commit comments

Comments
 (0)
Please sign in to comment.