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

Editor: Preview embed when editing URL #18171

Merged
merged 20 commits into from
Dec 19, 2017
Merged

Editor: Preview embed when editing URL #18171

merged 20 commits into from
Dec 19, 2017

Conversation

iandunn
Copy link
Contributor

@iandunn iandunn commented Sep 22, 2017

This is an iteration on #17152. It adds a preview of the new embed, in order to fully implement the design in #1729.

Before

screen shot 2017-10-10 at 7 45 12 am

After

screen shot 2017-10-10 at 7 43 27 am

See #1729

@iandunn iandunn added [Feature] Post/Page Editor The editor for editing posts and pages. [Status] In Progress labels Sep 22, 2017
@iandunn iandunn self-assigned this Sep 22, 2017
@matticbot
Copy link
Contributor

@iandunn
Copy link
Contributor Author

iandunn commented Oct 12, 2017

@bisko, if you have time to take a look, the main thing I'm stuck on is https://github.com/Automattic/wp-calypso/pull/18171/files#diff-84faf6cda9cb8b4bb7b5f7eec3bfb2c1R62

Thanks!

@iandunn
Copy link
Contributor Author

iandunn commented Oct 19, 2017

Thanks for taking this over @bisko :)

I cleaned things up a bit and force-pushed my local branch.

I didn't squash the "direct api call" commit yet, just in case it's useful to see what the approach was before that. I was planning to squash it before merging, though.

Other than that, I think it's ready to hand off. Let me know if you have any questions or any of my notes aren't clear, though. Thanks again!

@iandunn
Copy link
Contributor Author

iandunn commented Oct 19, 2017

Oh, also, don't worry about making the audio shortcode work, since that's probably out of scope and can be done in #1732.

@iandunn iandunn removed their assignment Oct 19, 2017
@bisko bisko force-pushed the add/preview-embed-dialog branch 3 times, most recently from 7352b27 to b6bcc5e Compare November 6, 2017 09:06
@jblz jblz self-assigned this Nov 16, 2017
@bisko bisko added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Dec 13, 2017
Copy link
Member

@jblz jblz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! This is working pretty well.

A couple of things:
Can you please rebase so we can make sure the interaction with the editor redesign is solid?

Also, I'm noticing a bug w/ youtube & cache hits.

To repro:

  • embed a youtube URL
  • Edit the video id argument to a non-existing one (deleting a letter usually works)
  • Wait for the load... it shows a "blank" placeholder youtube video (which seems like a bug as well)
  • Restore the original video id argument

I expected the embedded video to be corrected, but the placeholder remains.

Screencap: https://cloudup.com/c1LfECyt_DH

/**
* Prepare the markup for the new embed URL
*
* @todo: Making an API request directly is a bit of a hack. The ideal solution would be to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the description of the tradeoffs made here and rationale. Thanks for including it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @iandunn ^ 🙇 Thanks for adding that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'm glad that was helpful :)

@bisko
Copy link
Contributor

bisko commented Dec 15, 2017

@jblz PR rebased and fixed the issue you mentioned. Now it should properly load cached results.

Copy link
Member

@jblz jblz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working really well. Tested w/ various youtube, instagram, etc. embeds and all work well with the preview.

Let's go ahead and merge this and come back w/ follow-ups to:

  • disconnect the example component from the state tree
  • add an entry to the "Add" Editor feature screen shot 2017-12-18 at 12 40 15 pm

connectedEmbedDialogExample.displayName = 'EmbedDialogExample';

// todo
// connecting this component feels wrong. it's an example, so shouldn't it instantiate EmbedDialog with renderWithReduxStore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree here. Are we just providing the siteId here because it's required by some child component or something? I don't think this is a blocker for this PR so we can get this launched, but I think we should do what it takes to disconnect this example from the state tree in a follow-up.

@jblz jblz added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 18, 2017
@bisko bisko merged commit 1807188 into master Dec 19, 2017
@bisko bisko deleted the add/preview-embed-dialog branch December 19, 2017 17:53
@iandunn
Copy link
Contributor Author

iandunn commented Dec 19, 2017

🎉

Kudos for seeing this through to the end :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants