Problem/Motivation

Having multiple Previews currently means that every call to update the src of the iFrame is made once per preview.

Steps to reproduce

Make a change to the layout and observe in the network tab there are multiple calls to /api/preview

Proposed resolution

At this point, inserting a component at a higher level that just deals with fetching the data from the back end seems the best solution. While there, much of the logic where we are injecting/binding events inside the iFrame can probably be tidied too.

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.

lauriii’s picture

Status: Active » Needs review
bnjmnm’s picture

Left some comments on the MR that are largely refactoring suggestions that I spotted while reviewing. In the early stages I think that type of feedback would just slow things down, but since this is part of an effort to make the UI codebase more approachable it's probably time to start doing a bit more of that.

  • jessebaker committed 29100956 on 0.x
    Issue #3456946 by jessebaker, bnjmnm: Refactor Preview.tsx React...
wim leers’s picture

  1. This was merged — why has this not been marked Fixed? 🤔
  2. Can we make it a rule that any issue/MR changing the UI must include at least one screenshot (preferably screencast/GIF) to make it easier to scan and follow along for those interested but not writing XB code? 🙏
wim leers’s picture

jessebaker’s picture

Status: Needs review » Fixed

Marking as Fixed.

As for screenshots - I like the idea of a screenshot being included so, agreed! In this case, though, the work was to refactor/re-architect some code but visually almost nothing changed.

wim leers’s picture

#8: RE: screenshots: 👍

wim leers’s picture

Assigned: jessebaker » Unassigned

Status: Fixed » Closed (fixed)

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