Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


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

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

# FormWeb Harness
Expand Down
2 changes: 1 addition & 1 deletion .docs/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

| Surface | Current boundary |
| --- | --- |
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.37.0 · 2026-11-30

- Menus in the menu bar always open just under their button and are at most three quarters of the window tall; what does not fit scrolls. Before, in a short window a menu could be moved up over the menu bar.
- Submenus, and the menus that open beside More menus when the bar is narrow, never go above the menu bar's bottom edge and take the same limit. They still open beside their row. Before, a long one could start at the top of the window, over the bar.
- Right-click menus (layers, pages and the canvas) still open at the pointer, but never above the menu bar and at most three quarters of the window tall; the same holds for the menu of hidden levels in the path above the canvas. Before, a long one could cover the menu bar.
- A menu that is cut off fades out at its bottom and shows a small pill with a down arrow while rows remain below. The pill is there as soon as the menu opens, goes away at the last row and comes back when you scroll up. With reduced motion it shows and hides without fading. A menu that fits shows nothing.
- The arrow keys, Home and End keep the chosen row in view and above the fade.
- Settings > About shows the licence texts of everything FormWeb ships, and the installers carry the same file.
- Agent Connect in the installed app writes client entries that reach the running app at its own address, and an Antigravity entry that needs a token it does not have is shown as changed, with the reason. On Windows, agent programs installed with npm start without cmd.exe, and starts that would go through cmd.exe with characters it would change are refused.
- The installed app accepts requests only from its own window by default.
- Agents: `send_to_formpublisher` works again, and a batch that replaces the whole site waits for approval when Agent Connect is set to ask.
- Known gaps: the right-click menus were not measured in a browser for this release, because they need an open site; the menu bar menus were. Type-ahead in a menu bar menu (typing a row's first letters) can leave the row inside the fade. The pickers beside the Design fields (the list fields, the color picker, the grid chooser) and the insert flyout keep their own size limits. Nothing of the menu change was run in the desktop app, on Windows or macOS, in Firefox or Safari, or with a screen reader.

## 0.36.0 · 2026-11-27

- The fifth of five releases that answer the follow-up on issue #36: imports that keep their look.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
<img alt="version 0.36.0" src="https://img.shields.io/badge/version-0.36.0-eef0f4?style=flat-square">
<img alt="version 0.37.0" src="https://img.shields.io/badge/version-0.37.0-eef0f4?style=flat-square">
<img alt="TypeScript 7" src="https://img.shields.io/badge/TypeScript-7-3178c6?style=flat-square&logo=typescript&logoColor=white">
<img alt="Rust engine" src="https://img.shields.io/badge/Rust-engine-b7410e?style=flat-square">
<img alt="macOS, Linux, Windows" src="https://img.shields.io/badge/macOS%20%C2%B7%20Linux%20%C2%B7%20Windows-native-2f7bf5?style=flat-square">
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.36.0
0.37.0
2 changes: 1 addition & 1 deletion backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if FROZEN:
ROOT.mkdir(parents=True, exist_ok=True)
load_dotenv(ROOT / 'backend' / '.env')
VERSION = '0.36.0'
VERSION = '0.37.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)))
Expand Down
24 changes: 24 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Frontend context map

## Menus keep under the menu bar, take a three-quarter cap and show a more-below hint · v0.37.0 (2026-11-30)

FORM-MENU-OVERLAP-FIX 1.2.0 (FormVis 2.8.3 and 2.8.4), ported. No engine, service or command change. Changed: `ui/context-menu.ts`, `ui/shell.ts` (`Menubar`), `styles/shell.css`, and one selector in `tests/unit/ui/context-menu.test.ts`.

The fault. `Menubar.place` capped a bar menu at `innerHeight - 4 - top` with a 120 px floor, so with less than 124 px of room under the bar the floor pushed the menu past the window and the `Math.min(top, ...)` then moved it up over the bar. Submenus (`beside`, including the folded menus that open beside More menus) had no inline cap at all, only the stylesheet's `calc(100vh - 8px)`, and were clamped to 4 px from the window top, so a long one covered the bar. `showContextMenu`'s `place` (layer, canvas, page and crumbs menus) also clamped to 4 px from the window top with the same stylesheet cap. Removed from `Menubar.place`:

```ts
view.popup.style.maxHeight = beside ? '' : `${Math.max(120, Math.floor(window.innerHeight - 4 - top))}px`;
const y = Math.min(top, window.innerHeight - 4 - height);
if (y !== top) view.popup.style.top = `${Math.max(4, Math.round(y))}px`;
```

and from `place` in `ui/context-menu.ts`:

```ts
menu.style.top = `${Math.round(Math.max(EDGE, top))}px`;
```

Now. `menuCap(top)` is `min(75% of innerHeight, innerHeight - top - 4)`, never negative. `barFloor()` is the bottom of `.fw-menubar` plus 4, or 4 when the bar has no box (the macOS system menu hides it with width 0, hence the width test as well as the height). A bar menu keeps `top` (button bottom + 4) and takes `menuCap(top)`, so it is never moved. A submenu and a More cascade entry take `menuCap(barFloor())` and their `y` is clamped to at least `barFloor()`; they still open beside their row. Context menus keep their pointer-corner placement and only take `menuCap(barFloor())` before measuring and `Math.max(floor, top)`. All of it is set while the card is `visibility: hidden` (the Menubar card now gets that too; the context menu already had it).

The hint. Rows move from the card into a `.fw-menu-list` scroller built by `menuCard(className)`; the card keeps `max-height`, the glass and the padding, and holds the list and the pill `.fw-menu-hint` (not `.fw-menu-more`: that class is the More menus button). `showMore(card, list, instant)` sets `has-more` while rows remain below, with `no-fade` around the first call so the hint is in place on the first painted frame; the list's `scroll` listener calls it again. CSS as in the guide, with `--glass-bg` and `--glass-border` for the pill. `keepInView(list, row)` scrolls only the list so a row reached with the arrows, Home or End sits above the fade; the bar's `go()` and the context menu's arrows, Home and End use it and focus with `preventScroll`. Type-ahead in a bar menu still uses the browser's own focus scroll. Both menus close on window resize, so the cap is never stale. `tests/unit/ui/context-menu.test.ts` read the separators from the card's children; it now reads `.fw-menu-list`.

Not changed: `native-menu.ts`, the try list (`.fw-tlist`), the color picker, the grid chooser and the insert flyout, which are pickers anchored to fields rather than menus.

## Settings > About with the third-party notices · unreleased (2026-11-29)

No engine change and no version bump. `backend/HASHOUT_LOG.md` has the file, its generator and `GET /api/notices`. New: `features/third-party-notices.ts` and `styles/third-party-notices.css`; in `main.ts` an `About` entry in `prefsIcons` (the `info` icon) and `prefsAdd('About', prefsGroup('Licences and notices', aboutRows()))` after Plugins.
Expand Down
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "formweb-frontend",
"private": true,
"version": "0.36.0",
"version": "0.37.0",
"type": "module",
"engines": {
"node": ">=22.12.0"
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/styles/shell.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ a.fw-home-action { text-decoration: none; }
.fw-menu-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-menu-keys { color: var(--text-muted); font-size: var(--fs-12); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.fw-menu-sep { height: 1px; margin: 6px 10px; background: color-mix(in srgb, var(--text-primary) 12%, transparent); }
@property --menu-more { syntax: '<number>'; inherits: false; initial-value: 0; }
.fw-menu:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.fw-menu-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; --menu-more: 0; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - min(88px, 40%)), rgb(0 0 0 / calc(1 - var(--menu-more))) calc(100% - min(22px, 10%))); mask-image: linear-gradient(to bottom, #000 calc(100% - min(88px, 40%)), rgb(0 0 0 / calc(1 - var(--menu-more))) calc(100% - min(22px, 10%))); transition: --menu-more 160ms ease-out; }
.fw-menu-hint { position: absolute; left: 50%; bottom: 6px; width: 56px; height: 12px; margin-left: -28px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--glass-border); border-radius: 999px; background: var(--glass-bg); color: var(--text-secondary); pointer-events: none; opacity: 0; transition: opacity 160ms ease-out; }
.fw-menu-hint svg { width: 12px; height: 8px; }
.fw-menu.has-more > .fw-menu-list { --menu-more: 1; scroll-padding-block-end: min(88px, 40%); transition-duration: 490ms; }
.fw-menu.has-more > .fw-menu-hint { opacity: 1; transition-duration: 490ms; }
.fw-menu.no-fade > .fw-menu-list, .fw-menu.no-fade > .fw-menu-hint { transition: none; }
@media (prefers-reduced-motion: reduce) { .fw-menu-list, .fw-menu-hint { transition: none; } }
.top-actions { display: flex; align-items: center; gap: var(--space-2); }
.top-actions > button { min-height: 0; height: var(--ctl-md); }
.fw-title-tools { position: relative; display: flex; align-items: center; gap: var(--space-2); }
Expand Down
71 changes: 56 additions & 15 deletions frontend/src/ui/context-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,45 @@ export interface MenuOptions {
export interface OpenMenu { element: HTMLElement; close: (restore?: boolean) => void }

const EDGE = 4;
const MENU_SHARE = 0.75;
const MORE_CHEVRON = '<svg viewBox="0 0 12 8"><path d="M1.5 1.5 6 6l4.5-4.5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
let current: OpenMenu | null = null;

export const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(window.innerHeight - top - EDGE)));

