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

Use toast to show app notifications #975

Merged
merged 6 commits into from
Aug 18, 2020

Conversation

stefanbuck
Copy link
Member

First attempt to tweak the app notification to become less intrusive. This toast message appears in the bottom left corner and therefore doesn't cause the page jump when showing the notification.

Screenshots

Screenshot 2020-07-13 at 23 03 58

Screenshot 2020-07-13 at 23 15 27

Screenshot 2020-07-13 at 23 14 48

@RyanCopley
Copy link

I like this approach much better. Thank you for taking time out of your schedule to put this together.

@stefanbuck stefanbuck requested a review from xt0rted July 16, 2020 21:18
Copy link
Member

@xt0rted xt0rted left a comment

Choose a reason for hiding this comment

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

I prefer the original alert style since it matches the rest of the site but overall this looks good. Is there a way to work the logo into this design too?

I'm not sure if this is by design but clicking anywhere on the toast closes it, not just the X button.

The changes also look to play well with GitHub Dark. The warning style needs the icon color changes, but I can fix that in GitHub Dark once this is merged.

image

image

@xt0rted xt0rted mentioned this pull request Jul 20, 2020
2 tasks
@xt0rted
Copy link
Member

xt0rted commented Jul 20, 2020

Looks like I was wrong, the toast design does come from github. Now if I could only get the site to show me one.

@stefanbuck
Copy link
Member Author

It's part of the notification page when clicking the "Mark as done" button

Large GIF (888x470)

@stefanbuck
Copy link
Member Author

I'm not sure if this is by design but clicking anywhere on the toast closes it, not just the X button.

This maybe caused by the click listener which is supposed to close the toast when following a link from there. I'll look into it.

@stefanbuck
Copy link
Member Author

@xt0rted I pushed a single fixup commit with a bunch improvements.

  • No global click listener anymore
    • Does not close the toast message when clicking anywhere on the toast
    • Custom behaviour like opening the settings page is handled with a new clickHandler prop
  • Using the x icon to close API related messages, does set a timestamp to prevent messages from appearing all the time.
  • Inline release notes to avoid unnecessary use of API calls.
  • Make use of the webextension-polyfill where chrome. was still used
  • Added OctoLinker mascot to the notification

Screenshot 2020-08-02 at 00 10 41

@RyanCopley
Copy link

That logo addition is adorable.

Copy link
Member

@xt0rted xt0rted left a comment

Choose a reason for hiding this comment

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

Loving the mascot addition. The toasts are still closing for me no matter where I click on them.

It looks good with GitHub Dark enabled too. The warning style colors were fixed over there recently as well.

image

image

packages/user-interface/style.css Outdated Show resolved Hide resolved
packages/user-interface/index.js Outdated Show resolved Hide resolved
}
}
});
const releaseDescription = 'Test';
Copy link
Member

Choose a reason for hiding this comment

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

Every time the new version notification shows it's prefixed with Test - as you can see in my previous screen shots. Should this be changed/removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea was rather than to make an API call to bake the release description into the release version itself. Obviously this requires updating this string, which can slip through easily. Let me see if I can find a way to fail the build in such a case.

@xt0rted
Copy link
Member

xt0rted commented Aug 6, 2020

This looks good now, only the close button or a link in the toast closes it. I think the new version message needs to be adjusted before this can be merged though.

@stefanbuck
Copy link
Member Author

I think the new version message needs to be adjusted before this can be merged though.

True, will update the message before releasing a new version

@stefanbuck stefanbuck merged commit a9c7c1d into OctoLinker:master Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants