diff --git a/.agents/skills/formweb-harness/SKILL.md b/.agents/skills/formweb-harness/SKILL.md index f031bd07..157868a7 100644 --- a/.agents/skills/formweb-harness/SKILL.md +++ b/.agents/skills/formweb-harness/SKILL.md @@ -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.33.0" + version: "0.34.0" --- # FormWeb Harness diff --git a/.claude/skills/formweb-harness/SKILL.md b/.claude/skills/formweb-harness/SKILL.md index f031bd07..157868a7 100644 --- a/.claude/skills/formweb-harness/SKILL.md +++ b/.claude/skills/formweb-harness/SKILL.md @@ -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.33.0" + version: "0.34.0" --- # FormWeb Harness diff --git a/.docs/wiki/Architecture.md b/.docs/wiki/Architecture.md index 130fb176..0a4f7c81 100644 --- a/.docs/wiki/Architecture.md +++ b/.docs/wiki/Architecture.md @@ -37,7 +37,7 @@ New features are modules at the existing layer seams. Read `frontend/HASHOUT_LOG ## Editor layers (v0.6 and v0.7) -**Commands registry.** `frontend/src/commands/registry.ts` holds one `Commands` singleton: each command has an id, label, key bindings (`Mod+Shift+S` form, read from `event.code` so they are layout independent), enabled and checked state, menu, group, description, parameters, and `mutates` and `risky` flags. A duplicate id throws and a duplicate key is dropped from the later command. `keymap.ts` installs one capture listener on the top document; it ignores inputs, textareas, selects, contenteditable and the terminal, so single keys never fire while typing, except commands marked `global` on a Mod combo. Keys pressed while focus is inside the canvas iframe are forwarded by `ui/canvas.ts` to the top document (not from editable targets), so shortcuts work after clicking the canvas. `catalogue.ts` posts the list to the backend, and `backend/app/commands_mirror.py` long-polls the window so MCP `list_ui_commands`, `describe_ui_command` and `run_ui_command` run commands in the open page, with an Allow or Deny prompt for risky ones. User rebinding is stored in `localStorage` only. +**Commands registry.** `frontend/src/commands/registry.ts` holds one `Commands` singleton: each command has an id, label, key bindings (`Mod+Shift+S` form, read from `event.code` so they are layout independent), enabled and checked state, menu, group, description, parameters, and `mutates` and `risky` flags. A duplicate id throws and a duplicate key is dropped from the later command. `keymap.ts` installs one capture listener on the top document; it ignores inputs, textareas, selects, contenteditable and the terminal, so single keys never fire while typing, except commands marked `global` on a Mod combo and, since 0.34.0, `edit.undo` and `edit.redo` on a Mod combo from a Design list field (`select[data-style]`). Keys pressed while focus is inside the canvas iframe are forwarded by `ui/canvas.ts` to the top document (not from editable targets), so shortcuts work after clicking the canvas. `catalogue.ts` posts the list to the backend, and `backend/app/commands_mirror.py` long-polls the window so MCP `list_ui_commands`, `describe_ui_command` and `run_ui_command` run commands in the open page, with an Allow or Deny prompt for risky ones. User rebinding is stored in `localStorage` only. **Pages and layers panel (0.29.0).** `ui/context-menu.ts` is the one context menu helper: `showContextMenu(entries, anchor, {host, className, run, returnFocus})` takes items (`id`, `label`, `enabled`, `title`, `keys`, `run`) and `{separator: true}` entries, anchors at a pointer position or an element, and handles arrow keys, Home, End, Enter, Escape and outside clicks; `menuKeyPressed` and `anchorOf` serve the Menu key and Shift+F10. The layers menu (`fw-layer-menu`) and the page menu (`fw-page-menu`) are built with it. `features/panel/` holds the panel logic: `index.ts` (`installPanel`, the page and layer commands and menus, row keyboard wiring) and `pages.ts` (free copy name and slug, list moves as `page.move` commands, the home page batch). Page commands take an optional `id` so a menu can act on a page other than the open one; `invoke(id, params)` runs a registered command for such a target. `rename.ts` puts a fixed field over a row's label in the overlay root (rows are buttons and the lists are `keyed()`, so the field cannot live inside either); the row only hides its label, so nothing moves. `fold.ts` owns folding: `LayerFolds.rows()` is the layers walk (it skips paint definitions and `tspan` as before, leaves out the children of folded rows, and counts every layer for the heading), folded ids are kept per page in memory and in `localStorage` (`formweb.layers.folded`, at most 64 pages and 2,000 ids each) and the heading state in `formweb.panel.sections`; nothing goes into the site, because FormPublisher opens `.fweb` files with an older engine. A change of selection unfolds its ancestors once, so folding the parent of the selected element keeps it folded. The twisty sits in its own grid column, reserved on leaf rows, and is placed by `grid-column` so the rows' child order is unchanged. `drop.ts` is the pure drop logic and takes lists of ids, for the canvas drag and multi-select that build on it: `zoneAt(fraction, into)` (thirds over containers, halves elsewhere), `dropTarget(site, root, ids, over, zone, open)` returning `{over, zone, parent, anchor}` or null (no page roots, no drop into the dragged nodes or their descendants, only `CONTAINER_TAGS` take children, nothing in or out of linked instance structure, as `guard_structure` in the engine refuses), and `moveCommands(site, ids, target)`, which turns the move into `node.move` commands in document order against a simulated child list and leaves out no-ops, so one drop is one batch and one undo step. `pages.ts` has the same shape for pages (`pageMoveCommands(site, ids, anchor)` as `page.move` commands). `drag.ts` is the pointer controller for both lists: a 4 px threshold so a click still selects at once, a fixed drop line in the overlay root, the `is-drop-into` outline, auto-scroll within 28 px of the list edges, Escape to cancel, and the click after a drop swallowed. Row clicks go through `pageRowClick` and `layerRowClick` in `main.ts`, which pass the event on and do not stop modifier clicks. @@ -63,6 +63,8 @@ New features are modules at the existing layer seams. Read `frontend/HASHOUT_LOG **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. +**Try a choice (0.34.0).** A trial is canvas-only: no engine command, no `/api` call and no stored value changes until Keep. `ui/canvas.ts` `Canvas.setLayer(name, frame)` draws two named layers over the stored styles, `play` then `trial` (after the scene scrubber's motion frame; later wins), restyling only the named properties of the named nodes and never calling `render()`; a `null` value shows what the element inherits at the picked breakpoint. `features/try/` holds the contract (`types.ts`) and the kit (`index.ts`, `installTry()`, called once from `main.ts` before `installControls`): one trial at most, `begin(owner)`, `put`, `keep` (one `setStyle`, one undo step), `revert`, and `sync()` from `update()`, which drops a trial when the selection, breakpoint or page changes, design is left, or another writer changes the same property. `bar.ts` is the one Keep and Revert bar in `#overlay-root`; `segments.ts` takes over the Design segment groups with a capture-phase click; `choice-list.ts` opens one `listbox` popover for the eight `select[data-style]` fields while the select keeps the stored value. `commands/registry.ts` asks `Commands.intercept` before every `run()` and `call()`: a command reverts a trial first, a person's Undo during a trial is used up, and an agent's call always runs. The control kit hands drag values to the canvas through its `trial` option (`live`, `settled`). `features/motion/play.ts` plays a motion preset once through the `play` layer, frame by frame in the editor, with nothing added to the canvas document. `view.try-choices` and Preferences > Interface > Design fields turn trying off, stored only in `localStorage['formweb.try-choices']`. `frontend/HASHOUT_LOG.md` (0.34.0) has every way a trial ends 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. diff --git a/.docs/wiki/Guide.md b/.docs/wiki/Guide.md index 6d2b37eb..4b657390 100644 --- a/.docs/wiki/Guide.md +++ b/.docs/wiki/Guide.md @@ -6,7 +6,7 @@ The user guide teaches FormWeb to a person who has never used it: plain words, n - [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, 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. +- [The right panel](https://github.com/nodemode-dev/formweb/blob/main/docs/guide/04-right-panel.md): tabs, trying a choice before keeping it, sliders, the color picker and gradients, the grid layout chooser, motion presets, 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) diff --git a/.docs/wiki/Home.md b/.docs/wiki/Home.md index 19982245..7291d3b5 100644 --- a/.docs/wiki/Home.md +++ b/.docs/wiki/Home.md @@ -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.33.0. Author: nodemode-ai. The repository README and changelog record this release. +Release version: 0.34.0. Author: nodemode-ai. The repository README and changelog record this release. | Surface | Current boundary | | --- | --- | diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ab9734..bd7c7805 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 0.34.0 · 2026-11-27 + +- The third of five releases that answer the follow-up on issue #36: try a choice before keeping it. +- In the Design tab, a click on a choice in Display, Direction, Align, Justify, Wrap or Text alignment now shows it on the page first, without saving it. A bar under the field, inside the right panel, names it, for example "Trying: Center", with Keep and Revert under the name; a long name ends in "..." and shows in full when you point at it. Keep, or Enter, saves it as one undo step; Keep on the choice that is already saved saves nothing and closes the bar. Revert, or Escape, puts the page back, and the status line says "Not kept: Text alignment is unchanged." Until you keep it, the revision, undo, other windows, the assistant and the export see nothing. +- Left and Right (or Up and Down) try the next choice, and Home and End the first and last; the page changes with each. Tab goes from the choices to Keep, then Revert. The choice being tried has an outline of its own, so it is never confused with the saved one. A click on the saved choice tries the field with no value of its own ("Trying: Inherit"): the page shows what the element would inherit, and Keep clears the value. +- The Design fields that are lists (Align self, Justify self, Object fit, Weight, Capitals, Kerning, Position and Overflow) open the editor's own list. A click on an item, an arrow key, Home, End or a typed letter tries it while the list stays open; the saved item has a tick. Enter or Keep keeps it and closes the list; Escape, Revert or a click outside puts the page back. Space, Enter, Up, Down or Alt+Down on the field opens the list without trying anything. The field itself always shows the saved value, and a value a program sets on it is saved at once, as before. +- A trial also ends without saving anything when you select another element (on the canvas, in Layers, with Select parent, or when the assistant selects one), click or double-click anywhere on the canvas, also on the element that is already selected, pick another breakpoint or page, turn on Live preview, open Preview as published, Home or a dialog, move into another field, try a choice in another field, start dragging a slider, or turn trying off. Running another command (a menu item, a shortcut, a toolbar button, a field's Reset) first puts the page back, then runs on the saved values; Save and Search commands leave the trial on. Scrolling, the mouse wheel, a click on empty space in the panel and switching to another app leave it on too. +- If the assistant or another window changes the same field of the same element during a trial, the trial is dropped and the status line says "The element was changed elsewhere, so the trial was dropped."; a change to anything else leaves the trial on, drawn over the new state. +- Undo during a trial (Ctrl+Z or Cmd+Z, the Undo button in the top bar, or Edit > Undo) only puts the page back; nothing earlier is undone, also when the keys are held down. The next Undo undoes as usual. +- On a slow computer, after Keep the page keeps showing the kept value until it is saved, and the bar shows that it is waiting; more clicks and keys on that field do nothing until then. If you select another element meanwhile, the bar goes at once and the value still lands on the first element. If the change is refused, the page goes back and the status line says why. +- Sliders, the color picker's square, hue bar and opacity bar, and the stops on the Gradient tab now show their value on the page while you drag them or hold a key, not only in the text box. Releasing saves it once, as one undo step, as before; Escape during the drag puts the page back, and the page never steps back to the old value between your release and the save. This works whether trying is on or off. +- Motion presets: a click on a preset sets it as before, then plays it once on the canvas, from its start to the element as saved. Fade up, Fade in, Scale in, Blur in, Slide from left, Slide from right and Stagger children play; Spin and Float show a short loop and stop where they began. Play again, under the presets, plays the selected element's motion once more and saves nothing. Selecting another element, another breakpoint or page, Preview, Undo, another preset or a change from outside stops it at once, and the element shows its saved look. +- A preset the canvas cannot show (Split words, Split characters, Typewriter, Count up, Marquee left and right, Tilt, Follow pointer and the classic effects) is still set. When the element has nothing the canvas can play, Play again is off and the row under the presets says "This effect plays in Preview and on the published site."; when it also has a preset that plays, Play again plays that one and the row stays empty. When your system asks for reduced motion, nothing plays, Play again is off, and the row says so. +- Edit > Settings... > Interface > Design fields has "Try choices on the page before keeping them", on at first. View > Try choices before keeping them turns it off or on from the menu, with a check mark and a sentence in the status line. With it off, a click on a choice or a pick in a list is saved at once, as in 0.33.0. The choice is kept in this browser only and never saved with the site; Reset All Preferences turns it on again. +- Hover outlines stay off while a choice is being tried or a value is being dragged. +- Agents: nothing changes in how styles are set; a trial is never sent to the engine, so an agent never sees one. `view.try-choices` (View > Try choices before keeping them) turns trying on or off. A command an agent runs in the window while a person is trying a choice first puts that person's page back, then runs; an Undo sent by an agent really undoes. +- Fixed: Blur in now shows as active once it is set. Before, it never did. +- Fixed: Ctrl+Z and Ctrl+Shift+Z (Cmd on a Mac) now undo and redo while one of the Design list fields, such as Weight, has the focus. Before, they did nothing there. +- Fixed: Delete and Backspace on the Design, Motion, Content and Page tab buttons and on a section title in the right panel (such as Layout or Typography) no longer remove the selected element, and neither do they on a segment button such as a Display choice. +- Fixed: after a click on a field's Reset, the focus moves to that field, so a Backspace pressed next no longer removes the selected element. +- Automated tests at four layers: 182 engine tests, 612 service tests, 701 editor function tests and 462 tests that drive the real editor window. Of these, 38 editor function tests and 134 window tests are new and cover this release. Each was written after its feature had been run and seen to work, by an agent that did not build it, and each was seen to fail against 0.33.0 and once with a wrong expected value before it was accepted. +- Known gaps: trying was run in Chromium only, with a mouse and a keyboard; touch, a pen, a screen reader, Firefox, Safari and the desktop app's web views on Windows and macOS were not used, and reduced motion was run with the test browser's setting, not a system switch. Undo pressed while a preset plays stops the playback when the undo has been answered, not at the key press. After a preset has played on an element whose children had no styles of their own, those children keep an empty style attribute on the canvas until the next reload; nothing is saved or exported from it. Delete and Backspace still remove the selected element while the focus is on a toolbar button, a Layers row or the page itself after a menu item, as before this release. The bar that names a trial sits over the row of fields under its field while the trial is on; at a 900 px window it covers that row fully. The Stagger children button is cut at its left edge. Other shortcuts than Undo and Redo, such as Ctrl+, for Settings, do nothing while a Design list field has the focus. The translations are machine made and unread by native speakers. + ## 0.33.0 · 2026-11-27 - The second of five releases that answer the follow-up on issue #36: controls instead of typing in the Design tab. diff --git a/README.md b/README.md index 5642739c..abf09541 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