export function barFloor(): number {
const bar = document.querySelector('.fw-menubar')?.getBoundingClientRect();
return bar && bar.width > 0 && bar.height > 0 ? bar.bottom + EDGE : EDGE;
}

export function showMore(card: HTMLElement, list: HTMLElement, instant = false): void {
const more = !card.hidden && list.scrollHeight - list.clientHeight - list.scrollTop > 1;
if (instant) card.classList.add('no-fade');
card.classList.toggle('has-more', more);
if (instant) { void getComputedStyle(card.lastElementChild ?? card).opacity; card.classList.remove('no-fade'); }
}

export function menuCard(className: string): { card: HTMLElement; list: HTMLElement } {
const card = element('div', className);
card.setAttribute('role', 'menu');
const list = element('div', 'fw-menu-list');
list.setAttribute('role', 'none');
const hint = element('div', 'fw-menu-hint');
hint.setAttribute('aria-hidden', 'true');
hint.innerHTML = MORE_CHEVRON;
card.append(list, hint);
list.addEventListener('scroll', () => showMore(card, list), { passive: true });
return { card, list };
}

export function keepInView(list: HTMLElement, row: HTMLElement): void {
const box = list.getBoundingClientRect();
const at = row.getBoundingClientRect();
const fade = list.parentElement?.classList.contains('has-more') ? Math.min(88, list.clientHeight * 0.4) : 0;
if (at.top < box.top) list.scrollTop -= box.top - at.top;
else if (at.bottom > box.bottom - fade) list.scrollTop += at.bottom - (box.bottom - fade);
}

