-
Notifications
You must be signed in to change notification settings - Fork 2.6k
ui: remove and update extensions #1843
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
Conversation
| console.error(errorMessage); | ||
|
|
||
| if (toastId) toast.dismiss(toastId); | ||
| toast(<ErrorMsg name={extensionName} message={data.message} />, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have ToastError I think you can remove the custom ErrorMsg component and just use the reusable version.
|
|
||
| try { | ||
| toastId = toast.loading(`${actionVerb} ${extensionName} extension...`, { | ||
| position: 'top-center', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to go with top-center for more things? I'm just thinking it might feel inconsistent as other things use top right. I am good with either - perhaps we should just be consistent across the board!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The top right was annoying and covered the more menu :D top left covered the exit button lol
| const errorMessage = `Failed to ${actionType === 'adding' ? 'add' : 'remove'} ${extensionName} extension: ${error instanceof Error ? error.message : 'Unknown error'}`; | ||
| console.error(errorMessage); | ||
| if (toastId) toast.dismiss(toastId); | ||
| toast.error(errorMessage, { autoClose: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also nicely be ToastError
| // First add to the config system | ||
| await addExtensionFn(nameToKey(name), config, true); | ||
|
|
||
| if (config.type != 'stdio') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The V1 implementation supported the other kinds as well so this is a reminder to myself to go in very quickly after this and refactor to support HTTP+SSE ones as well.
Implements these flows for adding, removing, and updating extensions:

Follow up PRs will unify this with index.ts