All docs pages: The live editor

The live editor

The live editor

In short

Changing a site usually means hunting for the template, block or field that made a part, editing it somewhere else, then reloading to see. The live editor shows your local site inside Wanigan, so you point at the part, change it on the page, and save it through the site itself once it looks right.

On this page

Why it exists

A Drupal or WordPress page does not say how it was made. To change one heading you find the template, block or field that printed it, change it in an admin form or a file, and reload to see whether it was the right one. An agent tells you what it changed in words, not on the page.

The live editor puts the page and what made it side by side, and nothing reaches the site until you say so.

What it is

  • The local site you already run (ddev, Lando, a dev server), in the project’s Live tab. Wanigan starts and changes nothing to show it.
  • Off until you switch it on, for Drupal, WordPress and other sites separately.
  • It follows the agents: when one edits a file, the page reloads and the parts that file made are outlined.
  • On Drupal and WordPress it names each part as the site does; with the site helper it also says what made each part and saves through the site’s own core.
The live editor on a Northstar product page, Studio design: the toolbar across the top, Structure with Layers on the left, the page in the middle with the title chosen, the Inspector on the right with Try a style open, and the status line at the bottom.. Current beta · demo
Wanigan’s live editor showing the Northstar demo shop’s Lakeside Enamel Mug page. A blue outline marks the product title, with a bar of actions above it. A tree of the page’s parts runs down the left, and the chosen part’s style controls fill a panel on the right.

The path of an edit

Every change takes the same path, and you take each step.

How an edit becomes realFive stages from left to right: the page, the design layer, Make real through the site’s own core, Verify, and Undo, which leads back to the layer. The page and the layer are Wanigan’s alone; only Make real writes to the site.Only in WaniganIn the siteback to the layer1 The pageType on apart, or trya style.2 The layerKept byWanigan,shown on thepage.3 Make realSaved throughthe site’sown core.4 VerifyRendered withand withoutthe layer.5 UndoTakes backthe newestchange.How an edit becomes realFive stages from left to right: the page, the design layer, Make real through the site’s own core, Verify, and Undo, which leads back to the layer. The page and the layer are Wanigan’s alone; only Make real writes to the site.keep itmake it realread backif it is wrongback to the layer1 The pageType on a part, or try a style.2 The layerKept by Wanigan, shown on the page.3 Make realSaved through the site’s own core.4 VerifyRendered with and without the layer.5 UndoTakes back the newest change.

How an edit becomes real

  1. The page. Select a part (P), then type on its words (E) or try a style. Each key or value shows on the page as you go.
  2. The layer. What you keep is held on Wanigan’s side, keyed to its part by what the site says it is, and shown again after every reload. Nothing is written to the site yet. If the part shows other words or is gone, the edit is set aside as orphaned, never put on whatever is there now.
  3. Make real. Words are saved through Drupal’s or WordPress’s own core, as the user you are logged in as, with a revision where the site keeps one. A style or a token is code, so it goes to an agent as a brief, on your click; once it is in the theme, Verify finds it there.
  4. Verify. The page is rendered with and without the layer at 390 and 1440 px and compared: the styles of what was edited, the pixels around it, then the rest of the page against how it was before.
  5. Undo. Undo takes back the newest add or discard, and Redo brings it back. An edit already in the site is never taken out of the layer.
  1. The page. Select a part, then type on its words or try a style; each key and value shows as you go.
  2. The design layer. What you keep waits in Wanigan’s layer, keyed to the part by what the site says it is, shown again after every reload. The site has nothing yet.
  3. Make real. Words are saved through Drupal’s or WordPress’s own core, as you, with a revision where the site keeps one. A style goes to an agent as a brief, on your click.
  4. Verify. The page is rendered with and without the layer at 390 and 1440 px, and compared.
  5. Undo. Undo takes back the newest add or discard; an edit already in the site is never taken out of the layer.

The layout

The page takes the most room, with one toolbar above it and panels that close.

The toolbar

ControlWhat it doesKey
The site menuLocal or a hosted environment, Compare, Site settings…On a Mac, ⇧C; on Windows and Linux, Shift+C compares
Back, Forward, ReloadThe page’s history
The addressOpens Go to: any page of the siteOn a Mac, ⇧Space; on Windows and Linux, Shift+Space
SelectSelect a part on the pageP
Type on the pageType on the chosen part’s wordsE
StyleTry a style on the chosen partNone
MoveMove the chosen partM
SnapA picture of the page to mark up for an agentOn a Mac, ⇧S; on Windows and Linux, Shift+S
RecordThe view, at most two minutesOn a Mac, ⇧R; on Windows and Linux, Shift+R
Speak a noteSpeak instead of typing; narrate a recordingOn a Mac, ⌘⇧M; on Windows and Linux, Ctrl+Shift+M
LensColour the page by owner, cache, cost, editable or changedOn a Mac, ⇧L; on Windows and Linux, Shift+L
WidthsPhone (390 px), tablet (768 px), full width1, 2, 3
The eyeThe page without the layer, to compare
The admin bars (☰)Hide the site’s own admin bars, so the page looks as a visitor sees it while you stay logged in; press again to show them
EditsThe design layer’s edits, with a count of draftsOn a Mac, ⇧E; on Windows and Linux, Shift+E
Make realMake this page’s drafts real, or verify them
MoreDrag handles, the default browser
How this worksThe path from page to site, with this project’s numbers

Around the page

  • Structure, on the left: Layers (the page’s parts, named as the site names them), Add (what the site can place, from its component library) and Pages (the site’s pages to walk).
  • The page, in the middle: the chosen part outlined in blue with its name, and its action bar above it (Style, Move, Take out, Ask an agent).
  • The Inspector, on the right: the chosen part’s Design, Made by and Data (more).
  • The dock, beneath: Code, Notes, Problems, Request and DevTools, opened from their tabs in the status line (Developer tools).
  • The status line: what just happened (“hero.twig changed: outlined the part of this page it makes.”) and the mode you are in, such as Selecting.
The Northstar product title chosen on the page: its blue outline, its name chip at the top left, and the action bar with Style, Move, Take out and Ask an agent above its right edge.. Current beta · demo
A close view of the product title, “Lakeside Enamel Mug in Forest Green”, above its price. A blue outline surrounds it, a blue label reading Title sits at its top left, and a floating bar above it holds four buttons: Style, Move, Take out and Ask an agent.

The page as visitors see it

You stay logged in to your site while you work, so its own admin bars sit over the page. One switch in the live view’s bar hides them: Drupal’s admin toolbar and sidebar, or WordPress’s admin bar, with the space each core makes for them taken back, so the page looks as a visitor sees it and you stay logged in. It needs no reload, and it stays as you set it for every site and page. A theme’s own room for an admin bar is the theme’s, and stays; other admin toolbars from contributed projects are not hidden.

Drupal’s own status messages (“Saved”, “You are logged in”) used to push the page down and come and go between renders. They are hidden in the view now, and Wanigan says them in a pop-up of its own at the top of the page that goes after a few seconds (a site’s error stays longer), and keeps them in the notification tray as “Drupal says: …”. Messages a script adds after the page has loaded are not read. WordPress prints none on a site’s pages.

What you can do

The keys

In depth

Following the agents

After an agent’s edit, the editor waits for the edits to stop, then reloads once: 400 ms after the last edit, 1.2 s for Sass or Less (the project’s watcher compiles first), 2.4 s for PHP (its opcode cache looks again only every couple of seconds). Changed stylesheets alone are swapped in place.

With Follow the agents’ edits off (Settings › Live view), an edit only says what changed.