Show something when embedding something non-previewable #8435
Labels
domain:ui/ux
This issue reports a problem related to UI or UX.
package:html-embed
type:improvement
This issue reports a possible enhancement of an existing feature.
Milestone
π Provide a description of the improvement
It currently looks like this:
The problem is not that it's not clear that this is an HTML snippet, but rather β what snippet this is. If you have a couple of them in the content, you may not understand which is which or if they are filled already or not.
Therefore, some way to identify what's inside would be good.
Option 1. Show non-editable source
We could simply show a disabled textarea with the source of the embed, just like in the case of when previews are completely disabled.
However, how can we detect that a preview is not available?
One option is, of course, that when the sanitizer stripped everything, we know that the thing is non-previewable. But what if just one part of the input was removed and it makes the preview non-existent?
The other option is to make this check after rendering the preview. If it is
0px
high, we can tell that the preview didn't render. However, this will be slow and may cause layout trashing so if we go this way we must be smart.Related ticket (in this option): #8326.
Option 2. Add a "title" field
The other option would be to add a field for a snippet's title and display it e.g. in the "HTML snippet: <title>" place.
The title could be stored in
data-title
and we wouldn't have to do anything more β if the preview doesn't render, the user still sees something. We don't have to even detect these situations.My biggest concern is that the title will leak to data, but I'd be fine with that as it's kind of a "label/caption" like thing.
If you'd like to see this improvement implemented, add a π reaction to this post.
The text was updated successfully, but these errors were encountered: