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/formpdf-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Does PDF work with formpdf through its MCP server. Use whenever th
license: Apache-2.0
metadata:
author: formpdf
version: "0.66.0"
version: "0.67.0"
---

# formpdf harness
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/formpdf-skillset/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Guides development of the formpdf codebase: its FastAPI engine, va
license: Apache-2.0
metadata:
author: formpdf
version: "0.66.0"
version: "0.67.0"
---

# formpdf skillset
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formpdf-harness/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Does PDF work with formpdf through its MCP server. Use whenever th
license: Apache-2.0
metadata:
author: formpdf
version: "0.66.0"
version: "0.67.0"
---

# formpdf harness
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formpdf-skillset/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Guides development of the formpdf codebase: its FastAPI engine, va
license: Apache-2.0
metadata:
author: formpdf
version: "0.66.0"
version: "0.67.0"
---

# formpdf skillset
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.66.0" src="https://img.shields.io/badge/version-0.66.0-eef0f4?style=flat-square">
<img alt="version 0.67.0" src="https://img.shields.io/badge/version-0.67.0-eef0f4?style=flat-square">
<img alt="Python" src="https://img.shields.io/badge/python-3.12%2B-3776ab?style=flat-square&logo=python&logoColor=white">
<img alt="TypeScript" src="https://img.shields.io/badge/typescript-vite-3178c6?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.66.0"
__version__ = "0.67.0"
2 changes: 1 addition & 1 deletion demo/assets/demo.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/assets/demo.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demo/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 demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "formpdf-demo",
"private": true,
"version": "0.66.0",
"version": "0.67.0",
"description": "formpdf offline browser demo",
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion demos/protect/assets/protect.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demos/protect/assets/protect.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/sign/assets/sign.css

Large diffs are not rendered by default.

95 changes: 48 additions & 47 deletions demos/sign/assets/sign.js

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -976,3 +976,59 @@ Seen: the built window against an engine with a stand-in keyring and a settings
kind: feat · logged: unreleased · 2026-11-29

Preferences has an About section with one group, Third-Party Notices: a line saying what it is and a closed "Show the notices" disclosure. Opening it the first time fetches GET /api/notices with the window key and puts the text in a scrolling monospace block (`data-no-i18n`, so the page translator never walks the licence texts). A failed fetch says so and names THIRD-PARTY-NOTICES.txt beside the app, and the next opening tries again. Nothing is fetched until the disclosure is opened, and the block is filled in place, never rebuilt. The five new English strings are in every language table; `setup/i18n.py parity` is unchanged at 104 missing per language.

## 139. Menu bar menus and their submenus stay under the bar and take a 75% cap · _v0.67.0, logged 2026-11-30 (ui/menu.ts MENU_SHARE, MENU_PAD, menuCap, PopupMenu.floor, openUnder, openBeside; MenuBar.open)

kind: fix · logged: v0.67.0 · 2026-11-30

FORM-MENU-OVERLAP-FIX 1.2.0, section 3. `MenuBar.open` placed its menus with `openAt`, the routine meant for menus opened at a point: when a menu did not fit below its button it was flipped above and clamped to 4 pixels from the window top, so a long File, View or Window menu in a short window covered the menu bar. The stylesheet's `max-height: calc(100vh - 8px)` was larger than the room under the bar, so it did not help. Submenus clamped their top to the window top the same way.

Bar menus now open with `openUnder(x, y)`: the top is the button's bottom plus 4 and nothing moves it up, the left is kept inside the window, and an inline `max-height` of `menuCap(y)` (the smaller of 75% of the window and the room down to 4 pixels above its bottom) is set while the panel is still `visibility: hidden`, before it is measured, so it never paints at the wrong size. What does not fit scrolls. The menu keeps its top as `floor`. `openBeside` reads the floor of its root menu, takes the same cap before measuring, and never sets a submenu's top above that floor; it still opens beside its row. The bar already closes its menu on window resize, so the cap follows the window height.

Removed from `openBeside` and `MenuBar.open`:

```ts
this.panel.scrollTop = 0;
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));
m.menu.openAt(b.left, b.bottom + 4);
```

## 140. A cut-off menu shows a fade and a small pill while rows remain below · _v0.67.0, logged 2026-11-30 (ui/menu.ts PopupMenu.list, constructor, setItems, showSub, openAt, openUnder, openBeside, showMore; styles/dialogs.css .fs-menu, .fs-menu-list, .fs-menu-more)

kind: feat · logged: v0.67.0 · 2026-11-30

FORM-MENU-OVERLAP-FIX 1.2.0, section 3a and rule 8. The menu card is see-through glass, so a gradient painted over the rows would show as a band, and a mask on the card would fade its glass, border and shadow too. The card (`.fs-menu`) therefore no longer scrolls: it is a flex column holding `.fs-menu-list`, which scrolls and carries the mask, and `.fs-menu-more`, the pill (56 by 12, 6 pixels above the bottom, glass border and background, a 1.5 stroke `currentColor` chevron, `pointer-events: none`). Every place that wrote rows to the panel or read its `scrollTop` now uses the list; the inline `max-height` stays on the card. Nothing outside `menu.ts` reads the panel's children or `scrollTop` (the workbench only adds a class to it).

`showMore` sets `has-more` on the card while the list has more than a pixel left below. It runs on the list's `scroll`, after `setItems` when rows change on an open menu, and at the end of `openUnder` and `openBeside` with `instant`, which sets `no-fade`, flushes style and removes it, so the hint is in place on the first painted frame and never fades in on opening. `--menu-more` is a registered `@property` so the mask animates: 160 ms out (the base rule) and 490 ms back in (the `has-more` rule), none under reduced motion. `scroll-padding-block-end` on the list while the hint shows keeps a row scrolled into view out of the fade. No new z-index: the pill is positioned after the list in the card and paints above it.

Removed from `PopupMenu` and `.fs-menu`:

```ts
this.panel = el('<div class="fs-menu" role="menu" hidden></div>');
this.panel.addEventListener('scroll', () => { if (this.panel.scrollTop !== this.subTop) this.closeSub(); }, { passive: true });
this.panel.textContent = '';
if (item === '-') { const s = el('<div class="fs-menu-sep"></div>'); this.seps.push(s); this.panel.appendChild(s); continue; }
this.panel.appendChild(node);
this.panel.appendChild(node);
this.subTop = this.panel.scrollTop;
this.panel.scrollTop = 0;
```

```css
.fs-menu { position: fixed; min-width: 232px; max-height: calc(100vh - 8px); padding: 6px; overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-xl); }
```

## 141. Menus opened at a point keep under the menu bar, take the cap and show the hint · _v0.67.0, logged 2026-11-30 (ui/menu.ts barFloor, PopupMenu.openAt)

kind: fix · logged: v0.67.0 · 2026-11-30

FORM-MENU-OVERLAP-FIX 1.2.0, section 3b. formpdf has no right-click menu of its own (the only `contextmenu` listener is the one on the menu card that stops the browser's menu); its point-anchored menus are the three standalone `PopupMenu`s of the workbench, all opened with `openAt`: the Open menu (`openMenu`, under its button), the page layout menu (`layoutMenu`, from `rc.top - 6`, so it relies on the flip above its button) and the workspace menu (`wsMenu`, which grows with every saved workspace). `openAt` clamped their top to 4 pixels from the window top, with only the stylesheet's `calc(100vh - 8px)` as a cap, so a long one could cover the bar. The agent dock's own menu (`dock/`, the family's shared module) is placed by its own stylesheet inside the dock and was left alone.

`openAt` now sets `floor` to `barFloor()`, the bottom of `.fs-menubar` plus 4 (4 when the bar has no height, as under the macOS system menu), sets `max-height: menuCap(floor)` while the panel is hidden and before it is measured, keeps its pointer-corner placement (below and right of the point, flipped above or left when there is no room) but never puts its top above the floor, and runs `showMore(true)` before it is shown. Its submenus take the same floor and cap through `openBeside`.

Removed from `openAt`:

```ts
const top = Math.max(4, Math.min(fitsBelow ? y : y - h, window.innerHeight - h - 4));
```
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": "formpdf",
"private": true,
"version": "0.66.0",
"version": "0.67.0",
"description": "formpdf · a PDF editor in the form family",
"license": "Apache-2.0",
"type": "module",
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/styles/dialogs.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
.fs-menu { position: fixed; min-width: 232px; max-height: calc(100vh - 8px); padding: 6px; overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-xl); }
.fs-menu { position: fixed; min-width: 232px; max-height: calc(100vh - 8px); padding: 6px; border-radius: var(--radius-xl); }
.fs-menu[hidden] { display: none; }
@property --menu-more { syntax: '<number>'; inherits: false; initial-value: 0; }
.fs-menu:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.fs-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; }
.fs-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; }
.fs-menu-more svg { width: 12px; height: 8px; }
.fs-menu.has-more > .fs-menu-list { --menu-more: 1; scroll-padding-block-end: min(88px, 40%); transition-duration: 490ms; }
.fs-menu.has-more > .fs-menu-more { opacity: 1; transition-duration: 490ms; }
.fs-menu.no-fade > .fs-menu-list, .fs-menu.no-fade > .fs-menu-more { transition: none; }
@media (prefers-reduced-motion: reduce) { .fs-menu-list, .fs-menu-more { transition: none; } }
.fs-menu-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; width: 100%; height: 30px; padding: 0 10px 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-14); text-align: left; cursor: default; }
.fs-menu.has-checks .fs-menu-item { grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 8px; padding-left: 8px; }
.fs-menu-item:hover:not(:disabled), .fs-menu-item.is-focus:not(:disabled), .fs-menu-sub.is-open:not(:disabled) { background: color-mix(in srgb, var(--text-primary) 10%, transparent); color: var(--text-primary); }
Expand Down
62 changes: 49 additions & 13 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('.fs-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 subTop = 0;
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="fs-menu" role="menu" hidden></div>');
this.panel = el('<div class="fs-menu" role="menu" hidden><div class="fs-menu-list" role="none"></div><div class="fs-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, '.fs-menu-list');
document.getElementById('overlay-root')?.appendChild(this.panel);
this.panel.addEventListener('contextmenu', (e) => e.preventDefault());
this.panel.addEventListener('scroll', () => { if (this.panel.scrollTop !== this.subTop) this.closeSub(); }, { passive: true });
this.list.addEventListener('scroll', () => { if (this.list.scrollTop !== this.subTop) 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 @@ -34,13 +40,13 @@ 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="fs-menu-sep"></div>'); this.seps.push(s); this.panel.appendChild(s); continue; }
if (item === '-') { const s = el('<div class="fs-menu-sep"></div>'); this.seps.push(s); this.list.appendChild(s); continue; }
if (isSub(item)) {
const node = el<HTMLButtonElement>(`<button class="fs-menu-item fs-menu-sub" role="menuitem" aria-haspopup="menu" type="button"><span class="fs-menu-check"></span><span class="fs-menu-label"></span><span class="fs-menu-keys">${icon('chevronRight', 12)}</span></button>`);
setText(q(node, '.fs-menu-label'), item.label);
Expand All @@ -49,7 +55,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 @@ -59,8 +65,9 @@ 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);
}
if (this.isOpen) this.showMore();
}

private root(): PopupMenu { let m: PopupMenu = this; while (m.parent) m = m.parent; return m; }
Expand All @@ -69,7 +76,7 @@ export class PopupMenu {
if (this.openSub === menu && menu.isOpen) return;
this.closeSub();
this.openSub = menu;
this.subTop = this.panel.scrollTop;
this.subTop = this.list.scrollTop;
setClass(row, 'is-open', true);
menu.onClose = () => setClass(row, 'is-open', false);
const r = row.getBoundingClientRect();
Expand All @@ -83,33 +90,62 @@ 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 @@ -168,7 +204,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.66.0';
export const VERSION = '0.67.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 = "formpdf"
version = "0.66.0"
version = "0.67.0"
description = "formpdf desktop shell"
authors = ["NodeAgentc, Inc."]
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": "FormPDF",
"version": "0.66.0",
"version": "0.67.0",
"identifier": "ai.nodemode.formpdf",
"build": {
"frontendDist": "../frontend/dist"
Expand Down
Loading