chromaui / addon-visual-tests

Visual Tests addon for Storybook
MIT License
33 stars 2 forks source link

Show a notification when there is trouble accepting #84

Closed tmeasday closed 1 year ago

tmeasday commented 1 year ago

I'm not sure if we can format the error better but this is a lot better than nothing.

image
📦 Published PR as canary version: 0.0.64--canary.84.199e4d8.0
:sparkles: Test out this PR locally via: ```bash npm install @chromaui/addon-visual-tests@0.0.64--canary.84.199e4d8.0 # or yarn add @chromaui/addon-visual-tests@0.0.64--canary.84.199e4d8.0 ```
linear[bot] commented 1 year ago
AP-3447 Error UI when accepting

If you try to accept changes but you cannot (the build is out of date, or you don't have the right permission, for instance), we currently don't show UI for the error (we just log it to the browser console).

ndelangen commented 1 year ago

@tmeasday we could do something like this:

        addNotification({
          id: "chromatic/errorAccepting",
          link: "/visual-tests/error",
          content: {
            headline: "Failed to accept changes",
            subHeadline: err.message,
          },
          icon: {
            name: "cross",
            color: "red",
          },
        });

We can define custom page/routes with:

  addons.add(PAGE_ID, {
    type: types.experimental_PAGE,
    url: "/visual-tests",
    title: "Visual Tests",
    render: () => <div>HELLO</div>,
  });

We could use this to display detailed looking error messages/logs from the addon.