Overview

We currently prevent interaction with the preview to allow dragging and dropping components to work smoothly. (Imagine trying to drag a range slider but accidentally picking up and dragging the component that renders it).

To achieve this, the overlay component sits on top of the iFrame and intercepts all mouse events and the iFrame itself has a tabindex of -1 to prevent navigating to elements inside it with the keyboard.

We want to allow users to use/interact with the page they are previewing.

Proposed resolution

As the first step, we need build a foundational UX and basic UI.

  1. Implement a UI switch between "preview" vs "editing" mode. (using React Router)
  2. When in "preview" mode hide the overlay elements and allow the iFrame to receive focus
  3. When in "preview" mode hide both sidebars
  4. When in "preview" alter or intercept all link clicks to ensure the user can't navigate away from the XB page.

In addition there is an MVP of the following:

  1. Add a keyboard shortcut, that when held, will enable "interactive" mode. ( currently it's holding the 'v' key). This is different from the Preview - in that it just hides the overlay and lets users interact with the iFrame. It's a bit buggy, but I'm leaving it in as it's a valuable dev tool (trying to use the browser dev tools to inspect the iFrame is currently really fiddly).

User interface changes

Entering Preview mode and moving between different preview widths

Clicking a link

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jessebaker created an issue. See original summary.

wim leers’s picture

OOOHHHHHHHHh!!!!!! 😄

A GIF/screencast of this would be lovely 😇 Because this sounds amazing! 😄

P.S.: this reminds me very much of #1874664: Introduce toolbar level "Edit" mode that shows all contextual links which I worked on almost exactly 11 years ago 😅🤓

jessebaker’s picture

Assigned: jessebaker » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new3.26 MB
new1002.05 KB
jessebaker’s picture

Issue summary: View changes
Issue tags: -Needs screenshots

longwave made their first commit to this issue’s fork.

hooroomoo made their first commit to this issue’s fork.

effulgentsia made their first commit to this issue’s fork.

effulgentsia’s picture

Status: Needs review » Fixed

This looks awesome! Merged to 0.x.

wim leers’s picture

🤩 YES! This is what we should've done in CKEditor 4+5 in Drupal core too! 👏

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.