-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
SF-3212 Create 'unknown' blot as fallback blot #3052
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3052 +/- ##
==========================================
- Coverage 82.72% 82.71% -0.02%
==========================================
Files 563 563
Lines 32653 32669 +16
Branches 5282 5284 +2
==========================================
+ Hits 27012 27021 +9
- Misses 4862 4868 +6
- Partials 779 780 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I haven't done a full review yet, but I think it's less than ideal to utilize the generic exception dialog for this, since that's typically reserved for errors that aren't handled, as a last resort. Per the JIRA description, we want to be notified of new blots that we need to support; however, we can be a little more elegant than the last-resort exception dialog. You could:
I'd think the former, since a dialog or even an error notice showing every single time would get pretty old pretty fast to users. What do you think? |
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.
Yes, I think you are right. The error dialog does get old fast. The idea was to alert (still rendering the text) so that the missing blot could be remedied, but perhaps the visual presence in the text is sufficient (along with logging to the console).
Reviewable status: 0 of 4 files reviewed, all discussions resolved (waiting on @josephmyers)
1526ac2
to
0016b29
Compare
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.
Thanks. I've tested this with resources and projects, and it seems to handle things as expected. Awesome!
Reviewed 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @siltomato)
0016b29
to
5abc7cc
Compare
This PR creates a custom
ScrollBlot
to override Quill's scroll blot and anUnknownBlot
to render when an unknown blot type is attempted.If an unknown blot type creation is attempted, the custom
ScrollBlot
catches the error and creates theUnknownBlot
. After the editor renders (viasetTimeout()
), an error is thrown displaying the name of the failed attempted blot.UnknownBlot
usestagName = 'sf-unknown'
, ('span' was causing it to be incorrectly matched from a quill registry query and throw anafter.appendChild not a function
error).You can test this blot by adding TNN as a resource.
Example:

This change is