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

Option to use text link instead of auto embed. #15102

Closed
paaljoachim opened this issue Apr 22, 2019 · 17 comments · Fixed by #17413
Closed

Option to use text link instead of auto embed. #15102

paaljoachim opened this issue Apr 22, 2019 · 17 comments · Fixed by #17413
Labels
[Block] Embed Affects the Embed Block Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@paaljoachim
Copy link
Contributor

paaljoachim commented Apr 22, 2019

Is your feature request related to a problem? Please describe.
Adding links. If an link goes to another WordPress site we will see an auto embed such as this:

Screen Shot 2019-04-22 at 11 12 35

A mix of auto embeds and text links.

Screen Shot 2019-04-22 at 11 22 24

Describe the solution you'd like
I would like the option to include an auto embed OR a text link. As some links above are automatically embedded showing an article preview while other links just show a text link.

Describe alternatives you've considered
I added the following code from my tutorial here:
https://easywebdesigntutorials.com/adjusting-the-auto-embeds-of-wordpress-site-links-on-your-site/

By adding code from the above tutorial it forces the link dialog box to open for the links that were auto embedded. I can then select to convert the auto embeds to regular text links. One should not need to add the code to turn off auto embeds.
Screen Shot 2019-04-22 at 11 39 36

@paaljoachim paaljoachim changed the title Add option to link embed to use or not use auto embed Option to use text link instead of auto embed. Apr 22, 2019
@youknowriad
Copy link
Contributor

Thanks for opening the issue, this was discussed during the triage session today https://wordpress.slack.com/archives/C02QB2JS7/p1555939888308300

Based on these discussions, we propose to add a block transform to transform embed blocks to paragraph blocks but we should create <a> tags as content of the paragraph blocks to avoid the auto-embed to trigger in the frontend.

@youknowriad youknowriad added [Block] Embed Affects the Embed Block [Type] Enhancement A suggestion for improvement. Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Apr 22, 2019
@paaljoachim
Copy link
Contributor Author

Hello Jorge. @jorgefilipecosta
Would this issue be something that you might be able to tackle?

Adding a link should have consistency. When a link is suddenly embedded and looks different then other links then that can create frustration.

When a link wants to embed itself so that it shows different then a standard text link then the default placeholder box should show up asking if one wants to embed the link.

I will also add in some design folks.
@mapk @kjellr

@kjellr
Copy link
Contributor

kjellr commented Sep 9, 2019

The paste-a-link-to-embed functionality here is the same as other embed blocks, so I think the block transform to paragraph makes sense as a first step here.

@mcsf
Copy link
Contributor

mcsf commented Sep 23, 2019

With #14776, the Undo action can now be used to cancel an automated transform (e.g. when a user types ## at the beginning of a line, Undo can now cancel the automatic conversion to a Heading block).

This leads me to ask: in this issue, instead of adding explicit transforms, shouldn't we extend this UX pattern so that Undo can also "revert" the addition of an embed and just leave the untouched URL? /cc @ellatrix

@kjellr
Copy link
Contributor

kjellr commented Sep 27, 2019

shouldn't we extend this UX pattern so that Undo can also "revert" the addition of an embed and just leave the untouched URL?

That sounds reasonable. I'm not sure how discoverable it will be, but I do think it makes senses to do.

@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label Oct 21, 2019
@gziolo
Copy link
Member

gziolo commented Nov 20, 2019

@gziolo
Copy link
Member

gziolo commented Nov 20, 2019

Cross-posting the content from a duplicated issue #16159:

Is your feature request related to a problem? Please describe.

I often will paste a URL into the editor while I'm working on a draft for a post. My intent is not to create an embed, but just to save that URL in my notes so that I can later use it as a link in a paragraph.

When I paste it in, though, it automatically gets turned into an embed, even if the oEmbed process fails (which seems to be at least half the time for WP posts). There's no way to transform it back to the raw URL, so I have to right-click to copy the url, then remove the Embed block, then add some arbitrary character to the start of a new line, then paste the link again (because the link is only transformed when it's on a line by itself).

