Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4fcad53
feat(desktop): the window shows as soon as the editor is ready, after…
nodemode-ai Nov 26, 2026
c8cfbc8
feat(import): a site import counts only files outside node_modules, _…
nodemode-ai Nov 26, 2026
2af6b88
feat(library): File > Import HTML files opens the file picker at once…
nodemode-ai Nov 26, 2026
b1ef7fa
feat(canvas): a page's script is one named thing: its block on the ca…
nodemode-ai Nov 26, 2026
36e33c6
feat(canvas): the mouse resting on a layer outlines its element on th…
nodemode-ai Nov 26, 2026
eae187c
i18n: the 41 new strings of 0.32.0 (Import HTML files, Page script, h…
nodemode-ai Nov 26, 2026
08a77c4
fix(import): a project's source is also recognised by build scripts u…
nodemode-ai Nov 26, 2026
4c00ff7
fix(library): a picked .html file is decoded as UTF-8 and then Window…
nodemode-ai Nov 26, 2026
561f748
test(import): the site import's kept-file count, the bounds checked b…
nodemode-ai Nov 26, 2026
608c62c
test(editor): which nodes are a page script and what the canvas and t…
nodemode-ai Nov 26, 2026
b3880e1
test(window): Import HTML files from the menu and the Start screen as…
nodemode-ai Nov 26, 2026
7796fe0
test(desktop): the start-up line names four times in milliseconds, a …
nodemode-ai Nov 26, 2026
c76f5e4
docs(changelog): 0.32.0, Import HTML files, the site import's countin…
nodemode-ai Nov 26, 2026
a2718e3
docs(hashout): frontend v0.32.0, the import view's shared picker, res…
nodemode-ai Nov 26, 2026
55b08f3
docs(hashout): backend v0.32.0, the kept-file count, the bounds befor…
nodemode-ai Nov 26, 2026
8e02ad1
docs(guide): the guide, manual, library reference, agent quickstart, …
nodemode-ai Nov 26, 2026
5a659ba
chore(release): bump version to 0.32.0
nodemode-ai Nov 26, 2026
9ae7c7c
fix(inspector): a click on the name of a Design field that has a valu…
nodemode-ai Nov 27, 2026
c85f68f
fix(stage): the selection path above the canvas is shown at every win…
nodemode-ai Nov 27, 2026
1db4846
feat(inspector): Design fields can carry a control beside their text …
nodemode-ai Nov 27, 2026
a0cba84
feat(inspector): Color and Background show a swatch that opens a colo…
nodemode-ai Nov 27, 2026
4a98d33
feat(inspector): Grid columns and Grid rows show a button with a draw…
nodemode-ai Nov 27, 2026
b5ea5a4
i18n: the 73 new strings of 0.33.0 (Design field controls, the color …
nodemode-ai Nov 27, 2026
7aa4f54
feat(inspector): the Background picker has a Gradient tab: linear or …
nodemode-ai Nov 27, 2026
3d21053
docs(hashout): frontend v0.33.0, the control contract and its slots, …
nodemode-ai Nov 27, 2026
8dbb317
docs(guide): the guide, manual, agent quickstart and wiki describe sl…
nodemode-ai Nov 27, 2026
c492ab2
fix(inspector): a stored value with a long run of numbers no longer s…
nodemode-ai Nov 27, 2026
e492fe5
test(editor): reading and stepping one number with its unit and the f…
nodemode-ai Nov 27, 2026
d578453
test(window): the Design field controls in the real window: typed val…
nodemode-ai Nov 27, 2026
f981f55
docs(changelog): 0.33.0, controls beside the Design fields, with the …
nodemode-ai Nov 27, 2026
4638f67
chore(release): bump version to 0.33.0
nodemode-ai Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/formweb-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license: Apache-2.0
compatibility: "Project skill for Claude Code and other clients with the FormWeb MCP server connected. Requires a running local FormWeb FastAPI service and explicit Agents enablement."
metadata:
author: "nodemode-ai"
version: "0.31.2"
version: "0.33.0"
---

# FormWeb Harness
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formweb-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license: Apache-2.0
compatibility: "Project skill for Claude Code and other clients with the FormWeb MCP server connected. Requires a running local FormWeb FastAPI service and explicit Agents enablement."
metadata:
author: "nodemode-ai"
version: "0.31.2"
version: "0.33.0"
---

# FormWeb Harness
Expand Down
8 changes: 8 additions & 0 deletions .docs/wiki/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ New features are modules at the existing layer seams. Read `frontend/HASHOUT_LOG

**Layout grid (0.31.1, issue #36 "snap and grid").** The snap and grid of a structured layout, never a pixel grid: nothing here writes offsets, and nothing relates to breakpoints or the canvas width (see CLAUDE.md). `features/layout-grid.ts` holds the pure geometry, unit-tested in `tests/unit/canvas/`: `slotsOf(kids, flow)` gives one slot per landing place (before the first child, between each two at the middle of the gap, after the last), each with one line, or two where the flow wraps (after the last box of one line and before the first of the next); `nearestSlot` and `lineDistance` pick the slot whose line is nearest the pointer, so a container that takes the element has no dead zone; `trackSizes` and `gridCells` turn a computed `grid-template-columns`/`rows` and the gaps into cells from the content box; `alignOf` reads `align-items` (`justify-items` for a one-column grid; block flow is start) and `alignGuides` draws an edge only when every neighbour shares it within 1 px; `spacing` draws the container's `gap` (flex or grid) or the neighbours' facing margins (block) from each neighbour towards the slot, at a quarter and three quarters across them so the two never overlap; `landing` words the target as "Before {0}", "Inside {0}, at the end" or "Inside {0}". In `canvas-drag.ts`, `Lanes` measures a container's children and slots once per container per drag (cleared when the canvas document scrolls), `findDrop` takes the drag's `Lanes` and returns the spot with its `line` and `lane` (over a container that is a sibling of a dragged element the before or after band is a quarter of its size along the flow, otherwise 12 px, so a card dragged over the next card in a row reorders the row unless it is held over the middle half), and `markOf` draws that line, so the orange line is always one of the drawn slots; a drop on the element's own place is returned as a spot without commands (label "Stays where it is", the drop moves nothing). At drag start the containers that can take the element (`canContain` on the page tree outside the dragged subtrees and linked instances, the same rule `dropTarget` applies to "into") are measured once and drawn shifted by the canvas scroll; per pointer move the scene is redrawn only when the slot, the scroll or the frame position changes. `features/layout-layer.ts` (`styles/layout-grid.css`, `--z-raised`, tokens only, `pointer-events: none`) draws boxes, cells, slot lines, guides and gap measures from pools of fixed elements in `#overlay-root` that grow once and are hidden with `hidden`, converting with `FrameMap.still()` (one frame rectangle read per draw, so no layout thrash). With about 370 elements on the canvas the pointer-move handler measured 0.76 ms on average for small moves and 1.24 ms for random jumps (main: 0.73 and 1.20), and a drag start 20 to 37 ms (main: 20 to 43). The drag clears the layer on drop, Escape, pointer cancel and a second finger. `view.layout-outlines` (Ctrl+Alt+G, registered from `installCanvasDrag`'s returned `commands`) draws the same layer without a drag for the parent chain of the selection (the page root when it is selected), with grid cells; it is kept in `localStorage` (`formweb.canvas.layout-outlines`, read and written in try/catch), repaints on a requestAnimationFrame from a MutationObserver on the canvas document, its scroll, the stage scroll and ResizeObservers on the frame and the stage, is hidden while the Live responsive preview is on (`editing()` false, frame hidden) and, by CSS, while Preview as published is open. The style element in the canvas head also gives a selected or marked element, other than the page root and text being edited, `cursor: move`, and a MutationObserver on `data-fw-selected` shows the drag tip in the status line the first time a canvas press selects an element (once per tab, `sessionStorage` `formweb.canvas.drag-hint`).

**Hover outlines (0.32.0).** `features/hover-outline.ts` (the row tint in `styles/hover-outline.css`) registers `view.hover-outline` (View > Show hover outlines, on unless `localStorage` `formweb.canvas.hover-outline` is `'0'`). Delegated pointer listeners on the Layers list and, once `canvas.loaded()` resolves, on the canvas document set the attribute `data-fw-hover` on at most one canvas node and, when the pointer is on the canvas, on its layer row; one requestAnimationFrame per change, and an attribute is written only when the hovered key changes. It is an attribute, never a class, so `keyed()` rows and exact-class checks are untouched and `ui/canvas.ts` never removes it. One `<style>` added to the canvas head draws a 1 px outline in the canvas's literal orange at 70 % alpha (tokens do not exist in the iframe) and leaves out selected, marked, lifted and page-root nodes and everything during a drag or a hold, so the selection outline always wins. Nothing is drawn while the switch is off, in either preview, with the scrim, Quick insert or a visible `.fw-menu`, with a `contenteditable` node, during either drag, or for a pointer that is not a mouse; a page change (a MutationObserver on the Layers list), a site change, a blur and leaving the window clear it.

**Page script (0.32.0).** `codeKind(site, id)` in `ui/canvas.ts` reads the stored code section: JavaScript and no HTML is `'script'`, any other section `'code'`. The canvas placeholder carries `data-fw-poster="script|code|component"` and its words (Page script with a line under it, Code section, Component); `features/inspector/script-note.ts` gives the layer row one icon holding the box, code and script glyphs switched by `data-glyph`, and hides the Design and Motion controls of a Page script with the class `fw-pane-script` and one note per pane, moving the tab to Content; `canvas-menu.ts` leaves out its Design links. The script node is `display: contents`, so only `[data-fw-poster=script]` takes pointer events (none while `html[data-fw-dragging]`), carries the selection outline and is what `Canvas.find` returns for reveal and bring-into-view.

**Desktop start-up (0.32.0).** `src-tauri/src/reveal.rs` shows the editor window when the page calls `app_ready`, after `SPLASH_MIN` 500 ms at least (2.6 s before), plus the 220 ms `BAR_FINISH`, with the 20 s fallback unchanged. `src-tauri/src/start_times.rs` records four moments from launch (service started, service ready, editor ready, window shown) and `show_main` writes them once to stderr as `[formweb] start-up: ...`; `docs/DESKTOP_TESTING.md` says how to read it.

**Design field controls (0.33.0).** `features/inspector/controls/` puts a control beside a style field made by `addStyle()` in `main.ts`, by CSS key, without owning its value: the text input stays visible and is the one stored value, and a control writes through `field.commit()`, which goes through the same `setStyle()` as typing (breakpoint scope, undo, brand check). `index.ts` is the kit: `registerControl(keys, factory)`, `installControls()` (called once after the inspector is built), three slots per field (`lead`, `trail`, `below`, mounted once; a field's state is `data-ctl` `off`, `on` or `raw` and never changes its height), the raw CSS switch in each label, and the default in `localStorage['formweb.design-controls']`, never in the site. `slider.ts` with the fixed range table in `number.ts`, `color.ts` with one picker popover in `color-picker.ts` (`color-area.ts`, `color-math.ts`), the picker's Gradient tab in `gradient.ts` and `gradient-model.ts` through `registerPickerTab`, and `grid.ts` with `grid-tracks.ts`. Controls that use plain keys carry `data-own-keys`, which `commands/keymap.ts` reads to leave plain keys to them while still running Ctrl/Cmd shortcuts. `view.design-controls` (View > Show controls in Design fields) flips the default. `frontend/HASHOUT_LOG.md` (0.33.0) has the contract and the traps.

**Touch, pen and Select several.** `features/hold.ts` holds what both drags share for touch: a 350 ms hold with an 8 px slop, `startsDrag` (left button only, and for a pen only `buttons === 1`, so the barrel or eraser button never starts a drag), a permanent non-passive `touchmove` listener on the list and on the canvas document that calls `preventDefault` only while a drag is armed (setting `touch-action` after `touchstart` does not affect the running gesture, so this is what keeps the list or canvas still), a capture `contextmenu` blocker on the top window and the canvas window for the length of a held gesture, and a synthetic `contextmenu` at the release point when a hold ends without moving, so the existing menus open by touch on every platform, including those that never fire `contextmenu` on a long press. `installRowDrag` and `installCanvasDrag` keep the mouse path as it was (4 px and 6 px thresholds, immediate) and run pens through it; a touch press arms a timer instead, and moving past the slop first gives the gesture back to the browser, so it scrolls. When the hold takes, the row gets `is-lifted` or the element `data-fw-lifted` (on the canvas an unselected element is selected first), the drag then follows the finger with pointer capture, and listeners filter by `pointerId`: a `pointerdown` of any other pointer or a `pointercancel` ends it with no command. A touch lift outside the list or the canvas finds no target. `features/select-mode.ts` adds the header toggles (one shared state, `picking()` in `features/selection.ts`, which makes `layerClick`, `pageClick` and `canvasClick` toggle as Ctrl+click does), the count and Done bar laid over the heading's first grid column so nothing moves, the `edit.select-mode` command, Escape on the window, and a capture `dblclick` blocker on the lists and the canvas window while the mode is on; `main.ts` repaints it from `update()`.

**Vector module.** `frontend/src/vector/` draws and edits on an overlay above the canvas. The model is plain engine data: an `svg` node holding `path` nodes, with `d` always the rendered result and `data-fw-vector` the anchor model (including Live Corners, which stay non-destructive). One gesture is one engine batch, so undo, revision and MCP behave as for any edit. The tag and attribute allowlist, the `d` grammar and same-svg `url(#id)` references are enforced independently in `formweb-model/src/vector.rs`, `ui/canvas.ts` and `backend/app/assets.py`, which must stay in step. `POST /api/vector/import-svg` cleans imported SVG with the same rules. Tool letters are handled by the vector editor's own capture listener, which runs before the keymap.
Expand Down
4 changes: 2 additions & 2 deletions .docs/wiki/Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ The user guide teaches FormWeb to a person who has never used it: plain words, n
- [Start here](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/README.md): what FormWeb is, a map of the window, how to open a demo.
- [Your first site](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/01-first-site.md): from an empty page to an exported zip.
- [Pages and layers](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/02-pages-and-layers.md)
- [Working on the canvas](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/03-canvas.md): select, the right-click menu, dragging with the layout grid it snaps to, and View > Show layout outlines.
- [The right panel](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/04-right-panel.md): tabs, Search properties and breakpoints.
- [Working on the canvas](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/03-canvas.md): select, the right-click menu, dragging with the layout grid it snaps to, View > Show layout outlines and View > Show hover outlines.
- [The right panel](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/04-right-panel.md): tabs, sliders, the color picker and gradients, the grid layout chooser, Search properties and breakpoints.
- [Page background and theme colors](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/05-background-and-theme-colors.md)
- [Preview](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/06-preview.md)
- [Audit](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/07-audit.md)
Expand Down
2 changes: 1 addition & 1 deletion .docs/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FormWeb is the form family's visual website authoring application. A Rust engine owns editable sites and exports browser-native HTML, CSS and JavaScript. A Python/FastAPI service supplies projects, local publications, forms and MCP. A vanilla TypeScript/Vite window displays and changes the same engine state.

Release version: 0.31.2. Author: nodemode-ai. The repository README and changelog record this release.
Release version: 0.33.0. Author: nodemode-ai. The repository README and changelog record this release.

| Surface | Current boundary |
| --- | --- |
Expand Down
4 changes: 2 additions & 2 deletions .docs/wiki/Library.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The library is data that ships with FormWeb: 35 section templates from the forma
| `backend/app/library.py` | The one implementation of template expansion, preset commands and component merging |
| `backend/app/library_routes.py` | HTTP routes |
| `setup/library_tool.py` | `./formweb library check` and `build` |
| `frontend/src/features/library/` | The Library panel; `showTab(id)` on the panel switches between `sections`, `kits` and `import`, which the editor command `file.import-html` (File > Import HTML...) uses to open the Import HTML tab (`importer.ts`, `POST /api/library/import-html`) |
| `frontend/src/features/library/` | The Library panel; `showTab(id)` on the panel switches between `sections`, `kits` and `import`. The Import HTML tab (`importer.ts`) has three parts: HTML files, A whole site in a .zip and Paste HTML code (`POST /api/library/import-html`, through the exported `importSection()`). The editor command `file.import-html` (File > Import HTML files...) calls `importHtml()`, which shows that tab and opens the file picker of `site-import.ts` in the same click |

## One path for every client

Expand All @@ -30,7 +30,7 @@ Placeholders in a template are `$parent`, `@@key@@` for a node id and `{{field}}

## Import site from zip

`backend/app/site_import.py` reads a static site zip in memory with `zipfile` under hard caps (64 MiB, 1,000 entries checked from the end record before parsing, 2 MiB file list, 128 MiB unpacked, 12 levels, an expansion limit, per-type file caps) and refuses traversal, absolute and drive-letter names, links and passwords outright. The review route plans without changing anything; the import route re-reads the same bytes, refuses a changed revision, stores assets through `ingest` and sends one batch of `page.add`, `page.update`, `node.add` and `code.section.set` (and `node.remove` in replace mode, offered only when no extension entry or component source points into the page). Each page is one code section built with Import HTML's `kit_script`, so the script policy is the same; both paths use `site_import.script_type` to leave out script elements that are not JavaScript (JSON-LD among them) with the same warning. The editor view is `features/library/site-import.ts` (File > Import site from zip..., `file.import-site`); agents use `library_import_site`.
`backend/app/site_import.py` reads a static site zip in memory with `zipfile` under hard caps (64 MiB; 40,000 entries and a 2 MiB file list checked from the end record before parsing; then 1,000 entries and 12 levels counted only outside the ignored `__MACOSX`, `node_modules` and dot folders; 128 MiB unpacked, an expansion limit, per-type file caps) and refuses traversal, absolute and drive-letter names, links and passwords outright. A project's source (a `package.json` at the top or one folder down, plus one of: no HTML page; `.ts`, `.tsx`, `.jsx`, `.vue` or `.svelte` files under that project's `src` folder; a page loading such a script, holding `%PUBLIC_URL%`, or loading a module script that imports a package by name while no page has an import map) is refused with a sentence that says to build it and import the output folder (`_project`; `_peek` reads names from the file list of an archive refused before it is opened, only to choose that sentence). Both routes also take loose pages as JSON, `{"files": [{"name", "html"}]}`, which `read_files` turns into the same structure as a zip holding them at its top level. The review route plans without changing anything; the import route re-reads the same bytes, refuses a changed revision, stores assets through `ingest` and sends one batch of `page.add`, `page.update`, `node.add` and `code.section.set` (and `node.remove` in replace mode, offered only when no extension entry or component source points into the page). Each page is one code section built with Import HTML's `kit_script`, so the script policy is the same; both paths use `site_import.script_type` to leave out script elements that are not JavaScript (JSON-LD among them) with the same warning. The editor view is `features/library/site-import.ts` (File > Import site from zip..., `file.import-site`, and the review of File > Import HTML files..., `file.import-html`); both commands share its one hidden `multiple` file input, whose `accept` `choose(kind)` sets just before `click()`, after `reset()` has cleared any earlier import, so the picker opens inside the person's click over a clean view. The view has one Bring ... in as choice for pages and a section, its result note at the end of the scroller and work in progress on the import button. Agents use `library_import_site`.

## Convert to editable elements

Expand Down
Loading
Loading