-
Notifications
You must be signed in to change notification settings - Fork 22
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
Replace content script notifications #2102
Conversation
src/contentScript/notify.tsx
Outdated
} | ||
|
||
document.body.append(root); | ||
render(<Toaster />, root); |
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.
I think isolating these would only take:
- add shadow DOM to avoid inheriting styles
- that's it
I doubt it uses any rem
and if it does we can override them via inline styles.
I just need some sites to test this on.
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.
Let me see if I can put together a list of public-ish places we've had issues. The icon alignment issue for the old library occurred across a number of sites
- LinkedIn uses rem
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.
LinkedIn:
Screen.Recording.1.mov
LinkedIn uses rem
Whether the host page uses them doesn't affect us, it's all good as long as we don't use rem.
The good part of hot-toast is that it only uses div and generated classes, so chances of conflict are slim:
Should we encounter issues, then yes, we can just wrap it in a shadow DOM in 2 lines. However it currently does not support it:
Nice! Didn't know the Initially I thought keeping in the upper right would be good for consistency with our current ones. But then I realized that our current ones have an issue where they're hidden by the sidebar What is the z-index of these alerts? In the old code we forced it to the max: http://github.com/pixiebrix/pixiebrix-extension/blob/cbd8d906edcdde1e6b9d27b79b7ae4d31a873716/src/styles.css#L18-L18
|
During QA I noticed the first notification isn't show? https://www.loom.com/share/233b31fe3be1493aa2a747993be18223
|
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.
See notes
Good catch! I guess that's because React’s rendering is async so calling I fixed this by always adding this root to the document instead of just in time. Questions:
|
new.style.mov |
For now this PR only replaces$.notify
to improve the style and prepare them to be wrapped in a single shadowed container. It can already be merged, probably, and I'll build on this.Since the module only uses inline style, the shadow DOM isn't necessary to avoid leaks. Maybe the
all
property avoids incorrect settings. However I don't know which sites you found issues on.Demo
You can see the notification under the modal because I had enabled "notifyProgress" in
reducePipeline
Screen.Recording.7.mov