Skip to content

Commit

Permalink
fix(ai-help): nicer error message
Browse files Browse the repository at this point in the history
Add an icon and background for the error generating
answer error message.
  • Loading branch information
fiji-flo committed Jan 30, 2024
1 parent 7034c60 commit a2c116b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions client/src/assets/icons/alert-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/plus/ai-help/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export const MESSAGE_SEARCHING = "Searching for MDN content…";
export const MESSAGE_SEARCHED = "Consulted MDN content:";
export const MESSAGE_ANSWERING = "Generating your answer…";
export const MESSAGE_ANSWERED = "Answer:";
export const MESSAGE_FAILED = "Error generating your answer!";
export const MESSAGE_FAILED = "Error generating your answer! Please try again.";

export const EVENT_TIMEOUT = 15000;
15 changes: 12 additions & 3 deletions client/src/plus/ai-help/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,18 @@
mask-image: url("../../assets/icons/progress-check.svg");
}

&.errored::before {
animation: none;
background-color: var(--icon-critical);
&.errored {
background-color: var(--background-critical);
border: 0;
border-radius: var(--elem-radius);
color: var(--icon-critical);
padding: 0.5rem 1rem;

&::before {
animation: none;
background-color: var(--icon-critical);
mask-image: url("../../assets/icons/alert-circle.svg");
}
}
}

Expand Down

0 comments on commit a2c116b

Please sign in to comment.