I could avoid that by adding that arbitrary character before I paste the link in the first place, but I always forget to do that, because I naturally don't expect the editor to do something contrary to my intent, even though I've known about the automatic oEmbed feature forever, and even agree that it's very useful when I'm intending to embed something. The problem is that, when I'm pasting in a URL, my intent is to save it as a note much more often than when my intent is to embed it.

Describe the solution you'd like

I don't know if there's a way to solve the underlying problem (the editor incorrectly assumes that my intent is always to create an embed), but we could at least provide an easy way to recover from that, by having a toolbar button to transform embeds to their raw URL, similar to how you can transform a paragraph to a heading.

@paaljoachim
Copy link
Contributor Author

@mcsf
Copy link
Contributor

mcsf commented Jan 13, 2020

That sounds reasonable. I'm not sure how discoverable it will be, but I do think it makes senses to do.

Could we combine the undo behaviour with a timely snackbar notice? "So and so happened. Press Meta + Z to Undo."

@paaljoachim
Copy link
Contributor Author

It would be great with some feedback on this issue, so we can move it onward in finding a good solution.

@paaljoachim
Copy link
Contributor Author

I went and made a bug report showing how embedding works in Gutenberg 7.7.1:
#21029
Suggesting an easy fix.

@desaiuditd
Copy link
Member

I've updated #17413. It may solve this issue.

@Ipstenu
Copy link
Contributor

Ipstenu commented Apr 17, 2020

A snackbar notice is going to be easily missed until/unless everyone is 'trained' to know that's where to look for messages. Also 'undo' implies that the user did something wrong, which is not the case here. In this case, a better idea would be to have a 'hoverable' action.

For example, on Helpscout, if I paste in a link it automatically makes a link. If I hover over it, it lets me chose 'edit' or 'unlink' -- this tells me

  1. The default is to link
  2. I can change this by direct action

That makes it more clear to everyone that it's not 'wrong' (which is what undo implies) but just a choice.

@mcsf
Copy link
Contributor

mcsf commented Apr 17, 2020

Thanks for weighing in.

A snackbar notice is going to be easily missed until/unless everyone is 'trained' to know that's where to look for messages.

I agree that there is an important drawback there. That kind of interaction is foreign to WordPress.

However, it's still noteworthy that many important applications out there are using this model: Gmail allows undoing deletions and other motions via identical "snack bars"; Slack now notifies the user after markdown-style content is pasted, offering to convert it to rich text.

This doesn't mean WordPress needs to follow suit, but they are relevant examples.

Also 'undo' implies that the user did something wrong

This one I'd argue against, for two main reasons:

  • This has been a behaviour in the block editor for a while, especially in automatic text transformations (e.g. type - in a new line and you'll get a fresh List block, but undoing will result in a Paragraph that opens with a literal hyphen).
  • It's the same model as in the "standard" word processor model (MS Word and the like), where any automatic transformation can be undone after the fact. This is important to mention, because this word processor model is often cited as an example of what the established practice — and thus the common user's expectation — is. Again, this isn't a sufficient argument, but it should inform how we think about the block editor.

@mcsf
Copy link
Contributor

mcsf commented Apr 17, 2020

For example, on Helpscout, if I paste in a link it automatically makes a link. If I hover over it, it lets me chose 'edit' or 'unlink' -- this tells me

If it requires hovering, what makes this feature discoverable? Could we apply that to Gutenberg?

@Ipstenu
Copy link
Contributor

Ipstenu commented Apr 19, 2020

Oh I promise you, having ‘undo’ work like it does has resulted in a lot of “what did I do wrong/bad!?” from users

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Apr 20, 2020

So the process should be...

EDIT:
Link -> Can it embed? -> If yes (and does it create a WordPress embed?) -> Add a placeholder asking if the user wants to embed or convert to text link.
Link -> Can it embed? -> If no -> Automatically add a text link.

Reasons: The user is in control of how a link is seen on the backend and frontend.
#17413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Embed Affects the Embed Block Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants