Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ai-help): nicer error message #10424

Merged
merged 7 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, could we add the "Please try again" in React and make "try again" a button/link that resubmits the question? Like here:

Please{" "}
<Button type="link" onClickHandler={retryLastQuestion}>
try again
</Button>

fiji-flo marked this conversation as resolved.
Show resolved Hide resolved

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
Loading