-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Enhance link control UI with rich URL previews #31464
Conversation
Size Change: +1.31 kB (0%) Total Size: 1.03 MB
ℹ️ View Unchanged
|
4b6bd40
to
dbf8961
Compare
cc @javierarce as you don't seem to be a member of this repo. |
2f03581
to
dff46e3
Compare
This works really nice! Some things I've noticed:
I also saw some a couple of bugs: The height of the popover should hug the content:The icon is on top of the text (although this could be solved if we get rid of the icon) |
@javierarce Thanks! 👍 I've made changes as per your feedback and updated the screenshot in the PR description. Let me know how this looks to you now. Some notes from me:
Now capped to 2 lines using our new
I've constrained the image to 140px which is as per the Figma. I will say I think it's too small as most images now cannot fill the space and we see a lot of gray background.
👍 Added to the background color.
Removed.
I wasn't sure what you mean there.
The icon is currently 16x16. Why? Because the favicon we get back from most remote sites is 32x32 and low quality. By scaling down by 50% it gives the illusion of better quality. As it's smaller I've made it align with the top of the text as that seemed to look better. Do you agree? @hellofromtonya perhaps in future we can look to parse an |
2207119
to
a07758d
Compare
0b850b8
to
3f3d200
Compare
Ok, I think
Once merged we can followup with the addition of |
3f3d200
to
ebb9346
Compare
I think this looks and works nice, but I think we should address the hiding of the placeholders at some point, that would make this look really great. |
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.
Looking good! Let's address other issues in follow-up PRs 👍
packages/block-editor/src/components/link-control/make-cancelable.js
Outdated
Show resolved
Hide resolved
packages/core-data/src/fetch/__experimental-fetch-remote-url-data.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Kai Hao <[email protected]>
@javierarce and I discussed this and we'll continue all further UI enhancements in follow-up Issues. |
For the future, it would be cool if we try to limit the use of snapshots in tests (specially big ones). These tests are harder to debug and change to often when implementation details do. |
@youknowriad I strongly agree with this. Snapshots have their advantages, but often times we were overusing them. A rule of thumb of mine is that if the snapshot doesn't look good when inlining them in the test ( I believe we haven't really reached a consensus about this though, it's still being mentioned/recommended in our doc for testing. It would be good if we can start a new issue, reach a consensus about snapshot testing in general, and update the doc. |
Extraordinary work here @getdave ! For me this is a feature which although contained by a small box and only visible on links, it makes the whole experience immensely up to date: rich previews is the expected interaction in a software landscape focused more and more on refined interactions that confirm expected outcomes. 🎉 👏🏻 |
Description
Please note: currently the rich previews are only enabled within the post editor and only then within the format library implementation which is utilised by blocks such as
core/paragraph
. This intentional, in order to limit the surface area exposure to the change and allow it to "bed" in. We will enable across other areas of the editor in future subject to it working well where it is currently.Building on #18042 and #31085, this PR wires things together to allow meta data about direct entry URLs (eg:
www.wordpress.org
) to be shown in the<LinkControl>
UI (the UI that is used to add hyperlinks in Gutenberg).This currently works in the Post Editor richtext only. It will not work (yet!) in
Closes #31466
How has this been tested?
Manual testing and component tests have been completed or added.
To manually test you should:
Screenshots
Screen.Capture.on.2021-06-09.at.16-27-52.mov
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).