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

Enable page & post creation via the "Add Link" interface #26317

Closed
Tracked by #35073
mrfoxtalbot opened this issue Oct 20, 2020 · 13 comments · Fixed by #35083
Closed
Tracked by #35073

Enable page & post creation via the "Add Link" interface #26317

mrfoxtalbot opened this issue Oct 20, 2020 · 13 comments · Fixed by #35083
Assignees
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Status] In Progress Tracking issues with work in progress [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@mrfoxtalbot
Copy link

mrfoxtalbot commented Oct 20, 2020

When setting up a site from scratch, users will update the links in their homepage and will often need to add links to pages or posts that do not exist yet. Wrapping one's head around how this works can be a source confusion and, even if you understand how it works, it will break your workflow.

My suggestion would be to let users create a new page or post the moment they are adding the link, here:
Screen Shot on 2020-10-20 at 16:38:04

This follows the same logic of the feature we have on Homepage Settings and Menus to create a new page "on the fly".

Screen Shot on 2020-10-20 at 16:41:33

Screen Shot on 2020-10-20 at 16:41:05

@mtias
Copy link
Member

mtias commented Oct 20, 2020

This is already supported in the Link UI, but it's not enabled for inline links. It works in the navigation block, for example.

image

@mtias mtias added [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Enhancement A suggestion for improvement. labels Oct 20, 2020
@mtias
Copy link
Member

mtias commented Oct 20, 2020

@shaunandrews noticed that we don't show the "create page" suggestion until the searching is finished, which seems backwards. Do you remember if that was an oversight or intended to function that way?

@pauljacobson
Copy link

pauljacobson commented Oct 20, 2020

@mtias I didn't see that option pop-up for a Buttons Block in testing with a user recently. I just tried this on a WordPress.com site, and I don't see the prompt to create a page:

Markup on 2020-10-20 at 17:58:51

So we don't seem to have a consistent option for this where there are opportunities to add links.

@mtias
Copy link
Member

mtias commented Oct 21, 2020

@pauljacobson that's what I meant with "but it's not enabled for inline links". It's only toggled on for the navigation block.

@mrfoxtalbot
Copy link
Author

Thank you for clarifying @mtias, I am looking forward to seeing this feature added to inline links :)

@mtias
Copy link
Member

mtias commented Oct 21, 2020

I agree, the Button is an excellent use case as well :)

@mtias mtias added the Needs Dev Ready for, and needs developer efforts label Oct 21, 2020
@shaunandrews
Copy link
Contributor

image

I don't recall why an "new page" options was exposed by default. We definitely explored the design for it. I guess I'd label it as an oversight. I see #26351 was recently created to address the visuals of the Link UI, which has lagged behind the rest of the editor and the G2 updates.

@mrfoxtalbot
Copy link
Author

Given that the Nav Block is now much more mature, I'm wondering if we could revisit this to enable this option on inline links too.

Screen Shot on 2021-07-07 at 08:35:57

Thank you :)

@mtias mtias added [Type] Task Issues or PRs that have been broken down into an individual action to take and removed [Type] Enhancement A suggestion for improvement. labels Jul 12, 2021
@javierarce
Copy link
Contributor

javierarce commented Jul 14, 2021

I'd like to point out some things I've seen in this component. I can move this list to a new issue if that's more useful:

  • The minimum amount of characters we require to create a new page or link is two, which means users can't create pages with just one letter. I'm not sure if there's a reason for that or it's an oversight.
  • We always show the interface to create links even if users don't provide a TLD or begin their strings with http or www. The only exception is when they introduce spaces in the string. Maybe we should try to improve the URL matcher, so we don't show the prompt to create a new URL if the text is not clearly a URL.
  • Small detail: if a user writes down an anchor, we label the item as internal but keep saying Press ENTER to add this link. I think it would be nicer to also say Press ENTER to add this anchor.
  • The plus sign and the "Create draft page" text are not vertically aligned:

image

  • I also think we could increase the size of the icons and adjust their left alignment:

image

  • There's a funny bug: the icons shrink when the user types a very long string.

coffee

@mtias
Copy link
Member

mtias commented Jul 14, 2021

We should also probably use a document icon for the new page, not the + which in the context of all the pluses used for inserters can get confusing.

@javierarce
Copy link
Contributor

True.

We should also probably use a document icon for the new page, not the + which in the context of all the pluses used for inserters can get confusing.

PS: Even though it's tangentially related to this issue, the design for the UI of this component can be found in this Figma file. I'll probably rename the file to include future design explorations.

@getdave
Copy link
Contributor

getdave commented Sep 23, 2021

Ok so I took a quick look into the complexities of achieving this.

Unfortunately the inline links are handled by the @wordpress/format-library package. This is WordPress Core agnostic so it cannot have dependencies on things like @wordpress/core-data which is what we use in the Nav Link block to create posts/pages on the fly.

Therefore, we're going to have to do some juggling and allow block editors to expose their own "create entity" function on the editor settings (much as we do with fetchLinkSuggestions). That way the edit post package can provide a function to allow creation of links which utilises the Core Data APIs without forcing the format library to have a dependency on the Core Data package itself.

So basically....it's more complex than I first thought...

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 23, 2021
@getdave getdave removed the Needs Dev Ready for, and needs developer efforts label Sep 23, 2021
@mrfoxtalbot
Copy link
Author

I wanted to note that it is now possible to create a new page while editing a post or page…

Kapture 2022-02-03 at 10 34 23

...but that this functionality does not seem to be available in the site editor on FSE:

Screen Shot on 2022-02-03 at 10:36:18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Status] In Progress Tracking issues with work in progress [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants