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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

Versions follow `v*.*.*` with dots. Dates are UTC.

## 0.64.0 · 2026-11-30

Menus that are taller than the room under the menu bar. Tried in Chromium on Linux; nothing in this release has run on real Windows or macOS.

- A menu bar menu opens just under its name and never covers the menu bar. It is at most three quarters of the window tall, and the rest of it scrolls. Before, a long menu in a short window was moved up to the top of the window, over File, Edit and the rest of the bar.
- Submenus open beside their row and stay under the menu bar, with the same height limit.
- A menu that is cut off fades out at its bottom and shows a small down arrow while there are more items below. Both go away at the last item and come back when you scroll up. A menu that fits shows nothing.
- The canvas menu, the layer menu, the panel menus and the other menus that open where you click still open at the pointer, but no longer cover the menu bar, take the same height limit and show the same hint.
- Not in this release: the toolbar's tool flyouts are unchanged, so a very long list of hidden tools in a short window can still reach the top of the window. The three demos are not rebuilt and still say 0.59.0, because their build stops on the text shaping library.

## 0.63.0 · 2026-11-26

What 0.62.0 listed as not in the release under issue 17, and the small things found on the way. Tried in a Chromium window on Linux, on public PDFs and PDFs made here, against the browser's own drawing of the same text, and for the Windows launchers under Wine; nothing in this release has run on real Windows or macOS, and no real input method was used.
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.63.0" src="https://img.shields.io/badge/version-0.63.0-eef0f4?style=flat-square">
<img alt="version 0.64.0" src="https://img.shields.io/badge/version-0.64.0-eef0f4?style=flat-square">
<img alt="TypeScript and Vite" src="https://img.shields.io/badge/TypeScript%20%2B%20Vite-vanilla-3178c6?style=flat-square&logo=typescript&logoColor=white">
<img alt="Python and FastAPI" src="https://img.shields.io/badge/Python%20%2B%20FastAPI-engine-009688?style=flat-square">
<img alt="macOS, Windows, Linux" src="https://img.shields.io/badge/macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-native-2f7bf5?style=flat-square">
Expand Down
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.63.0"
__version__ = "0.64.0"
46 changes: 46 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5454,3 +5454,49 @@ About formpath has a closed "Third-party notices" section under the licence line
- logged: v0.63.0 · 2026-11-29

The engine marks the question for an outside agent's file write with `each: true` (backend HASHOUT, the same date). While Outside agents is Allowed the loop answered every `__consent__` itself; it now hands a question with `each: true` to the dialog. `consentOffers` builds the dialog's buttons from the engine's `answers` and never offers Always allow on such a question, and the dialog's note says that writing files asks each time instead of "Each change is one undoable step.", which a written file is not. The shared dock module is unchanged: it already shows only the offered answers.

### src/ui/menu.ts · menu bar dropdowns stay under the bar and take a three-quarter cap
- refers-to: src/ui/menu.ts :: MENU_SHARE, MENU_PAD, menuCap, PopupMenu.floor, PopupMenu.openUnder, PopupMenu.openBeside, MenuBar.open
- kind: fix
- logged: v0.64.0 · 2026-11-30

FORM-MENU-OVERLAP-FIX (guide 1.2.0), from FormVis 2.8.3. `MenuBar.open` placed its dropdowns with `openAt`, the right-click routine: a menu longer than the room under the bar was flipped above its point and clamped to 4 pixels from the window top, over the bar, and the stylesheet cap `calc(100vh - 8px)` was bigger than that room. Submenus clamped to the window top the same way. Removed from `MenuBar.open` and `openBeside`:

```ts
m.menu.openAt(b.left, b.bottom + 4);
const w = this.panel.offsetWidth, h = this.panel.offsetHeight, pad = 4;
const y = Math.max(pad, Math.min(row.top - pad, window.innerHeight - h - pad));
```

The bar now calls `openUnder`, which keeps the top at the button's bottom plus 4, never flips, and sets an inline `max-height` of `menuCap(y)` (the smaller of 75% of the window and the room to 4 pixels above its bottom) while the card is still `visibility: hidden`, so it never paints at the wrong size. `floor` remembers that top; `openBeside` reads the root menu's floor, takes the same cap before measuring and never places a submenu above it, still beside its row. The bar closes its menu on `resize`, which is how the cap follows the window.

### src/ui/menu.ts, src/styles/panels.css · the more-below hint on a cut-off menu
- refers-to: src/ui/menu.ts :: PopupMenu.list, PopupMenu constructor, setItems, openAt, openUnder, openBeside, showMore; src/styles/panels.css :: @property --menu-more, .cv-menu[role="menu"], .cv-menu-list, .cv-menu-more, .has-more, .no-fade
- kind: decision
- logged: v0.64.0 · 2026-11-30

FORM-MENU-OVERLAP-FIX rule 8, from FormVis 2.8.4. The menu is see-through glass, so the fade cannot be a gradient over the rows or a mask on the card: the card (`.cv-menu`) no longer scrolls and holds `.cv-menu-list`, which scrolls and carries the mask, and the pill `.cv-menu-more` (glass tokens, `currentColor` chevron, `pointer-events: none`). `max-height` stays on the card. Removed from the constructor, `setItems` and the three open routines:

```ts
this.panel = el('<div class="cv-menu" role="menu" hidden></div>');
this.panel.addEventListener('scroll', () => this.closeSub(), { passive: true });
this.panel.textContent = '';
this.panel.appendChild(s);
this.panel.appendChild(node);
this.panel.scrollTop = 0;
```

The rows, separators, `textContent` reset, every `scrollTop = 0` and the `scroll` listener now use the list. `showMore(true)` runs while the card is still hidden, with `no-fade` on for one forced style read, so a long menu opens with the hint already in place and never fades in; on scroll it fades out in 160 ms at the last row and back in over 490 ms (the duration of the state being entered). The hint shows only when the root menu has a floor. The flex layout rule is scoped to `.cv-menu[role="menu"]` because `.cv-similar` (similar fonts, `role="listbox"`) also wears `.cv-menu`, keeps its rows directly in the card and must keep scrolling there. Nothing outside `menu.ts` read a menu's children or `scrollTop`. Rows are never rebuilt to measure.

### src/ui/menu.ts · right-click and other menus opened at a point keep under the bar
- refers-to: src/ui/menu.ts :: barFloor, PopupMenu.openAt; callers in src/app.ts (canvas menu, panel tab menu, library menus, Appearance effects menu) and src/ui/layers.ts (layer row menu)
- kind: fix
- logged: v0.64.0 · 2026-11-30

FORM-MENU-OVERLAP-FIX section 3b, from FormVis 2.8.4. `openAt` clamped to 4 pixels from the window top with only the stylesheet's `calc(100vh - 8px)` as a cap, so the canvas menu or the layer row menu opened low in a short window was flipped and pushed up over the menu bar. Removed from `openAt`:

```ts
const top = Math.max(4, Math.min(fitsBelow ? y : y - h, window.innerHeight - h - 4));
```

`openAt` now sets `floor` to `barFloor()` (the bottom of `.cv-menubar` plus 4, or 4 when the bar is hidden for the macOS system menu and has no height), sets `max-height: menuCap(floor)` before measuring, never places the top above the floor, and runs `showMore(true)` before it shows. It still opens at the pointer, flipped left or above when there is no room. Every menu opened at a point in formpath goes through `openAt`, so the canvas menu, the layer row menu, the panel tab menu, the swatch, brush, symbol and graphic style library menus and the Appearance effects menu all get the floor, the cap and the hint, and their submenus follow through `openBeside`. Not changed: `.cv-similar` (similar fonts, opened under its button by its own code, at most ten rows), the dock menu, and the toolbar flyout in `src/ui/rail.ts` (`Rail.place`), which opens beside its tool button, not at the pointer, and has no cap; a very long "more tools" flyout in a short window can still reach above the bar. It is left for its own change.
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": "formpath",
"private": true,
"version": "0.63.0",
"version": "0.64.0",
"description": "formpath · vector illustration editor in the NodeMode style",
"license": "Apache-2.0",
"type": "module",
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/styles/panels.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@
.cv-menu-keys { color: var(--text-muted); font-size: var(--fs-11); font-variant-numeric: tabular-nums; }
.cv-menu-item:hover:not(:disabled) .cv-menu-keys { color: var(--text-on-accent); }
.cv-menu-sep { height: 1px; margin: var(--space-1) var(--space-2); background: var(--border-color); }
@property --menu-more { syntax: '<number>'; inherits: false; initial-value: 0; }
.cv-menu[role="menu"]:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.cv-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; }
.cv-menu-more { 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; }
.cv-menu-more svg { width: 12px; height: 8px; }
.cv-menu.has-more > .cv-menu-list { --menu-more: 1; scroll-padding-block-end: min(88px, 40%); transition-duration: 490ms; }
.cv-menu.has-more > .cv-menu-more { opacity: 1; transition-duration: 490ms; }
.cv-menu.no-fade > .cv-menu-list, .cv-menu.no-fade > .cv-menu-more { transition: none; }
@media (prefers-reduced-motion: reduce) { .cv-menu-list, .cv-menu-more { transition: none; } }

.cv-toast { max-width: 380px; padding: var(--space-2) var(--space-3); background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); color: var(--text-primary); font-size: var(--fs-12); pointer-events: auto; }
.cv-toast.is-error { border-color: var(--danger-fill); color: var(--danger-text); }
Expand Down
59 changes: 47 additions & 12 deletions frontend/src/ui/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@ import type { Commands } from './commands';
export type MenuItem = string | '-' | SubMenu;
export interface SubMenu { label: string; items: MenuItem[] }
const isSub = (i: MenuItem): i is SubMenu => typeof i === 'object';
const MENU_SHARE = 0.75, MENU_PAD = 4;
const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(window.innerHeight - top - MENU_PAD)));
const barFloor = (): number => { const r = document.querySelector('.cv-menubar')?.getBoundingClientRect(); return r && r.height > 0 ? r.bottom + MENU_PAD : MENU_PAD; };

export class PopupMenu {
readonly panel: HTMLElement;
private readonly list: HTMLElement;
private rows: Array<{ id: string; node: HTMLButtonElement }> = [];
private subs: Array<{ sub: SubMenu; node: HTMLButtonElement; menu: PopupMenu }> = [];
private seps: HTMLElement[] = [];
private key = '';
private openSub: PopupMenu | null = null;
private floor: number | null = null;
onClose: (() => void) | null = null;

constructor(private readonly commands: Commands, private readonly parent: PopupMenu | null = null, standalone = false) {
this.panel = el('<div class="cv-menu" role="menu" hidden></div>');
this.panel = el('<div class="cv-menu" role="menu" hidden><div class="cv-menu-list" role="none"></div><div class="cv-menu-more" aria-hidden="true"><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></div></div>');
this.list = q(this.panel, '.cv-menu-list');
document.getElementById('overlay-root')?.appendChild(this.panel);
this.panel.addEventListener('contextmenu', (e) => e.preventDefault());

this.panel.addEventListener('scroll', () => this.closeSub(), { passive: true });
this.list.addEventListener('scroll', () => { this.closeSub(); this.showMore(); }, { passive: true });

if (standalone) document.addEventListener('pointerdown', (e) => { if (this.isOpen && !this.contains(e.target as Node)) this.close(); }, true);
}
Expand All @@ -35,14 +41,14 @@ export class PopupMenu {
this.key = key;
this.closeSub();
for (const s of this.subs) s.menu.panel.remove();
this.panel.textContent = '';
this.list.textContent = '';
this.rows = [];
this.subs = [];
this.seps = [];

this.panel.classList.toggle('has-checks', items.some((i) => typeof i === 'string' && i !== '-' && !!this.commands.get(i)?.checked));
for (const item of items) {
if (item === '-') { const s = el('<div class="cv-menu-sep"></div>'); this.seps.push(s); this.panel.appendChild(s); continue; }
if (item === '-') { const s = el('<div class="cv-menu-sep"></div>'); this.seps.push(s); this.list.appendChild(s); continue; }
if (isSub(item)) {
const node = el<HTMLButtonElement>(`<button class="cv-menu-item cv-menu-sub" role="menuitem" aria-haspopup="menu" type="button"><span class="cv-menu-check"></span><span class="cv-menu-label"></span><span class="cv-menu-keys">${icon('chevronRight', 12)}</span></button>`);
setText(q(node, '.cv-menu-label'), item.label);
Expand All @@ -51,7 +57,7 @@ export class PopupMenu {
node.addEventListener('pointerenter', () => this.showSub(menu, node));
node.addEventListener('click', () => this.showSub(menu, node));
this.subs.push({ sub: item, node, menu });
this.panel.appendChild(node);
this.list.appendChild(node);
continue;
}
const cmd = this.commands.get(item);
Expand All @@ -61,7 +67,7 @@ export class PopupMenu {
node.addEventListener('pointerenter', () => this.closeSub());
node.addEventListener('click', () => { this.root().close(); this.commands.run(item); });
this.rows.push({ id: item, node });
this.panel.appendChild(node);
this.list.appendChild(node);
}
}

Expand All @@ -84,34 +90,63 @@ export class PopupMenu {
}

openAt(x: number, y: number): void {
this.floor = barFloor();
this.refresh();
this.panel.style.visibility = 'hidden';
this.panel.hidden = false;
this.panel.scrollTop = 0;
this.panel.style.maxHeight = `${menuCap(this.floor)}px`;
this.list.scrollTop = 0;
const w = this.panel.offsetWidth, h = this.panel.offsetHeight;

const fitsRight = x + w <= window.innerWidth - 4, fitsBelow = y + h <= window.innerHeight - 4;
const left = Math.max(4, Math.min(fitsRight ? x : x - w, window.innerWidth - w - 4));
const top = Math.max(4, Math.min(fitsBelow ? y : y - h, window.innerHeight - h - 4));
const top = Math.max(this.floor, Math.min(fitsBelow ? y : y - h, window.innerHeight - h - 4));
this.panel.style.left = `${Math.round(left)}px`;
this.panel.style.top = `${Math.round(top)}px`;
this.showMore(true);
this.panel.style.visibility = '';
}

openUnder(x: number, y: number): void {
this.floor = y;
this.refresh();
this.panel.style.visibility = 'hidden';
this.panel.hidden = false;
this.panel.style.maxHeight = `${menuCap(y)}px`;
this.list.scrollTop = 0;
const w = this.panel.offsetWidth;
const left = Math.max(MENU_PAD, Math.min(x, window.innerWidth - w - MENU_PAD));
this.panel.style.left = `${Math.round(left)}px`;
this.panel.style.top = `${Math.round(y)}px`;
this.showMore(true);
this.panel.style.visibility = '';
}

private openBeside(row: DOMRect): void {
this.refresh();
this.panel.style.visibility = 'hidden';
this.panel.hidden = false;
this.panel.scrollTop = 0;
const w = this.panel.offsetWidth, h = this.panel.offsetHeight, pad = 4;
const floor = this.root().floor, pad = MENU_PAD;
this.panel.style.maxHeight = floor === null ? '' : `${menuCap(floor)}px`;
this.list.scrollTop = 0;
const w = this.panel.offsetWidth, h = this.panel.offsetHeight;
const right = row.right - 2, left = row.left - w + 2;
const x = right + w <= window.innerWidth - pad ? right : Math.max(pad, left);
const y = Math.max(pad, Math.min(row.top - pad, window.innerHeight - h - pad));
const y = Math.max(floor ?? pad, Math.min(row.top - pad, window.innerHeight - h - pad));
this.panel.style.left = `${Math.round(x)}px`;
this.panel.style.top = `${Math.round(y)}px`;
this.showMore(true);
this.panel.style.visibility = '';
}

private showMore(instant = false): void {
const l = this.list;
const more = this.root().floor !== null && !this.panel.hidden && l.scrollHeight - l.clientHeight - l.scrollTop > 1;
if (instant) setClass(this.panel, 'no-fade', true);
setClass(this.panel, 'has-more', more);
if (instant) { void getComputedStyle(this.panel.lastElementChild ?? this.panel).opacity; setClass(this.panel, 'no-fade', false); }
}

private refresh(): void {
for (const r of this.rows) {
const cmd = this.commands.get(r.id);
Expand Down Expand Up @@ -170,7 +205,7 @@ export class MenuBar {
const b = m.btn.getBoundingClientRect();
this.openIndex = i;
setClass(m.btn, 'is-open', true);
m.menu.openAt(b.left, b.bottom + 4);
m.menu.openUnder(b.left, b.bottom + 4);
}

close(): void {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.63.0';
export const VERSION = '0.64.0';
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

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

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "formpath"
version = "0.63.0"
version = "0.64.0"
description = "formpath desktop shell"
authors = ["nodemode-ai"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "FormPath",
"version": "0.63.0",
"version": "0.64.0",
"identifier": "ai.nodemode.formpath",
"build": {
"frontendDist": "../frontend/dist"
Expand Down
Loading