Skip to content
Stacklumen is now a solutions companySee the list here

How to edit a Code site on the canvas in StackIDE

StackIDE can turn a Code site's running page into a canvas: click an element, change it, and the change is written to the file where it lives. Here is how to use it and ship the result.

Blog card: a Code site running in StackIDE's preview with Edit on and its heading selected, the canvas panel showing the file and line, text, classes and type, and the source file with that line changed.
On this page
  1. Open a Code site on the canvas
  2. Select and change elements on the page
  3. Use the panel beside the page
  4. What the canvas will and will not change
  5. Ship the change
  6. Good to know
  7. Sources

StackIDE, the Stacklumen desktop app for Mac, can turn a running page into a canvas. You click an element, change its text, classes, attributes or type, and StackIDE writes each change into the file where that element is written. This guide covers how to open a Code site on the canvas, what you can change, and how the change reaches your live site.

The canvas works on Code sites (sites whose GitHub repository is the site) and on StackIDE Cloud apps. It reads Astro, React on Vite, Next (with webpack or Turbopack) and plain HTML.

Open a Code site on the canvas

  1. Open the site. In StackIDE, a Code site's overview has Open in StackIDE.
  2. Clone it. The first time, StackIDE asks before it runs the repository's code on your computer. It then clones the site's branch to ~/Stacklumen/<repository>, using your own git sign-in.
  3. Start editing. The site's dev server starts, and its preview opens as <site> · Canvas with Edit already on.

In any preview, you can also turn the canvas on and off with Edit (⇧⌘E), next to Inspect. A plain HTML Code site, one with no package.json, runs on StackIDE's own local server, which only your computer can reach.

Select and change elements on the page

While Edit is on, links and forms on the page do not act, so a click only selects. The keys:

  • Click selects an element.
  • Double-click or ↵ edits its text in place. ↵ keeps the change and Esc puts it back.
  • Arrow keys select the element around it, its first element, or the one before or after it.
  • ⌫ removes it, and ⌘D duplicates it.
  • ⌥↑ and ⌥↓ move it up or down among the elements beside it.
  • ⌘Z and ⇧⌘Z undo and redo the canvas's own changes.
  • Esc clears the selection. Press it again to leave Edit.

Use the panel beside the page

The panel shows where the selected element is written and what you can change:

  • Element gives the file and line. Choose it to open the file at that line.
  • Text holds its text, which is kept on ↵ or when you leave the field.
  • Classes lists the classes written on it. You can remove each one, or use Add classes.
  • Attributes lets you change, remove or add attributes.
  • Type changes the element itself, for example a div into a section, or a span into a strong.
  • Structure has Move up, Move down, Duplicate and Remove.
  • Add an element inserts a section, box, heading, paragraph, link, button, image or list Before, After, First inside or Last inside the selected element.

After each change, the dev server's own reload redraws the page, and the canvas selects the element where it is now written.

What the canvas will and will not change

The canvas edits what is written in your files. It does not overwrite code:

  • Text from a variable, classes from a condition or an attribute from props are shown with the code that computes them, and never overwritten.
  • An element drawn once per item of a list carries a warning that a change reaches every item.
  • A change a browser would read differently from how it is written, such as a block inside a paragraph, a link inside a link or a row outside its table, is refused with a sentence saying why.
  • When more than one element in the file looks like the one you chose, the panel says so rather than guess. Open the file to be sure which one changes.

If the file is open in an editor tab, the change goes into that tab's text as one step of its own undo, and is saved. If no tab has it open, the file is written on disk with its own line endings.

Ship the change

The canvas changes files on your computer only. To put the change live, commit and push with your own git, from StackIDE's Code section, a terminal or an agent working in one. StackIDE Cloud deploys what lands on the site's branch. Stacklumen never commits or pushes for you, and your commits are made under your own git name.

To have a change reviewed first, push it to a branch of its own and open a pull request on GitHub. Cloud builds the pull request a preview, and merging it on GitHub deploys it.

Good to know

  • Edit works on pages served by a dev server on your computer, as Inspect does. A Design site opens in Sites instead, and StackIDE says so.
  • Inspect (⇧⌘C) is the read-only partner: click anything on the page to open the line of source behind it. It reads what Astro, Svelte, React and Vue dev builds already mark.
  • A Cloud app's preview runs the app's own code, so it is kept apart: it has its own session with none of Stacklumen's cookies, no permissions, and access only to addresses on your own computer. A link anywhere else opens in your browser.

Sources

New posts by email

Product updates and field notes from Stacklumen, in one email a day or one a week.

How often