export function isSeparator(entry: MenuEntry): entry is MenuSeparator {
return 'separator' in entry && entry.separator === true;
}
Expand All @@ -47,27 +84,30 @@ export function anchorOf(event: MouseEvent, fallback: HTMLElement): MenuAnchor {
return event.button < 0 || (event.clientX === 0 && event.clientY === 0) ? fallback : { x: event.clientX, y: event.clientY };
}

function place(menu: HTMLElement, anchor: MenuAnchor): void {
function place(menu: HTMLElement, list: HTMLElement, anchor: MenuAnchor): void {
let x: number;
let y: number;
if (anchor instanceof HTMLElement) {
const box = anchor.getBoundingClientRect();
x = box.left + Math.min(24, box.width / 2);
y = box.bottom;
} else ({ x, y } = anchor);
const floor = barFloor();
menu.style.maxHeight = `${menuCap(floor)}px`;
list.scrollTop = 0;
const size = menu.getBoundingClientRect();
const left = Math.max(EDGE, Math.min(x, window.innerWidth - size.width - EDGE));
const top = y + size.height + EDGE > window.innerHeight && anchor instanceof HTMLElement
? anchor.getBoundingClientRect().top - size.height
: Math.min(y, window.innerHeight - size.height - EDGE);
menu.style.left = `${Math.round(left)}px`;
menu.style.top = `${Math.round(Math.max(EDGE, top))}px`;
menu.style.top = `${Math.round(Math.max(floor, top))}px`;
showMore(menu, list, true);
}

export function showContextMenu(entries: readonly MenuEntry[], anchor: MenuAnchor, options: MenuOptions): OpenMenu {
current?.close(false);
const menu = element('div', 'fw-menu' + (options.className ? ' ' + options.className : ''));
menu.setAttribute('role', 'menu');
const { card: menu, list } = menuCard('fw-menu' + (options.className ? ' ' + options.className : ''));
menu.style.left = '0px';
menu.style.top = '0px';
menu.style.visibility = 'hidden';
Expand All @@ -86,20 +126,21 @@ export function showContextMenu(entries: readonly MenuEntry[], anchor: MenuAncho
const outside = (down: Event): void => { if (!menu.contains(down.target as Node)) close(false); };
const blur = (): void => close(false);
const enabled = (): HTMLButtonElement[] => items.filter(item => !item.disabled);
const reach = (row: HTMLButtonElement | undefined): void => { if (!row) return; row.focus({ preventScroll: true }); keepInView(list, row); };
const move = (step: number): void => {
const list = enabled();
if (!list.length) return;
const at = list.indexOf(document.activeElement as HTMLButtonElement);
const next = at < 0 ? (step > 0 ? 0 : list.length - 1) : (at + step + list.length) % list.length;
list[next].focus({ preventScroll: true });
const rows = enabled();
if (!rows.length) return;
const at = rows.indexOf(document.activeElement as HTMLButtonElement);
const next = at < 0 ? (step > 0 ? 0 : rows.length - 1) : (at + step + rows.length) % rows.length;
reach(rows[next]);
};
const keys = (event: KeyboardEvent): void => {
if (event.key === 'Escape') close();
else if (event.key === 'Tab') { close(false); return; }
else if (event.key === 'ArrowDown') move(1);
else if (event.key === 'ArrowUp') move(-1);
else if (event.key === 'Home') enabled()[0]?.focus({ preventScroll: true });
else if (event.key === 'End') enabled().at(-1)?.focus({ preventScroll: true });
else if (event.key === 'Home') reach(enabled()[0]);
else if (event.key === 'End') reach(enabled().at(-1));
else if (event.key === 'Enter' || event.key === ' ') {
const focused = document.activeElement;
if (focused instanceof HTMLButtonElement && menu.contains(focused) && !focused.disabled) focused.click();
Expand All @@ -109,7 +150,7 @@ export function showContextMenu(entries: readonly MenuEntry[], anchor: MenuAncho
};
for (const entry of entries) {
if (isSeparator(entry)) {
if (menu.lastElementChild && !menu.lastElementChild.classList.contains('fw-menu-sep')) menu.append(element('div', 'fw-menu-sep'));
if (list.lastElementChild && !list.lastElementChild.classList.contains('fw-menu-sep')) list.append(element('div', 'fw-menu-sep'));
continue;
}
const on = entry.enabled !== false;
Expand All @@ -135,14 +176,14 @@ export function showContextMenu(entries: readonly MenuEntry[], anchor: MenuAncho
const action = entry.run;
if (options.run) void options.run(action); else action();
});
menu.append(row);
list.append(row);
items.push(row);
}
if (menu.lastElementChild?.classList.contains('fw-menu-sep')) menu.lastElementChild.remove();
if (list.lastElementChild?.classList.contains('fw-menu-sep')) list.lastElementChild.remove();
const open: OpenMenu = { element: menu, close };
current = open;
options.host.append(menu);
place(menu, anchor);
place(menu, list, anchor);
menu.style.visibility = '';
document.addEventListener('pointerdown', outside, true);
window.addEventListener('keydown', keys, true);
Expand Down
Loading
Loading