- version 0.33.0 + version 0.34.0 TypeScript 7 Rust engine macOS, Linux, Windows diff --git a/VERSION b/VERSION index be386c9e..85e60ed1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.33.0 +0.34.0 diff --git a/backend/app/config.py b/backend/app/config.py index d4b1ce31..54447993 100644 --- a/backend/app/config.py +++ b/backend/app/config.py @@ -11,7 +11,7 @@ if FROZEN: ROOT.mkdir(parents=True, exist_ok=True) load_dotenv(ROOT / 'backend' / '.env') -VERSION = '0.33.0' +VERSION = '0.34.0' PORT = int(os.getenv('FORMWEB_PORT', '8240')) CORE_NAME = 'formweb-core.exe' if os.name == 'nt' else 'formweb-core' CORE_BIN = Path(os.getenv('FORMWEB_CORE_BIN', str(BUNDLE / 'bin' / CORE_NAME if FROZEN else ROOT / 'native/target/release' / CORE_NAME))) diff --git a/docs/AGENT_QUICKSTART.md b/docs/AGENT_QUICKSTART.md index 6dd6aaf4..9bf190a5 100644 --- a/docs/AGENT_QUICKSTART.md +++ b/docs/AGENT_QUICKSTART.md @@ -143,7 +143,7 @@ The pack's [scenario evaluations](../.claude/skills/formweb-harness/references/e ## Driving the editor window -Every menu action has a stable command id (`file.save`, `edit.undo`, `insert.heading`, `view.mobile`, `window.studio` and so on). In the browser, `window.formweb.commands()` lists them with label, menu, shortcut and whether each is enabled right now, and `window.formweb.run(id)` runs one exactly as the menu would, returning false when it is disabled. Menu rows and command-search results carry the id in `data-command`. People reach the same actions from the menubar or with Ctrl/Cmd+K. Prefer MCP for site changes; use these ids (or `list_ui_commands` and `run_ui_command`) when an agent has to operate the window itself (switching breakpoint, opening a panel or dialog). Agent ids: `window.agents` (Agent Connect panel), `agents.toggle` (MCP and terminal on or off), `view.terminal` (Ctrl+`), `terminal.new`; panel buttons carry `agents.client.`, `agents.launch.`, `approvals.approve` and `approvals.deny`. `file.home` (File > Home, Alt+Ctrl/Cmd+H) shows the Home screen over the editor. `file.import-site` (File > Import site from zip...) opens the Library's site import view and its file picker; the person picks the zip and confirms the review, so an agent holding the zip bytes should call `library_import_site` instead; a zip of a project's source (a `package.json` with no HTML page, `.ts`, `.tsx`, `.jsx`, `.vue` or `.svelte` files under its `src` folder or loaded by a page, a `%PUBLIC_URL%` placeholder, or a module script importing a package by name with no import map; `docs/LIBRARY.md` has the exact rule) is refused with a sentence that says to build it and import the output folder. `file.import-html` (File > Import HTML files..., the label was Import HTML...) opens the file picker for one or several `.html` files with Library > Import HTML behind it; the person then chooses As new pages (the same review and one-undo-step import as a site zip) or, for one file, As a section of this page. An agent with the HTML text should call `library_import_html` instead. `view.hover-outline` (View > Show hover outlines, no key, on by default) turns hover outlines on or off: a Layers row under the mouse outlines its element on the canvas, and an element under the mouse is outlined and tints its row. It changes only the view, is remembered in the browser and never saved with the site. `view.design-controls` (View > Show controls in Design fields, checkable, no key) shows or hides the sliders, color swatches and layout choosers beside the Design fields for every field without its own choice (Preferences > Interface > Design fields; each field's label has its own switch). It changes only the editor, is remembered in the browser and never saved with the site; a style value is still one CSS string that you set with `node.update` exactly as before, and the person's controls follow it. `inspector.search` (Window > Search properties, Alt+Ctrl/Cmd+F) opens the right panel and focuses its property search. Demo ids (Help > Demos, also the demo cards on Home): `demo.lowlight`, `demo.looking-back`, `demo.harbour-ferries` and the five whole-site starters `demo.coldmere-plumbing` (business), `demo.northfold-studio` (portfolio), `demo.slow-allotment` (blog), `demo.wenlow-type-day` (event) and `demo.fernhollow-pottery` (shop) each open that demo as a new, unsaved site; they replace the open site, and the window asks the person first when that site has changes not saved as a project. `demo.preview` (optional `id`: any of the eight demo ids) shows a finished demo in a preview over the window and changes nothing, and `demo.preview-close` closes it; while the preview is open every command except the `demo.` ids is disabled, and running one of the eight open ids closes the preview first. `view.preview-full` (Mod+Shift+P, the eye Preview button) opens or closes Preview as published, the compiled open site over the whole window, and changes nothing; while it is open every other command is disabled. `view.preview` toggles the in-canvas Live responsive preview. Layout ids: `window.toggle-left`, `window.toggle-right`, `window.toggle-rail` and the presets `workspace.design`, `workspace.content`, `workspace.build`, `workspace.focus`; rail buttons and collapsed-panel strip buttons carry the same `data-command` ids. Pages and layers panel ids (0.29.0) take an optional `id` (the open page or the selected element when left out): `page.open` `{id}`, `page.rename` `{id?, name?}`, `page.duplicate`, `page.set-home`, `page.move-up`, `page.move-down` and `layer.rename` `{id?, name?}` change the site, one undo step each (without `name` a rename opens the name for the person to type); `layer.collapse-all` and `layer.expand-all` change only the layers list. `page.set-home` also points links and click actions at the page's old address to `/`, and refuses, with the reason in the status line, when either page is a CMS template or has a translated address, or a password protects the page through a route other than `/`. To reorder pages from MCP use the engine command `page.move {id, index}`. +Every menu action has a stable command id (`file.save`, `edit.undo`, `insert.heading`, `view.mobile`, `window.studio` and so on). In the browser, `window.formweb.commands()` lists them with label, menu, shortcut and whether each is enabled right now, and `window.formweb.run(id)` runs one exactly as the menu would, returning false when it is disabled. Menu rows and command-search results carry the id in `data-command`. People reach the same actions from the menubar or with Ctrl/Cmd+K. Prefer MCP for site changes; use these ids (or `list_ui_commands` and `run_ui_command`) when an agent has to operate the window itself (switching breakpoint, opening a panel or dialog). Agent ids: `window.agents` (Agent Connect panel), `agents.toggle` (MCP and terminal on or off), `view.terminal` (Ctrl+`), `terminal.new`; panel buttons carry `agents.client.`, `agents.launch.`, `approvals.approve` and `approvals.deny`. `file.home` (File > Home, Alt+Ctrl/Cmd+H) shows the Home screen over the editor. `file.import-site` (File > Import site from zip...) opens the Library's site import view and its file picker; the person picks the zip and confirms the review, so an agent holding the zip bytes should call `library_import_site` instead; a zip of a project's source (a `package.json` with no HTML page, `.ts`, `.tsx`, `.jsx`, `.vue` or `.svelte` files under its `src` folder or loaded by a page, a `%PUBLIC_URL%` placeholder, or a module script importing a package by name with no import map; `docs/LIBRARY.md` has the exact rule) is refused with a sentence that says to build it and import the output folder. `file.import-html` (File > Import HTML files..., the label was Import HTML...) opens the file picker for one or several `.html` files with Library > Import HTML behind it; the person then chooses As new pages (the same review and one-undo-step import as a site zip) or, for one file, As a section of this page. An agent with the HTML text should call `library_import_html` instead. `view.hover-outline` (View > Show hover outlines, no key, on by default) turns hover outlines on or off: a Layers row under the mouse outlines its element on the canvas, and an element under the mouse is outlined and tints its row. It changes only the view, is remembered in the browser and never saved with the site. `view.design-controls` (View > Show controls in Design fields, checkable, no key) shows or hides the sliders, color swatches and layout choosers beside the Design fields for every field without its own choice (Preferences > Interface > Design fields; each field's label has its own switch). It changes only the editor, is remembered in the browser and never saved with the site; a style value is still one CSS string that you set with `node.update` exactly as before, and the person's controls follow it. `view.try-choices` (View > Try choices before keeping them, checkable, no key, on by default; Preferences > Interface > Design fields) turns trying on or off for the person: with it on, a click on a Design choice (the segment buttons, the eight list fields) shows that value on the canvas only, with Keep and Revert, until the person keeps it. Nothing changes for you: a trial is never sent to the engine, so `/api/state`, the revision, undo, `node.update` and every MCP tool see only stored values, and a value you set on a `select[data-style]` with a `change` event is written at once. A command you run in the window (`run_ui_command`, `window.formweb.run`) while the person is trying a choice first puts the person's page back and then runs; your `edit.undo` really undoes. A selection change or an outside change to the same property of the tried element ends the person's trial without writing. `inspector.search` (Window > Search properties, Alt+Ctrl/Cmd+F) opens the right panel and focuses its property search. Demo ids (Help > Demos, also the demo cards on Home): `demo.lowlight`, `demo.looking-back`, `demo.harbour-ferries` and the five whole-site starters `demo.coldmere-plumbing` (business), `demo.northfold-studio` (portfolio), `demo.slow-allotment` (blog), `demo.wenlow-type-day` (event) and `demo.fernhollow-pottery` (shop) each open that demo as a new, unsaved site; they replace the open site, and the window asks the person first when that site has changes not saved as a project. `demo.preview` (optional `id`: any of the eight demo ids) shows a finished demo in a preview over the window and changes nothing, and `demo.preview-close` closes it; while the preview is open every command except the `demo.` ids is disabled, and running one of the eight open ids closes the preview first. `view.preview-full` (Mod+Shift+P, the eye Preview button) opens or closes Preview as published, the compiled open site over the whole window, and changes nothing; while it is open every other command is disabled. `view.preview` toggles the in-canvas Live responsive preview. Layout ids: `window.toggle-left`, `window.toggle-right`, `window.toggle-rail` and the presets `workspace.design`, `workspace.content`, `workspace.build`, `workspace.focus`; rail buttons and collapsed-panel strip buttons carry the same `data-command` ids. Pages and layers panel ids (0.29.0) take an optional `id` (the open page or the selected element when left out): `page.open` `{id}`, `page.rename` `{id?, name?}`, `page.duplicate`, `page.set-home`, `page.move-up`, `page.move-down` and `layer.rename` `{id?, name?}` change the site, one undo step each (without `name` a rename opens the name for the person to type); `layer.collapse-all` and `layer.expand-all` change only the layers list. `page.set-home` also points links and click actions at the page's old address to `/`, and refuses, with the reason in the status line, when either page is a CMS template or has a translated address, or a password protects the page through a route other than `/`. To reorder pages from MCP use the engine command `page.move {id, index}`. Canvas context menu ids act on the selected element: `edit.text` starts inline text editing on the canvas, `edit.select-parent` selects the containing element, `edit.wrap` puts the element, with any other selected elements beside it in the same parent, in a new empty div (one undo step), `style.copy` remembers its styles for the picked breakpoint in the window and `style.paste` applies them to the selection (one undo step), and `inspector.text-style`, `inspector.background`, `inspector.spacing`, `inspector.size`, `inspector.link` and `inspector.image` open the right panel at that field. From MCP, change styles with the engine command `node.update` instead. diff --git a/docs/MANUAL.md b/docs/MANUAL.md index adcd2674..cdd54263 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -79,7 +79,7 @@ While you drag, the canvas shows the layout grid the element snaps to, read from View > Show layout outlines (command `view.layout-outlines`, Ctrl+Alt+G, Cmd+Option+G on a Mac) shows the structure without dragging: the container of the selected element and every container around it up to the page are outlined, and the cells of any CSS grid among them are tinted (with the page itself selected, the page is outlined). It follows the selection, the zoom and the scroll. It is off at first and remembered in this browser only; it is never saved with the site or exported, and nothing of it is drawn in the Live responsive preview or in Preview as published. -Hover outlines (View > Show hover outlines, command `view.hover-outline`, no key) show where an element is without selecting it. While the mouse rests on a row in Layers, its element on the canvas gets a light orange outline (1 px, thinner and paler than the selection outline); while it rests on an element on the canvas, that element gets the same outline and its Layers row is tinted, even when the row is scrolled out of view, which never scrolls the list. Nothing is selected and nothing scrolls. The selected element, other selected elements and the page itself never get a hover outline. Nothing shows during a drag on the canvas or in Layers, while text is edited on the canvas, while a menu, Quick insert or a dialog is open, or in the Live responsive preview and Preview as published, and only a mouse draws it, never touch or a pen. Switching page, changing the site or leaving the window clears it. The switch is on at first and remembered in this browser only; it is never saved with the site. +Hover outlines (View > Show hover outlines, command `view.hover-outline`, no key) show where an element is without selecting it. While the mouse rests on a row in Layers, its element on the canvas gets a light orange outline (1 px, thinner and paler than the selection outline); while it rests on an element on the canvas, that element gets the same outline and its Layers row is tinted, even when the row is scrolled out of view, which never scrolls the list. Nothing is selected and nothing scrolls. The selected element, other selected elements and the page itself never get a hover outline. Nothing shows during a drag on the canvas or in Layers, while a Design choice is being tried or a control's drag value is on the canvas, while text is edited on the canvas, while a menu, Quick insert or a dialog is open, or in the Live responsive preview and Preview as published, and only a mouse draws it, never touch or a pen. Switching page, changing the site or leaving the window clears it. The switch is on at first and remembered in this browser only; it is never saved with the site. Select several layers to act on them together. A click selects one layer; Ctrl+click (Cmd+click on a Mac) adds a layer to the selection or takes it out; Shift+click selects every visible row from the last layer you clicked to this one. With a layer row focused, Shift+Up and Shift+Down extend the selection one row at a time, Ctrl+A (Cmd+A) selects the selected layer and its siblings and a second press selects every layer on the page, and Escape goes back to one layer. On the canvas, Ctrl+click, Cmd+click or Shift+click an element to add it or take it out. On a Mac, Ctrl+click is the system's right-click, so it opens the menu of the canvas, a layer or a page instead; use Cmd+click or Shift+click there. On Windows and Linux Ctrl+click never opens a menu. The last layer you picked is the primary one: its row is highlighted as before and it has the solid outline on the canvas, while the others get a lighter highlight and a dashed outline. The inspector then reads "3 elements selected" and the line under it names the primary element, because the controls still edit that one only. Copy, Cut, Paste, Duplicate, Delete, Move layer up and Move layer down (the Edit and Arrange menus, their keys and the layers context menu, whose labels then read "Duplicate 3 elements") act on the whole selection as one undo step. Delete element has two keys, Delete and Backspace (the delete key of a Mac laptop); neither deletes an element while you type in a field or edit text on the canvas. When you select an element together with something inside it, they act on the outer one only; the page itself and elements inside a linked component instance are left out of Copy, Cut and Duplicate (and of Delete, the page and the elements directly inside a linked instance), and the status line says how many were skipped. Duplicate selects the copies, each right after its original. Paste after a copy of several elements pastes all of them, in order, after the selected element. Copy and Cut take at most 64 elements at a time, holding at most 8,000 nodes in all (a paste refuses more, so such a copy is refused at once with the same sentence and the clipboard keeps what it had); for more, select their container. Move up and Move down move the selected layers as a block within each parent, and nothing moves when the block is already at the edge. Dragging a selected layer drags the whole selection (dragging a layer that is not selected drags only that one), and Alt+Up and Alt+Down on a selected row move the whole selection. Right-clicking a selected layer keeps the selection; right-clicking another layer selects only that one. @@ -99,7 +99,7 @@ A website layout uses normal browser flow, flex and grid styles. Use meaningful ### Design field controls -Seventeen fields of the Design tab have a control beside their text input: a slider (Opacity, Width, Height, Max width, Gap, Padding, Margin, Radius, Font size, Line height, Letter spacing, Top, Left), a color swatch (Color, Background) or a layout button (Grid columns, Grid rows). The text input stays visible and holds the one stored value: a control reads it and writes into it through the same path as typing and Enter, so a typed value (`var(--accent)`, `calc(...)`, anything), the breakpoint scope, Reset, undo, the brand restriction, Search properties, the canvas menu's field shortcuts, agents and the command line work exactly as before. While a drag is in progress the input shows the pending value and nothing is sent; releasing sends one `node.update`, so one drag, one click on a choice or one held key is one undo step, and Escape during a drag puts the stored value back. Nothing on the page changes because the pointer rests on a choice. A value the control cannot represent hides the control for that field and is never rewritten: for a slider, anything but one number with a unit the slider knows (two values, `calc()`, `var()`, keywords, unknown units, `!important`); for a swatch, `url()`, several layers, a `var()` that is not a site, brand or team color, a gradient on Color, or anything the browser does not read as a color; for the layout button, named lines, `subgrid`, `none`, `var()`, `calc()`, `fit-content()` and nested `repeat()`. The control's space is kept while it is hidden, so no field moves. A refused value (for example a free color while the brand restriction is on) puts the input back and the status line says why. When the selection or the breakpoint changes during a gesture, the gesture is dropped and nothing is written. While changes to a field are still on their way to the engine, the field never steps back to an older value, a control opened in that time starts from the newest value sent, and when the last answer arrives the field shows what the engine holds, also after a race with a change from outside the window. Ctrl/Cmd+Z and Ctrl/Cmd+Shift+Z run Undo and Redo with the focus on a slider, a swatch, a gradient stop, a button a control adds (the layout button, the raw switch), the picker's square and bars or a layout in the chooser; in a text box (the field's own input, the hex entry, Position, Angle, the number box of Any number of columns) they are that box's own text undo, and a unit list is a form field too, so press Tab or click elsewhere before Ctrl/Cmd+Z. Delete and Backspace on any part a control adds to a field (the swatch, the slider, the unit list, the layout button, the raw switch, the picker and the chooser) never remove the selected element; on the field's Reset link and on the older buttons of the panel, such as the Display choices, they still delete it as before. +Seventeen fields of the Design tab have a control beside their text input: a slider (Opacity, Width, Height, Max width, Gap, Padding, Margin, Radius, Font size, Line height, Letter spacing, Top, Left), a color swatch (Color, Background) or a layout button (Grid columns, Grid rows). The text input stays visible and holds the one stored value: a control reads it and writes into it through the same path as typing and Enter, so a typed value (`var(--accent)`, `calc(...)`, anything), the breakpoint scope, Reset, undo, the brand restriction, Search properties, the canvas menu's field shortcuts, agents and the command line work exactly as before. While a drag is in progress (or a key is held) the input and the element on the canvas show the pending value and nothing is sent; releasing sends one `node.update`, and the canvas keeps the released value until the answer is drawn (a refused value puts the canvas back), so one drag, one click on a choice or one held key is one undo step, and Escape during a drag puts the stored value back. Nothing on the page changes because the pointer rests on a choice. A value the control cannot represent hides the control for that field and is never rewritten: for a slider, anything but one number with a unit the slider knows (two values, `calc()`, `var()`, keywords, unknown units, `!important`); for a swatch, `url()`, several layers, a `var()` that is not a site, brand or team color, a gradient on Color, or anything the browser does not read as a color; for the layout button, named lines, `subgrid`, `none`, `var()`, `calc()`, `fit-content()` and nested `repeat()`. The control's space is kept while it is hidden, so no field moves. A refused value (for example a free color while the brand restriction is on) puts the input back and the status line says why. When the selection or the breakpoint changes during a gesture, the gesture is dropped and nothing is written. While changes to a field are still on their way to the engine, the field never steps back to an older value, a control opened in that time starts from the newest value sent, and when the last answer arrives the field shows what the engine holds, also after a race with a change from outside the window. Ctrl/Cmd+Z and Ctrl/Cmd+Shift+Z run Undo and Redo with the focus on a slider, a swatch, a gradient stop, a button a control adds (the layout button, the raw switch), the picker's square and bars, a layout in the chooser or a Design list field (since 0.34.0); in a text box (the field's own input, the hex entry, Position, Angle, the number box of Any number of columns) they are that box's own text undo, and a unit list is a form field too, so press Tab or click elsewhere before Ctrl/Cmd+Z. Delete and Backspace on any part a control adds to a field (the swatch, the slider, the unit list, the layout button, the raw switch, the picker and the chooser) never remove the selected element. Since 0.34.0 the same holds for the segment buttons (Display, Direction, Align, Justify, Wrap, Text alignment), the Design list fields and their open list, the try bar, the inspector tab buttons and the section titles (Layout, Typography and the rest), whether trying is on or off. A click on a field's Reset moves the focus to the field's input, list or segment before it writes, so the next Backspace does not land on the hidden Reset link. Sliders: each property has a fixed table of units, each with a fixed range and step that never depend on the value held (Opacity 0 to 1 by 0.01; Width px 0 to 1600, % 0 to 100, rem and em 0 to 100 by 0.25, vw and vh 0 to 100; Height px 0 to 1200; Max width px 0 to 1920; Gap px 0 to 160; Padding px 0 to 200; Margin px -200 to 200; Radius px 0 to 200; Font size px 8 to 96, rem and em 0.5 to 6 by 0.05; Line height unitless 0.8 to 3 by 0.05; Letter spacing px -5 to 20 by 0.1; Top px -200 to 1200; Left px -200 to 1600). A value outside the range puts the thumb at the end and stays as typed. An unset field shows a hollow thumb at a resting place (Opacity 1, Font size 16 px, Line height 1.2, otherwise 0); on Tablet or Mobile an unset field shows the inherited desktop value with a grey thumb, and a drag there writes the breakpoint override. The unit list after the input changes the unit and keeps the number, with no conversion (`12px` becomes `12rem`); on an empty field it only chooses the unit for the next change. On the focused slider the arrow keys step once, Shift or Page Up and Page Down ten steps, Home and End go to the ends; in the input of these 13 fields, Arrow Up and Arrow Down step a single number by the slider's step for its unit (1 for px, 0.25 for rem and em, 0.01 for Opacity, 0.05 for Font size in rem or em and for Line height, 0.1 for Letter spacing in px; Shift ten steps) and keep its unit, limited only by what CSS allows (no negative size, opacity 0 to 1), and do nothing while the field is switched to CSS text. With the unit list closed, an arrow key on it changes the unit at once, one undo step per press. A held key commits once when it is released, or after a 700 ms pause. @@ -111,6 +111,18 @@ The layout button of Grid columns and Grid rows draws the current tracks and ope Each upgraded field has a raw switch at the end of its label (``, "Type Radius by hand" with the field's name): pressed, the field is the plain CSS text input, as before 0.33.0. Preferences > Interface > Design fields, Show in Design fields, sets the default for every field without its own choice, Controls or CSS text, and Use for all fields removes the per-field choices. View > Show controls in Design fields (command `view.design-controls`, checkable, no key) flips that default; its status line says "Design fields show their controls." or "Design fields show the CSS text only.". The choices live in this browser's storage only (`formweb.design-controls`, cleared by Reset All Preferences) and are never saved with the site or the project file. +### Try a choice before keeping it + +The segment groups (Display, Direction, Align, Justify, Wrap, Text alignment) and the eight Design fields that are lists (Align self, Justify self, Object fit, Weight, Capitals, Kerning, Position, Overflow) try a choice before writing it. A click on a segment, or Left, Right, Up, Down, Home or End on a focused segment, shows that value on the canvas only, for the selected element at the picked breakpoint, and a bar under the field, inside the panel and as wide as it, reads "Trying: {name}" (cut with "..." when long, the full text in its tooltip) with Keep (Enter) and Revert (Escape) right-aligned under it; in a panel too narrow for them the key hints are hidden. Nothing is sent to the engine: the revision, undo, other windows, agents and the export see nothing. Keep, or Enter on the segment, the list or the bar, sends one `node.update`, one undo step; a value equal to the stored one sends nothing and ends without a sentence. Revert, or Escape, puts the canvas back, and the status line says "Not kept: {field} is unchanged.". Arrows step from the tried choice without wrapping; Tab goes to Keep, then Revert, and Shift+Tab from Keep back to the choice. The tried segment carries its own outline, while the filled look (`aria-pressed`) still means stored. A click on the stored segment tries no own value ("Trying: Inherit"): the canvas shows the value of the wider breakpoints, or none on Desktop, and Keep removes the value. A list field opens the editor's own list (one `listbox` popover) on a click, Space, Enter, Up, Down or Alt+Down without trying anything; Home, End and a typed letter open it and try the first item, the last item, or the next item starting with that letter. In the open list a click, Up, Down, Home, End or a letter tries an item while the list stays open; the stored item has a tick; Enter or Keep keeps and closes it; Escape, Revert or a pointer press outside reverts and closes it; focus goes back to the field. The select itself keeps the stored value at all times: a program that sets it and fires `change` writes at once, as before. Pointing at a choice or a list item changes nothing on the canvas. + +A trial ends without writing when the selection changes (canvas, Layers, Select parent, an agent), the breakpoint or the page changes, Live preview, Preview as published, Home or a dialog opens, focus moves to anything outside the field, its list and the bar (Tab past Revert, a click in another field), another field's trial or a slider, color or gradient drag starts, the field's section folds, the inspector tab changes or the property search filters the field away, or trying is turned off. A command run while a trial is shown (a menu item, a shortcut, a toolbar button, Reset, the command palette) reverts it first and then runs on the stored values; Copy, Save, Search commands and `view.try-choices` itself leave it alone. Undo during a trial (Ctrl/Cmd+Z, the toolbar Undo button, Edit > Undo) only reverts it: nothing is undone, also while the keys are held. Scrolling, the wheel, a press on empty panel space and another app taking the focus leave the trial on. An outside change (an agent, another window) to the same property of the same element at the picked breakpoint, or the element's removal, drops the trial with "The element was changed elsewhere, so the trial was dropped."; any other outside change leaves it drawn over the new state. While Keep waits for the engine the canvas keeps the tried value, the bar shows a ring and both buttons are disabled, and further keys and clicks on that field do nothing; a selection change in that time hides the bar at once and the command still lands on the first element; a refusal puts the canvas back and shows the engine's sentence. With several elements selected, the trial shows on the last picked one only. + +Preferences > Interface > Design fields, Try choices on the page before keeping them (on at first), and View > Try choices before keeping them (command `view.try-choices`, checkable, no key; status "A clicked choice now shows on the page until you press Keep." or "Clicked choices are now written at once.") switch this off and on. With it off, a segment click and a list pick write at once as in 0.33.0, and the list fields are the browser's own selects. The choice lives in this browser's storage only (`formweb.try-choices`, cleared by Reset All Preferences) and is never saved with the site. Sliders, the color picker and gradient stops show their value on the canvas while dragged whichever way it is set. Hover outlines are off while a trial or a drag value is on the canvas. + +### Motion presets on the canvas + +A click on a preset in Motion > Presets sets it with the same command as before (one undo step) and then plays it once on the canvas, computed in the editor frame by frame from the stored entry (`from`, duration, delay, easing, stagger, children), with no script, style sheet, animation or transition added to the canvas document; the canvas policy is unchanged. The last frame equals the stored state, so nothing is left on the element. Fade up, Fade in, Scale in, Blur in, Slide from left, Slide from right and Stagger children play; Spin and Float play one short cycle (at most 2 s) and end where they began. Play again, under the presets, replays the selected element's reveal or loop without writing anything. Split words, Split characters, Typewriter, Count up, Marquee left and right, Tilt, Follow pointer and the classic effects are set but not shown on the canvas; when the element has motion and none of it can be played on the canvas, Play again is disabled and the line under it says "This effect plays in Preview and on the published site.", and when something can be played the line is empty. Under `prefers-reduced-motion: reduce` nothing plays, Play again is disabled and the line says "Your system asks for reduced motion, so nothing is played here.". Playback stops at once, and the element shows its stored look, on a selection, breakpoint or page change, Live preview or Preview as published, another preset or Play again, any change to the site (an undo, an outside edit, the element's removal) and a reduced-motion switch. A stored entry is played within bounds: duration, delay and stagger 0 to 10 s each, a whole playback at most 20 s, at most 100 staggered children. Blur in shows as active once set (before 0.34.0 it never did). + ### Search properties The right panel has a search field between its tabs and its fields. Click it, or press `Ctrl+Alt+F` (`Cmd+Option+F` on macOS; Window > Search properties, command `inspector.search`), which also opens the right panel when it is collapsed. Type a word and the panel shows one list of matches from every tab at once (Design, Motion, Content and Page), grouped as tab > section, for example Design > Appearance with Background, Radius and Shadow under it. diff --git a/docs/guide/03-canvas.md b/docs/guide/03-canvas.md index 9645a872..74bba9c6 100644 --- a/docs/guide/03-canvas.md +++ b/docs/guide/03-canvas.md @@ -70,7 +70,7 @@ To put elements side by side or in columns, select their container and choose ** Rest the mouse on a row in the Layers list and its element gets a light orange outline on the canvas, thinner and paler than the selection outline. Rest it on an element on the canvas and the element gets the same outline, and its row in the Layers list is tinted. Nothing scrolls and nothing is selected; move the mouse away and the outline goes. The selected element and the page itself never get a hover outline. -Hover outlines do not show while you drag, edit text, have a menu or Quick insert open, or are in Preview, and a touch or a pen never draws them. **View > Show hover outlines** turns them off, and on again. They are on at first, stay as you left them in this browser and are never saved with the site. +Hover outlines do not show while you drag, edit text, have a menu or Quick insert open, try a choice in the right panel (see [Try a choice before keeping it](04-right-panel.md#try-a-choice-before-keeping-it)), or are in Preview, and a touch or a pen never draws them. **View > Show hover outlines** turns them off, and on again. They are on at first, stay as you left them in this browser and are never saved with the site. ### On a touch screen or with a pen diff --git a/docs/guide/04-right-panel.md b/docs/guide/04-right-panel.md index 86a9029d..76090d01 100644 --- a/docs/guide/04-right-panel.md +++ b/docs/guide/04-right-panel.md @@ -19,6 +19,58 @@ With a Page script selected (a script imported without HTML of its own), the pan Many fields show a grey placeholder such as Auto / inherit. That means the element has no value of its own and uses what it inherits. A field you have set gets a **Reset** link that removes your value again. +## Try a choice before keeping it + +In the Design tab, a click on a choice puts it on the page first, without saving it. You see how it looks, then keep it or put the page back. This works in the groups of buttons (**Display**, **Direction**, **Align**, **Justify**, **Wrap** and **Text alignment**) and in the fields that are lists (**Align self**, **Justify self**, **Object fit**, **Weight**, **Capitals**, **Kerning**, **Position** and **Overflow**). + +1. In Coldmere, click the paragraph under the big heading on the home page, the one that begins Boiler servicing, repairs. The panel shows **Hm lead**. +2. In the Typography section, find **Text alignment** and click **Center**. The paragraph is centered on the page, and a bar under the field, as wide as the panel, says **Trying: Center**, with **Keep** and **Revert** under that. + +![Coldmere's home page with the paragraph Boiler servicing, repairs... centered on the canvas; in the right panel, Text alignment has Center outlined as the choice being tried, the group has a dashed outline, and the bar under it reads Trying: Center on its first row and Keep Enter, Revert Escape on the second](images/panel-try-bar.webp) + +3. Press the Right arrow key. The paragraph is aligned to the right and the bar says **Trying: Right**. Press it again for **Justify**. Nothing has been saved yet: the revision number at the right end of the status line stays the same. +4. Press Enter, or click **Keep**. The choice is saved, as one undo step, and the bar goes. Ctrl+Z (Cmd+Z on a Mac) takes it back. +5. Click **Center** again, then press Escape, or click **Revert**. The paragraph is as it was, and the status line says "Not kept: Text alignment is unchanged." + +More about trying a choice: + +- Left and Right (or Up and Down) try the next or the previous choice, and Home and End the first and the last. Tab goes from the choices to **Keep**, then to **Revert**. +- The choice being tried has an outline of its own. The saved choice keeps its filled look, so you always see both. +- Click the choice that is already saved to try the field with no value of its own: the bar says **Trying: Inherit**, and the page shows what the element would get without it (on Tablet or Mobile, the value from a wider breakpoint). **Keep** then removes the value. +- Moving the pointer over the choices changes nothing. Only a click or a key tries a choice. +- On a slow computer, after **Keep** the page keeps showing your choice while it is being saved, and the bar shows that it is waiting. +- **Keep** on the choice that is already saved saves nothing and simply closes the bar. +- The bar always stays inside the right panel. A long name ends in "..." (point at it to read all of it), and in a narrow panel the key names next to Keep and Revert are left out. + +### In a list + +1. Click the house picture on the home page. The panel shows **Hm hero img**. +2. In the Appearance section, click **Object fit**. A list opens under it; the saved item, **Inherit**, has a tick. +3. Click **contain**. The picture shows it on the page, the bar says **Trying: contain**, and the list stays open, so you can try another. + +![The Object fit list open under the field: Inherit with a tick, cover, contain outlined as the item being tried, and fill; the field itself still reads Inherit, and the bar under the list, across the panel, reads Trying: contain with Keep Enter and Revert Escape under it](images/panel-try-list.webp) + +4. Press Down to try the next item, or type a letter to jump to the next item that starts with it. Press Enter, or click **Keep**, to keep it; the list closes and the field shows it. Press Escape, click **Revert**, or click outside the list to put the page back. + +The field shows the saved value until you keep a choice. With the focus on the field, Space, Enter, Up, Down or Alt+Down opens the list without trying anything. + +### What ends a trial + +Keep and Enter save the choice. These put the page back and save nothing: + +- Revert or Escape. +- Selecting another element, on the canvas, in Layers or with Select parent. +- Picking another breakpoint or page, turning on the Live responsive preview, or opening Preview as published, Home or a dialog. +- Clicking into another field or pressing Tab past Revert, trying a choice in another field, or starting to drag a slider. +- Undo (Ctrl+Z or Cmd+Z, the Undo button in the top bar, or **Edit > Undo**). During a trial, Undo only puts the page back; nothing earlier is undone. The next Undo undoes as usual. +- Any other command, such as Duplicate or the field's **Reset**. The page is put back first, then the command runs. + +Scrolling the page or the panel, a click on empty space in the panel, and switching to another app leave the trial on, so you can look at it. Save and Search commands leave it on too. If the assistant or another window changes the same field of the same element while you are trying a choice, the trial ends and the status line says "The element was changed elsewhere, so the trial was dropped." + +### Turn trying off + +Open **Edit > Settings...** (Ctrl+, or Cmd+, on a Mac), click **Interface**, and clear **Try choices on the page before keeping them** under Design fields; **View > Try choices before keeping them** does the same from the menu. With it off, a click on a choice, or a pick in a list, is saved at once, and the lists are the browser's own. The setting is kept in this browser only and is never saved with the site. + ## Sliders, color pickers and layout choosers You do not have to type CSS to style an element. Seventeen fields in the Design tab have a control beside their text box: a slider, a color swatch or a layout button. @@ -28,8 +80,8 @@ The text box always stays. What it holds is the value that is saved and exported A few things are true of every control: - **One change is one undo step.** One drag, one click on a color or a layout, or one key held down is one step. Ctrl+Z (Cmd+Z on a Mac) takes it back, also while the focus is still on the slider, the swatch, a stop, a button, the picker's square or bars, or a layout in the chooser. In a text box, Ctrl+Z undoes your typing in that box. From a unit list, press Tab (or click elsewhere) first. -- **Delete is safe.** While the focus is on a swatch, a slider, a unit list, a layout button, the `` switch, or anything inside the color picker or the layout chooser, Delete and Backspace never remove the selected element. -- **Nothing happens on the page until you let go or click.** While you drag, the text box shows the new value; the value is kept when you release the mouse button. Press Escape during the drag to keep the old value. Resting the pointer on a choice changes nothing. +- **Delete is safe.** While the focus is on a swatch, a slider, a unit list, a layout button, the `` switch, or anything inside the color picker or the layout chooser, Delete and Backspace never remove the selected element. The same holds for the choice buttons (such as Display), the lists described above, the Keep and Revert bar, the Design, Motion, Content and Page tabs, and the section titles such as Layout and Typography. After a click on a field's **Reset**, the focus moves to that field. +- **The page follows the drag, and the value is kept when you let go.** While you drag (or hold an arrow key), the text box and the element on the page show the new value; nothing is saved until you release the mouse button or the key. Press Escape during the drag to put the old value back, on the page too. Resting the pointer on a choice changes nothing. - **A value the control cannot show is left alone.** If the field holds something the control cannot draw, such as two values (`8px 16px`), `calc(...)` or a word such as `auto`, the control hides and the text box holds the value exactly as typed. The control comes back as soon as the field holds a value it can show. Nothing in the panel moves when this happens. ### Sliders and units @@ -40,7 +92,7 @@ A few things are true of every control: 1. In Coldmere, click the house picture on the home page. The panel shows **Hm hero img**. 2. In the Appearance section, find **Radius**. It reads `28px`. -3. Drag the slider's thumb to the right. The text box counts up as you drag; the picture's corners change when you let go. +3. Drag the slider's thumb to the right. The text box counts up and the picture's corners grow rounder as you drag; the new radius is kept when you let go. 4. Press Ctrl+Z (Cmd+Z on a Mac). The radius is `28px` again. More about sliders: @@ -65,7 +117,7 @@ More about sliders: What the picker holds, from top to bottom: -- **The square** sets how strong and how light the color is: drag in it, or click. +- **The square** sets how strong and how light the color is: drag in it, or click. While you drag in the square or along the bars, the element on the page shows the color; it is kept when you let go. - **The rainbow bar** sets the hue, and **the bar under it** sets the opacity, from see-through on the left to solid on the right. When the field has no color yet, or holds black, white or a grey, a click on the rainbow bar gives that hue at once, fairly strong and light, which you can then adjust in the square. - **The text box** next to the small chip takes a color code: type `#5b4636`, `5b4636` or `rgb(91, 70, 54)` and press Enter. - **The eyedropper button** at the end of that row (tooltip Pick a color from the screen) lets you click anywhere on your screen to take its color. It is there only when your browser or system offers it. @@ -90,7 +142,7 @@ The picker of **Background** has two tabs at the top: **Solid** and **Gradient** What you can do in the tab: - **Linear** or **Radial**: a gradient along a line, or out from a point. -- **The bar** shows the gradient with a handle for each stop. Click the bar to add a stop, drag a handle to move it, and click a handle to select it. **Position** shows where the selected stop sits, in percent. +- **The bar** shows the gradient with a handle for each stop. Click the bar to add a stop, drag a handle to move it (the page shows the gradient as you drag), and click a handle to select it. **Position** shows where the selected stop sits, in percent. - **Add stop** (the + button) adds a stop and **Remove stop** (the bin button) removes the selected one. A gradient always keeps at least two stops. - **The square and bars** under the bar set the selected stop's color, as on the Solid tab. - **Angle** (in degrees) and the eight arrows set the direction of a linear gradient. A radial gradient offers **Circle** or **Ellipse** there instead. @@ -125,6 +177,22 @@ To choose for every field at once, open **Edit > Settings...** (Ctrl+, or Cmd+, These choices are kept in this browser only. They are never saved with the site, and they never change a value. +## Motion presets + +The **Presets** section at the top of the Motion tab sets a movement for the selected element with one click, and shows it to you on the page. + +1. In Coldmere, click the heading Warm rooms, working taps, no fuss., then click the **Motion** tab. +2. Under **Presets**, click **Fade up**. The preset is set, as one undo step, and the heading plays it once on the page: it starts faint and a little lower and ends exactly as it was. +3. Click **Play again**, under the presets, to watch it once more. Play again saves nothing. +4. Press Ctrl+Z (Cmd+Z on a Mac) to take it back. A click on a preset that is set also removes it. +5. Click **Split words**. It is set, but it does not play on the canvas: **Play again** is off, and the line under it says "This effect plays in Preview and on the published site." + +![The Presets section of the Motion tab for Hm h1: Split words is marked as set; under the presets and the Classic effects sits the Play again button, greyed out, and under it the sentence This effect plays in Preview and on the published site.](images/panel-motion-presets.webp) + +**Fade up**, **Fade in**, **Scale in**, **Blur in**, **Slide from left**, **Slide from right** and **Stagger children** play on the page. **Spin** and **Float** show a short loop and stop where they began. The other presets and the classic effects (such as **Split words**, **Typewriter**, **Count up** or **Parallax**) are set as usual but do not play on the canvas; watch them in [Preview](06-preview.md). The line under Play again names this only when nothing the element has can be played on the canvas. When it also has a preset that plays, Play again plays that one and the line stays empty. + +Selecting another element, picking another breakpoint or page, turning on Preview, Undo, another preset, or a change made by the assistant stops a preset that is playing, and the element shows its saved look at once. When your system asks for reduced motion, nothing plays, Play again is off, and the line says "Your system asks for reduced motion, so nothing is played here." + ## Search properties You do not have to know which tab or section holds a setting. Type its name in **Search properties**, the field under the tabs (or press Ctrl+Alt+F, Cmd+Option+F on a Mac). diff --git a/docs/guide/11-keyboard-shortcuts.md b/docs/guide/11-keyboard-shortcuts.md index 8c990a56..daee9724 100644 --- a/docs/guide/11-keyboard-shortcuts.md +++ b/docs/guide/11-keyboard-shortcuts.md @@ -104,6 +104,12 @@ These keys belong to the Pages and Layers lists, menus and text fields rather th | Escape | Select several is on | Turn it off and keep the selection | | Up, Down, Enter | Quick insert, Search properties | Move through the list and choose | | Escape | Preview as published | Close it | +| Left, Right (or Up, Down), Home, End | A choice button in the Design tab, such as Center in Text alignment | Try the next or previous choice, or the first or last, on the page without saving it | +| Space, Enter, Up, Down, Alt+Down | A Design field that is a list, such as Weight or Object fit | Open the list without trying anything | +| Up, Down, Home, End, a letter | The open list of a Design field | Try that item on the page; the list stays open | +| Enter / Escape | A choice being tried: on the choice, in the list, or on the Keep and Revert bar | Keep it (one undo step) / put the page back | +| Tab | A choice being tried | Go to Keep, then Revert; Tab from Revert moves on and puts the page back | +| Ctrl+Z (Cmd+Z on a Mac) | While a choice is being tried | Put the page back; nothing earlier is undone | | Left, Right (or Up, Down), Home, End | A slider under a Design field | One step, or the lowest or highest value; Shift with an arrow moves ten steps. A key held down is one undo step | | Up, Down | The text box of a Design field with a slider, holding one number such as `12px` | Step by one slider step and keep the unit (`12px` to `13px`, `1rem` to `1.25rem`, `0.5` to `0.51` for Opacity); with Shift, ten steps. Not while the field is switched to CSS text | | Escape | While dragging a slider, or in the color picker during a drag | Put the old value back | @@ -112,8 +118,8 @@ These keys belong to the Pages and Layers lists, menus and text fields rather th | Arrow keys, Enter, Space | The layout chooser of Grid columns or Grid rows | Move between the layouts and choose one | | Arrow keys, Home, End, Delete | A stop handle on the Gradient tab | Move the stop (Shift for 10 %), send it to an end, remove it | | Escape | The color picker or the layout chooser | Close it and go back to its button | -| Ctrl+Z, Ctrl+Shift+Z (Cmd on a Mac) | A slider, a swatch, a gradient stop, a button of a control (such as the layout button or the `` switch), the color picker's square and bars, or a layout in the chooser | Undo and Redo, as anywhere else. In a text box they undo typing in that box; from a unit list, press Tab or click elsewhere first | -| Delete, Backspace | Any part of a control, as above | Nothing happens to the selected element (on a gradient stop, the stop is removed) | +| Ctrl+Z, Ctrl+Shift+Z (Cmd on a Mac) | A slider, a swatch, a gradient stop, a button of a control (such as the layout button or the `` switch), the color picker's square and bars, a layout in the chooser, or a Design field that is a list, such as Weight | Undo and Redo, as anywhere else. In a text box they undo typing in that box; from a unit list, press Tab or click elsewhere first | +| Delete, Backspace | Any part of a control, as above, a choice button such as a Display choice, a Design list and its open list, the Keep and Revert bar, the Design, Motion, Content and Page tabs, or a section title such as Layout | Nothing happens to the selected element (on a gradient stop, the stop is removed) | ## Next diff --git a/docs/guide/README.md b/docs/guide/README.md index e738bbf3..671fdbe2 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -37,7 +37,7 @@ A demo opens as a new site that is not saved yet. Your saved projects are not to 1. [Your first site](01-first-site.md): from an empty page to an exported zip, every step pictured. Start here. 2. [Pages and layers](02-pages-and-layers.md): add, rename, reorder and fold pages and layers, set the home page, select several layers at once. 3. [Working on the canvas](03-canvas.md): select, the right-click menu, drag to move, hover outlines, wrap in a container, copy and paste styles. -4. [The right panel](04-right-panel.md): the tabs, sliders, the color picker and gradients, the grid layout chooser, Search properties, and editing a breakpoint. +4. [The right panel](04-right-panel.md): the tabs, trying a choice before keeping it, sliders, the color picker and gradients, the grid layout chooser, motion presets, Search properties, and editing a breakpoint. 5. [Page background and theme colors](05-background-and-theme-colors.md): why a new page is white, the site background every page can share, starting a page with the home page's background, matching another page, one page or all pages, the site's theme colors. 6. [Preview](06-preview.md): Preview as published, and the Live responsive preview on the canvas. 7. [Audit](07-audit.md): what the audit checks and how Select takes you to the problem. diff --git a/docs/guide/images/panel-motion-presets.webp b/docs/guide/images/panel-motion-presets.webp new file mode 100644 index 00000000..dcad60bb Binary files /dev/null and b/docs/guide/images/panel-motion-presets.webp differ diff --git a/docs/guide/images/panel-try-bar.webp b/docs/guide/images/panel-try-bar.webp new file mode 100644 index 00000000..47f3c576 Binary files /dev/null and b/docs/guide/images/panel-try-bar.webp differ diff --git a/docs/guide/images/panel-try-list.webp b/docs/guide/images/panel-try-list.webp new file mode 100644 index 00000000..2ce6e02d Binary files /dev/null and b/docs/guide/images/panel-try-list.webp differ diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 39efc854..bfa285c1 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -1,5 +1,37 @@ # Frontend context map +## Try a choice before keeping it: the trial layer, the try bar, the editor's own list, values shown while dragging, and motion presets played on the canvas · v0.34.0 (2026-11-27) + +The third of five releases (0.32.0 to 0.36.0) that answer the follow-up on issue #36. No engine, model or service change and no new command in the engine: a trial is canvas-only, so the revision, undo, other windows, agents and the export see nothing until Keep. New: `features/try/` (`types.ts`, the contract the lead wrote and nobody else edits; `index.ts`, the kit; `bar.ts`; `segments.ts`; `choice-list.ts`), `features/motion/play.ts`, `styles/try-bar.css`, `styles/try-list.css`, `styles/motion-play.css`. Changed: `ui/canvas.ts` (`setLayer`), `features/inspector/controls/index.ts` (the `trial` option), `features/motion/presets.ts`, `commands/registry.ts` (`intercept`), `commands/keymap.ts`, and in `main.ts` the `installTry({...})` call, one `tryKit.sync()` in `update()`, the Preferences row, `view.try-choices`, `tryKit.busy()` in `installHoverOutline`'s `busy`, `commandRegistry.intercept`, the `trial` option of `installControls`, `breakpoint` and `editing` on the inspector context, and `data-own-keys` on `.inspector-tabs`. + +The canvas layers (`ui/canvas.ts`): `Canvas.setLayer(name, frame)` with `name` `'play'` or `'trial'` and `frame` `{ [nodeId]: { [cssProperty]: string | null } }`, or `null` to clear. `restyle()` (the style block that `patch()` had, moved out unchanged) draws in this order, later wins: the stored styles with the matching breakpoints applied widest first, the scene scrubber's motion frame (`setMotionFrame`, unchanged, still a full `render()`), `play`, `trial`. A layer key first deletes every own key with the same `cssName`, so a camel and a kebab spelling never both apply. `null` means no own value at the picked breakpoint: on the base breakpoint (maxWidth 100000, or none picked) nothing is put back, on a narrower one the value of the wider matching breakpoints without the picked one is. `safeStyle` applies to layer values as to stored ones. `setLayer` returns at once when the frame's JSON equals the last one, stores a deep copy, and before the first render only stores it (the next render draws it). Otherwise it collects, per node id whose entry changed, the union of the property names in the old and the new entry, and calls `restyle(node, key, site, id, scope, only)` on every mounted node of that id (every repeated CMS copy; `:list` keys skipped): `only` limits the writes and removals to those properties, while `this.styles` for the key is still rebuilt in full, so a later full render or a clear leaves no stale inline value. It never calls `render()`, never creates, reorders or reparents a node. Measured at 4x CPU on Lowlight (298 canvas nodes), median per call: equal frame 0 ms, one node 1.9 ms, 30 nodes 9.1 ms, a full `render()` 29.1 ms. Keep that split if you touch `restyle()`, or motion playback becomes a whole-page render per frame. Trap: an element that had no `style` attribute keeps an empty `style=""` after a layer clears (`removeProperty` leaves the attribute); identical on screen, but an exact-attribute test sees it. + +The kit (`features/try/index.ts`, `installTry(options)` once from `main.ts`, created before `installControls` so the control kit can reach it). Options: `scope()` is `||`, `node()`, `exists(id)` (`!!lastState.site.nodes[id]`), `stored(key)` and `inherited(key)` at the picked breakpoint, `editing()` (not Live preview, not Preview as published, no scrim dialog, no demo preview, no feature studio, Home hidden), `setStyle`, `status`, `fields` (`styleFields`) and `segments` (`segmentFields`). One trial at most (`current`). `begin(owner)` retires any trial and returns a `Trial` for `owner.key` on the element and breakpoint on screen; it shows nothing. `put(value, name)` stores the value, redraws the layer, calls `bar.show(owner, name)` and starts the watcher; `''` is drawn as `null`. `draw()` builds one `trial` frame from three sources, in order: live drag values (`lives`, all on one node, `liveNode`), the `landing` set, and `current`. `keep()`: no value yet ends as reverted; a changed scope or node, or design left, ends as dropped; a value equal to the stored one (trimmed) sends nothing and ends quietly (the value is cleared first, so `end('reverted')` prints no "Not kept", and `unsay()` clears the kit's own earlier sentence; before this it printed "Not kept: ..." right after the person pressed Keep); otherwise `pending` is set, focus is moved off the bar, `bar.pending(true)`, and `await options.setStyle(key, value)`. `setStyle` reads `currentNode()` and the breakpoint synchronously, so the one command carries the element and breakpoint of the moment Keep was pressed. Success ends as kept; a rejection ends as refused with the engine's or the editor's sentence as an error ("The change was refused." only when none came). `keep()` never rejects: its body is guarded, and a throw inside ends the trial as dropped. + +Why the layer is cleared in the continuation after `accept()` drew: in `api.ts`, `settle()` runs `accept()`, which runs `update()` (`tryKit.sync()`, then `canvas.render()` with the new stored value) synchronously, before the command's promise resolves. The `await` continuation in `keep()` (`end('kept')`, `draw()`, `setLayer('trial', null)`) therefore runs in the same task as that render, and no frame shows the old value between Keep and the answer. The 409 path loads the newest state before it rejects, so a refusal shows the stored value at once. If `command()` ever defers `accept`, the layer must instead be cleared in the next `sync()`. + +Every ending goes through `entry.end(how, message)` exactly once: `over` is set, the entry leaves `landing`, the bar hides (focus moved off it first), the layer is redrawn, the status line gets the sentence (refused: the message as an error; a given message, today only "The element was changed elsewhere, so the trial was dropped."; reverted with a value shown: "Not kept: {0} is unchanged." with `[{ t: owner.label }]`, so the field name is translated too; kept: the line is cleared only if it still shows the kit's own last sentence, `said`), and then `owner.ended(how)`, inside try/catch with `console.error`, because `sync()` runs in the middle of `update()` and an owner's throw must never stop the canvas and the inspector from following the new state. Who ends what: Keep and Enter call `trial.keep()`, Revert and Escape `trial.revert()` (the owner or the bar). `sync()` from `update()` (`check(true)`): the element no longer exists, dropped with the sentence; scope changed (selection by any path, breakpoint, page) or design left, dropped silently; this key's stored value at this breakpoint differs from the value at `begin` (`base`), dropped with the sentence; any other outside change leaves the trial drawn over the new state. The watcher (`check(false)`, one `requestAnimationFrame` loop while a trial or a live value exists, stopped when neither does) catches design left without an `update()` (Home, a dialog, the full preview) and an anchor that is no longer rendered (a section folded, the inspector tab changed, the property search filtered the field away), which reverts. A capture `focusin` on the document reverts when focus lands outside `owner.anchor`, `owner.inside()` and the bar (not on the body, not in the command palette `.fw-search-pop`). A capture `pointerdown` on the canvas document, attached once after `loaded()` (the kit reads the Canvas's `frame` and `loaded()` the way `hover-outline.ts` does, since `TryCanvas` declares only `setLayer`), reverts a shown, non-pending trial: a press on the element that is already selected changes no selection and focus moving into the iframe fires no `focusin` here, so before this a double-click into the text edited under the tried value. A wheel is not a pointer press and leaves the trial on. Window blur and a `focusout` with no `relatedTarget` do nothing; for the latter, one macrotask later, if the window still has focus and focus is on the body, the kit puts it back on the element that lost it (if still rendered and enabled) or on the anchor, because a press on panel padding blurs the focused segment and Backspace on the body runs `edit.delete`. `begin()` and `live()` retire the trial in progress; `setEnabled(false)` drops it. `drop()`, `active()` and `TryOptions.inherited` exist and nothing calls them. + +Pending Keep and the landing set: a pending entry is never reverted or dropped. `retire()` moves it to `landing`, sets `current` to null and `detached` (the owner's `Trial.over` then reads true, so the owner takes input again), hides the bar and calls `owner.ended('dropped')` once; its value stays drawn on its node until the answer, so the element the command targets never shows the old value. A new `begin()`, `live()`, the switch, `drop()`, and `check()` when the scope changes or design is left while pending all retire. So a selection change during a pending Keep hides the bar at once and frees the field for the new element, and the command still lands on the first element. This differs from contract row 12 (which said the layer is cleared): the kept value stays drawn on the first element until the answer, on purpose. A Keep with no answer after 30 s (`LANDING_MS`) is retired and removed from `landing`, so `busy()` and the hover outlines recover; a late answer still draws and ends it. + +The intercept hook (`commands/registry.ts`): `Commands.intercept`, a nullable `(id) => boolean` set in `main.ts` as `commandRegistry.intercept = id => tryKit.intercept(id)`. Both `run()` and `call()` ask it right after the command lookup and BEFORE the enabled check: `edit.undo` is enabled only with history, and on a freshly opened demo Mod+Z returned before the kit was asked, so the trial stayed. `run()` (keys, menus, toolbar, palette) returns true without running when the hook returns true. `call()` (the agent bridge `runFromBridge`, which `window.formweb.run` also uses) calls the hook for its side effect only and always goes on to the enabled check and the command: a programmatic call is never swallowed, because an agent that sends `edit.undo` to take back its own wrong change would otherwise be told it ran while its change stayed, and would report it undone. The rule inside the kit: `edit.copy`, `file.save`, `view.search` and `view.try-choices` (`PASS`) never touch a trial. For any other id, with a trial on and not pending, the trial is reverted first; for `edit.undo` the hook then returns true when that trial had a value on the page, so a person's Undo only puts the page back and nothing earlier is undone. With no trial, or a pending one, nothing is reverted, so Undo after a pending Keep queues behind it in `api.ts` and undoes the Keep (if that Keep is then refused, the queued undo removes the previous, unrelated change). The toolbar Undo trap: a pointer press on the toolbar Undo button or the Edit menu focuses it first, the `focusin` rule reverts the trial, and when the command then runs the kit finds no trial, so the undo removed the person's previous real change too. Now, when `focusin` reverts a shown trial and focus landed on a command surface (`.fw-menubar`, `.fw-menu`, `.fw-search-pop`, `[data-cmd]`), the kit stores the time (`aimed`); the next `intercept('edit.undo')` within 15 s (`AIMED_MS`) is used up. `aimed` is cleared by any intercept, by `begin()`, by a pointer press or typed input outside the menus and the palette, and by any key press except Mod+Z and the modifier keys. `edit.undo` has `repeat: true`, so once a Mod+Z is used up its auto-repeats are used up too until the key is released (`swallowing`, `repeat`), or holding the keys walked into real history. + +The bar (`bar.ts`, `mountBar(overlay, actions)`): one `div.fw-try-bar` created once in `#overlay-root` with `data-try-bar`, `data-own-keys`, `role="group"`, `aria-label` "Trial" and `tabindex="-1"`; inside, the text "Trying: {0}" (`aria-live="polite"`), Keep and Revert, each with its key from `formatKeys()` (`data-no-i18n`, as menus show keys). It is shown and hidden, never rebuilt, and takes no layout space, so no field moves. `show(owner, name)` unhides first and writes the text after, in the same task and before placement and paint, and `hide()` empties the text: a live region that changes while hidden and appears with its content is not announced, so the first trial was silent. The name goes as `{ t: name }`, so a language switch during a trial translates it. Two rows: "Trying: {0}" fills the top row, cut with an ellipsis, the full text also in its `title` (through `labelAttr`); Keep and Revert sit whole and right-aligned on the second row. Width rule: the width depends only on the panel that holds the owner, the anchor's nearest scrolling parent, or for an anchor in the overlay (the list popover) the scrolling parent of `owner.inside()` (the inspector): panel width minus 6 px on each side, at most the window width minus 16 px, left edge at the panel's left plus 6 px. It is set when a bar is shown for an owner and again only when the panel's width or left edge changes, never on a name change, so arrow keys never move the bar; at that moment, if the content overflows, `is-tight` hides the key hints (both buttons stay whole; seen in German and Russian at a 900 px window, panel 235 px). The pending ring is centered over the whole Keep button, whose text turns transparent while waiting, so no box changes. Placement (`place()`, before the frame is painted): below the box of the anchor together with `owner.inside()` (6 px gap), above when there is more room there, clamped 8 px inside the window; when the anchor has scrolled out of its scrolling parent, pinned to that parent's visible edge. While shown, passive capture `scroll` and `resize` listeners place it again once per animation frame, and a repeat `show()` for the same owner changes only the text and moves only if the anchor box or the bar's width changed. `pending(true)` moves focus off a button that is about to be disabled (to the bar root; a disabled focused button sends focus to the body), sets `aria-busy`, disables both buttons, and after 300 ms shows the ring over Keep (see the width rule above). Focus fallbacks in `hide()` (`rescue()`, only when focus is in the bar): the anchor if it is focusable, else the owner's tried button, else its pressed one, else its first focusable; only when the owner is not rendered, the active inspector tab button. It never walks the page for "the next focusable", which landed on a Reset link, where Backspace still runs `edit.delete`. Keys: Escape anywhere in the bar reverts, Enter on Keep keeps, Tab on Revert or the root calls `leave(true)`, Shift+Tab on Keep `leave(false)` (back to the owner's anchor). + +Segment groups (`segments.ts`, `installSegments`): every group in `segmentFields` (Display, Direction, Align, Justify, Wrap, Text alignment). A capture-phase `click` listener on the group runs before the button's own target-phase listener; when `kit.enabled()` it calls `stopPropagation()` and `preventDefault()`, which is what keeps the 0.33.0 write from running, and starts or moves the trial; with the switch off it returns and the old write runs unchanged. Space is left to the native button click and so goes through the same listener. A click on the stored value tries `''` named "Inherit" (the word the selects use for their empty option; "None" read as hiding the element in Display); a click on the tried value keeps trying it. Arrows step from the tried choice, else the stored one, without wrapping, Home and End go to the ends, and focus follows; an arrow that lands on the stored value with no trial on tries nothing. Enter keeps, Escape reverts, Tab with a trial focuses Keep, Delete and Backspace are swallowed, and while pending every key and click is ignored. The marks are `data-trying` on the tried button and on the group (`"unset"` while `''` is tried); `is-on`, `is-inherited` and `aria-pressed` keep meaning stored and are never touched, so `update()` never has to know about trials. Each group gets `data-own-keys` and `tabindex="-1"` once at install, whatever the switch: the kit rescues focus with `owner.anchor.focus()`, a div is not focusable, and the group's `focus` handler forwards to the tried, else the pressed, else the first button (without it, Shift+Tab from Keep left focus in the bar and a hide after Keep could drop it on the body). Side effect, also with the switch off: Delete and Backspace on a segment no longer run `edit.delete`, and Escape on it no longer reaches the editor. `ended()` clears the marks and moves focus only when the focused button is no longer rendered: to the pressed or first rendered segment, else the active inspector tab. + +The choice list (`choice-list.ts`, `installChoiceLists`): every `