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

Show instructional UI if main.js updating fails #41

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Aug 21, 2023

Add a new event to tell manager if we failed + UI as per design here: https://linear.app/chromaui/issue/AP-3485#comment-0767a585

To QA:

  1. Clear addon's options from main.js
  2. Add a throw to updateMain.ts
  3. Pick a project in the addon.
📦 Published PR as canary version: 0.0.41--canary.41.7576b70.0

✨ Test out this PR locally via:

npm install @chromaui/addon-visual-tests@0.0.41--canary.41.7576b70.0
# or 
yarn add @chromaui/addon-visual-tests@0.0.41--canary.41.7576b70.0

@linear
Copy link

linear bot commented Aug 21, 2023

AP-3485 Display the project token and project id to the user in case of failure - enable user to configure manually.

When a user selects a project from the project picker, we automatically add these to the main.js file.

However, in the event that the user has a very custom configuration, there is a possibility that adding it automatically will fail. This is a suggestion that we display the project token and project id that the user selects, before trying to automatically add it to the storybook configuration.

In this case, it may also make sense to provide a prompt to the user before trying to automatically modify their configuration. Perhaps a secondary button that skips automatic configuration (and lets the user know how to manually configure it). Otherwise, we would always attempt to configure it and potentially break their configuration.

Even in the event of a failure, the projectToken and projectId are stored in localstorage on the client and an environment variable on the server to not require a storybook restart, so the addon allows the user to continue without finishing the configuration step. This may not be an issue, but if we allow user to manually update, then this may lead to some confusion if they skip manually and automatically updating it.

@tmeasday tmeasday merged commit 44a517f into main Aug 29, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants