Skip to content

Allow extending editor preview in more ways #65005

Open
@simison

Description

What problem does this address?

In #64644 we allowed extending the "preview dropdown" in a simple, fairly restrictive manner:

359590714-1330a6e3-f879-4a7b-8416-4d5abf436ba6

This is great for gathering feedback from real usage.

Extending the preview menu and canvas allow variety of publishing flows and tools, some examples:

  • Social media share previews
  • Previewing same content in different formats such as website, email, RSS, printed
  • Displaying with different membership or paid access restrictions/without
  • Dark mode for websites that implement it while editor stays light mode by default
  • Additional display sizes for more exotic targets such as televisions, watches
  • eBook previews
  • AMP format previews

An example of more complex preview capabilities from Substack done directly in the canvas:

Screen.Recording.2023-07-26.at.12.03.19.mov

Another simpler example from Jetpack Social, opening a modal for previewing:

Screenshot 2024-09-03 at 16 13 20

What is your proposed solution?

  • Allow extending pre-defined device sizes list
  • Allow extending preview dropdown menu with multi-selection items
  • Allow adding multiple sections to preview dropdown menu
  • Allow extending the editor canvas

Allow extending pre-defined device sizes list

Extending existing devices list is simplest step, as the API could be purely declarative (size, icon, label) and hook into existing functionality:

Screenshot 2024-09-03 at 16 16 37

Examples might be slideshow presentations, TV screens, watches and other more exotic devices. WP is used to build not just websites.

Allow extending preview dropdown menu with multi-selection items

Selections would work in conjunction with existing device-size selectors, and work well with allowing extending editor canvas:

In above scenario you can preview post as a "free" or "paid" subscriber in various device sizes.

Some concerns come from having multiple plugins extend the menu in their own way, and how the menu should then look like. Do we force each plugin onto their own sub-menu or section? Should selections from one plugin clear selections from others? What are the defaults? How do we allow branding show up?

Allow adding multiple sections to preview dropdown menu

Expanding on above example, one could also introduce multiple devices/platforms that are separate from device sizes, such as "email" and "website":

2256164379-57da36ab-9fc7-41a5-9f0f-f5b2f079752d

Allow extending the editor canvas

Screenshot 2024-09-03 at 16 08 19

Extending canvas could be done in multiple ways. We could allow:

  • completely replacing canvas with custom preview like custom built editor,
  • passing alternative styles like dark/light mode, print/TV/website/email
  • passing meta info to existing canvas (like free/paid) user

Allowing replacing the canvas brings up questions like do users expect to always be able edit what they see in the canvas, or can canvas work purely for "previewing" too?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    [Feature] ExtensibilityThe ability to extend blocks or the editing experience[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions