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.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Rules for any coding agent (Claude Code, Codex, Cursor, Antigravity) working in this repository. `CLAUDE.md` is the full rule set; read it first.

- Stage: released (v0.14.1), built and bundled for macOS, Windows and Linux. `./formtools agents sync` mirrors `.claude/skills` into `.agents/skills`; `./formtools agents check` (also in CI) fails on drift. The plan of record is `DEV_PLAN.md` in the planning sidecar. Code changes route through `.claude/skills/formtools-harness`; using the app through MCP routes through `.claude/skills/formtools-driving`.
- Stage: released (v0.15.0), built and bundled for macOS, Windows and Linux. `./formtools agents sync` mirrors `.claude/skills` into `.agents/skills`; `./formtools agents check` (also in CI) fails on drift. The plan of record is `DEV_PLAN.md` in the planning sidecar. Code changes route through `.claude/skills/formtools-harness`; using the app through MCP routes through `.claude/skills/formtools-driving`.
- You are an outside agent to the running app. Tools that only read always work. Any other tool (including the ones behind `./formtools cli convert`, `resize` and `rename --apply`) is asked about in the formtools window (Deny, Allow once, Always allow) unless the person chose Allowed in Settings, Integration, Outside agents, and is refused under Blocked or when no window is open to ask. Only the window can change that choice: when a call is refused, tell the person what the refusal says and stop. `agents/manifest.json` lists every tool and which ones ask.
- Research lives in `docs/encyclopedia/` (start at `INDEX.md`). Paraphrase only; every page keeps its Sources list.
- Before adding a dependency, check `docs/encyclopedia/engines/engine-licensing-matrix.md` and add a `NOTICE.md` row in the same commit.
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.15.0 · 2026-11-30

Menus that fit the window.

- A menu from the menu bar (File, View, Tools and the rest) opens just under its name and is at most three quarters of the window tall; the rest of its rows scroll. Before, a long menu in a short window ran off the bottom of the window and its last rows could not be reached.
- Submenus keep under the menu bar and take the same limit, and still open beside their row. Before, a long submenu could be moved up over 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. Both go away at the last row and come back when you scroll up. A menu that fits shows neither, and with reduced motion asked for they show and hide without fading.
- Resizing the window closes an open menu.
- Settings, About has Third-party notices: the full licence text of every component formtools ships. The same text is in `THIRD-PARTY-NOTICES.txt` beside the app.
- Windows: agent programs start the same way as in the other Form apps. Program names in any letter case or with trailing dots, and pnpm and bun launchers, are read the way Windows opens them.
- The three browser demos are rebuilt from this version.

## 0.14.1 · 2026-11-29

Hardening fixes for outside agents, the environment tool and served files; nothing new.
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The form* family's media and file utility belt: viewers, batch image tools, 3D v

## Stage

Released (v0.14.1), built and bundled for macOS, Windows and Linux: Phases 1 to 9 of the approved plan, with Phase 2b for formvis and the repository side of Phase 10. Run `./formtools agents sync` after changing a skill and `./formtools agents check` before committing. The plan of record (`DEV_PLAN.md`), `BUILD_NOTES.md` and the root `HASHOUT_LOG.md` ship in the planning sidecar zip; read them, then the in-tree logs (`frontend/`, `backend/`, `src-tauri/`, `setup/` `HASHOUT_LOG.md`), before changing anything. For changing the code route through `.claude/skills/formtools-harness`; for using the app through MCP, `.claude/skills/formtools-driving`.
Released (v0.15.0), built and bundled for macOS, Windows and Linux: Phases 1 to 9 of the approved plan, with Phase 2b for formvis and the repository side of Phase 10. Run `./formtools agents sync` after changing a skill and `./formtools agents check` before committing. The plan of record (`DEV_PLAN.md`), `BUILD_NOTES.md` and the root `HASHOUT_LOG.md` ship in the planning sidecar zip; read them, then the in-tree logs (`frontend/`, `backend/`, `src-tauri/`, `setup/` `HASHOUT_LOG.md`), before changing anything. For changing the code route through `.claude/skills/formtools-harness`; for using the app through MCP, `.claude/skills/formtools-driving`.

## Layout notes

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.14.1" src="https://img.shields.io/badge/version-0.14.1-eef0f4?style=flat-square">
<img alt="version 0.15.0" src="https://img.shields.io/badge/version-0.15.0-eef0f4?style=flat-square">
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-Vite-3178c6?style=flat-square&logo=typescript&logoColor=white">
<img alt="Python FastAPI engine" src="https://img.shields.io/badge/Python-FastAPI-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.14.1"
__version__ = "0.15.0"
2 changes: 1 addition & 1 deletion demo/assets/demo.css

Large diffs are not rendered by default.

488 changes: 244 additions & 244 deletions demo/assets/demo.js

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

Context for the frontend code, kept here instead of in comments.

## 0.15.0 · 2026-11-30 · menu-bar menus keep under the bar, take a cap and show the more-below hint

Ported from FormVis 2.8.3 and 2.8.4 (FORM-MENU-OVERLAP-FIX guide 1.2.0, group C).

- `src/ui/menu.ts` :: `MenuBar.show` · The cause: the bar placed its menu at `r.bottom + 4` with no height limit at all, and `.cv-menu` had no `max-height` or `overflow`, so a menu taller than the room under the bar ran off the bottom of the window and its last rows could not be reached. Its submenus (`Popup.showSub`) clamped their top to 4 pixels from the window top, so a long submenu could rise over the bar. Removed from `MenuBar.show`:

```ts
pop.panel.style.left = `${Math.round(r.left)}px`;
pop.panel.style.top = `${Math.round(r.bottom + 4)}px`;
pop.panel.hidden = false;
```

Now `pop.openUnder(r.left, r.bottom + 4)`: the top is fixed under the button and nothing moves it up; the left is unchanged (no clamp, as before).
- `src/ui/menu.ts` :: `menuCap` · The cap is `min(75% of innerHeight, innerHeight - top - 4)`, written as the card's inline `max-height`. `tokens.css` makes every element `border-box`, so the cap holds the whole card, padding and border included. It is set while the panel is `visibility: hidden`, before anything measures it.
- `src/ui/menu.ts` :: `Popup.floor`, `Popup.openUnder` · A bar menu records its top as its floor. `showSub` hands the floor down to the submenu (formtools's `Popup` has no `parent` or `root()`), caps the submenu from the floor before measuring it, and places it with `Math.max(floor, ...)`. Removed from `showSub`:

```ts
panel.style.top = `${Math.round(Math.max(4, Math.min(r.top - 6, window.innerHeight - h - 4)))}px`;
```

- `src/ui/menu.ts` :: `Popup.panel`, `Popup.list`, `Popup.showMore` · The hint. The card no longer scrolls: it holds `.cv-menu-list` (the rows, which scroll) and `.cv-menu-more` (the pill). The mask goes on the list, so rows fade into the card's own glass and the glass, border and shadow stay whole. Rows and separators are appended to the list; `items()`, `sync()` and `contains()` read the row nodes and the panel, which are unchanged. `showMore(true)` runs before the panel becomes visible, under `no-fade`, so a menu opens with the hint already in place. Scrolling the list closes an open submenu (it would no longer sit beside its row) and updates the hint. Nothing outside `menu.ts` reads the panel's children or `scrollTop` (searched `src` and `tests`).
- `src/ui/menu.ts` :: `MenuBar` constructor · A window resize now closes the open menu, so a cap worked out for the old height is never kept. Rows are never rebuilt.
- `src/styles/shell.css` :: `.cv-menu:not([hidden])`, `.cv-menu-list`, `.cv-menu-more` · The rules of guide 3a with this app's `cv-` prefix and its `--glass-bg`, `--glass-border` and `--text-secondary` tokens. `@property --menu-more` lets the mask animate: 160 ms out at the last row, 490 ms back in. The pill is 56 by 12 with its border (global `border-box`); `scrollbars.css` already hides scrollbars app-wide, so the list shows none. Reduced motion switches with no fade. No colour, blur or spacing of the card changed; no z-index added.
- Point-anchored menus: none here. Searched `src` for `openAt(`, `contextmenu`, `ContextMenu`, `place(`, `popover` and `role="menu"`. The one `contextmenu` listener (`ui/settings.ts`, theme grid) toggles a favourite and opens no menu; `ContextMenuPanel` (`ui/osmenu.ts`) is the Settings page for the file manager's menu; `place()` in `src/overlay/` moves the loupe and readouts. `ft-mv-menu` (model viewer export) and `ft-dock-menu` are short toolbar dropdowns anchored by CSS, left as they are.
- Not changed: `native-menu.ts` and `wantsNativeMenus` (the macOS system menu). When it is on, `.cv-menubar` is hidden and `MenuBar.show` is never reached. There are no Home or End keys in this menu's key handler; none were added.

## Unreleased · 2026-11-29 · the third-party notices in Settings, About

- `src/ui/settings/notices.ts` (new) :: `noticesText`, `thirdPartyNotices` · A closed `details` block, "Third-party notices", under a new About group "Licences and notices". The first open asks `GET /api/notices` and puts the text in a `pre` of fixed height, so opening it never moves the page; it asks once. When the engine cannot answer, the block says the same text is in `THIRD-PARTY-NOTICES.txt` beside the app and asks again on the next open. The text is set with `setText`, never as markup.
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,6 +1,6 @@
{
"name": "formtools",
"version": "0.14.1",
"version": "0.15.0",
"description": "Viewers, batch image tools and file utilities for the Form family",
"license": "Apache-2.0",
"private": true,
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/styles/shell.css

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

48 changes: 40 additions & 8 deletions frontend/src/ui/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,22 @@ export interface MenuDef { label: string; items: MenuItem[] }

interface Row { id: string; node: HTMLButtonElement }

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)));

class Popup {
readonly panel = el<HTMLDivElement>('<div class="cv-menu" role="menu" hidden></div>');
readonly panel = el<HTMLDivElement>('<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>');
private readonly list = q<HTMLDivElement>(this.panel, '.cv-menu-list');
private rows: Row[] = [];
private subs: Array<{ node: HTMLButtonElement; pop: Popup }> = [];
private openSub: { node: HTMLButtonElement; pop: Popup } | null = null;
private floor: number | null = null;
private subTop = 0;

constructor(private readonly commands: Commands, items: MenuItem[], private readonly done: () => void, overlay?: HTMLElement) {
this.list.addEventListener('scroll', () => { if (this.list.scrollTop !== this.subTop) this.closeSub(); this.showMore(); }, { passive: true });
for (const item of items) {
if (item === '-') { this.panel.appendChild(el('<div class="cv-menu-sep"></div>')); continue; }
if (item === '-') { this.list.appendChild(el('<div class="cv-menu-sep"></div>')); continue; }
if (typeof item === 'object') {
const node = el<HTMLButtonElement>(`<button class="cv-menu-item cv-menu-sub" role="menuitem" aria-haspopup="menu" aria-expanded="false" 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 @@ -25,7 +32,7 @@ class Popup {
node.addEventListener('pointerenter', () => this.showSub(sub, false));
node.addEventListener('click', (e) => this.showSub(sub, e.detail === 0));
this.subs.push(sub);
this.panel.appendChild(node);
this.list.appendChild(node);
continue;
}
const cmd = commands.get(item);
Expand All @@ -36,7 +43,7 @@ class Popup {
node.addEventListener('pointerenter', () => this.closeSub());
node.addEventListener('click', () => { this.done(); commands.run(item); });
this.rows.push({ id: item, node });
this.panel.appendChild(node);
this.list.appendChild(node);
}
}

Expand Down Expand Up @@ -78,21 +85,47 @@ class Popup {
sub.node.setAttribute('aria-expanded', 'false');
}

openUnder(x: number, y: number): void {
this.floor = y;
this.panel.style.visibility = 'hidden';
this.panel.hidden = false;
this.panel.style.maxHeight = `${menuCap(y)}px`;
this.list.scrollTop = 0;
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.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 showSub(sub: { node: HTMLButtonElement; pop: Popup }, focusFirst: boolean): void {
if (this.openSub !== sub) {
this.closeSub();
sub.pop.sync();
const r = sub.node.getBoundingClientRect();
const panel = sub.pop.panel;
const floor = this.floor ?? MENU_PAD;
sub.pop.floor = floor;
panel.style.visibility = 'hidden';
panel.hidden = false;
panel.style.maxHeight = `${menuCap(floor)}px`;
sub.pop.list.scrollTop = 0;
const w = panel.offsetWidth, h = panel.offsetHeight;
const x = r.right + w + 4 <= window.innerWidth ? r.right + 2 : Math.max(4, r.left - w - 2);
panel.style.left = `${Math.round(x)}px`;
panel.style.top = `${Math.round(Math.max(4, Math.min(r.top - 6, window.innerHeight - h - 4)))}px`;
panel.style.top = `${Math.round(Math.max(floor, Math.min(r.top - 6, window.innerHeight - h - MENU_PAD)))}px`;
sub.pop.showMore(true);
panel.style.visibility = '';
setClass(sub.node, 'is-open', true);
sub.node.setAttribute('aria-expanded', 'true');
this.subTop = this.list.scrollTop;
this.openSub = sub;
}
if (focusFirst) sub.pop.items()[0]?.focus();
Expand Down Expand Up @@ -135,6 +168,7 @@ export class MenuBar {
else if (e.key === 'ArrowLeft') { e.preventDefault(); this.show((this.open - 1 + this.buttons.length) % this.buttons.length); }
}, true);
window.addEventListener('blur', () => this.close());
window.addEventListener('resize', () => this.close());
}

get isOpen(): boolean { return this.open >= 0; }
Expand All @@ -144,9 +178,7 @@ export class MenuBar {
const pop = this.popups[i], btn = this.buttons[i];
pop.sync();
const r = btn.getBoundingClientRect();
pop.panel.style.left = `${Math.round(r.left)}px`;
pop.panel.style.top = `${Math.round(r.bottom + 4)}px`;
pop.panel.hidden = false;
pop.openUnder(r.left, r.bottom + 4);
setClass(btn, 'is-open', true);
this.open = i;
}
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.14.1';
export const VERSION = '0.15.0';
4 changes: 2 additions & 2 deletions setup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def read_version():
pass
try:
with open(os.path.join(ROOT, "frontend", "package.json"), encoding="utf-8") as f:
return json.load(f).get("version") or "0.14.1"
return json.load(f).get("version") or "0.15.0"
except (OSError, ValueError):
return "0.14.1"
return "0.15.0"


def get(route, **query):
Expand Down
4 changes: 2 additions & 2 deletions setup/mcp_stdio.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def read_version():
pass
try:
with open(os.path.join(ROOT, "frontend", "package.json"), encoding="utf-8") as f:
return json.load(f).get("version") or "0.14.1"
return json.load(f).get("version") or "0.15.0"
except (OSError, ValueError):
return "0.14.1"
return "0.15.0"


def base():
Expand Down
2 changes: 1 addition & 1 deletion setup/mcpb/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": "0.2",
"name": "formtools",
"display_name": "formtools",
"version": "0.14.1",
"version": "0.15.0",
"description": "Browse folders, read picture and media details, batch convert, resize and rename pictures, inspect 3D models, list and safely extract archives, compute checksums and find duplicates, through the formtools engine on this computer.",
"long_description": "formtools is the Form family's media and file utility belt. This extension is a stdio bridge to the formtools engine's MCP endpoint on 127.0.0.1. Start the formtools app or run ./formtools boot first; the bridge also tries to start the engine when it can.",
"author": {
Expand Down
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 = "formtools"
version = "0.14.1"
version = "0.15.0"
description = "formtools 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": "FormTools",
"version": "0.14.1",
"version": "0.15.0",
"identifier": "ai.nodemode.formtools",
"build": {
"frontendDist": "../frontend/dist"
Expand Down
Loading