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.15.0 · 2026-11-30

- Menus: a menu from the menu bar always opens just under its name and is at most three quarters of the window tall; the rest scrolls. Before, a menu taller than the room under the bar, such as View in a short window, opened at the top of the window and covered the menu bar.
- Menus: submenus such as Send to stay under the menu bar and take the same height limit, and still open beside their row.
- Menus: a menu that is cut off fades out at its bottom and shows a small pill with a down arrow while more rows are below. At the last row the hint fades away, and it comes back when you scroll up. A menu that fits shows nothing.
- Menus: a menu opened at the pointer keeps opening there, also stays under the menu bar and takes the same height limit and hint.
- Preferences, General, About FormRig shows the full third-party licence texts, and every package carries them in THIRD-PARTY-NOTICES.txt beside LICENSES.md.
- Agents on Windows: pnpm and bun shims start their program directly, and script names are read the way Windows opens them.
- Checked: the type check, 853 interface tests and the production build pass on Linux; the bar menus and a submenu were measured in headless Chrome with the CPU slowed 4 times at 1280x800, 1000x480 and 800x320. Not run: the desktop build, the macOS window with Menus in Window, and the engine and native tests (no engine code changed).

## 0.14.5 · 2026-11-29

- Agents on Windows: Claude Code, Codex and the other agent tabs that npm installs as `.cmd` or `.bat` files now start their program directly, so prompt text reaches it unchanged. A script that still has to run through the command interpreter refuses words holding characters the interpreter would treat as part of the command, and says to pass long text through standard input or a file instead.
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.5" src="https://img.shields.io/badge/version-0.14.5-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="Rust" src="https://img.shields.io/badge/rust-1.99.1-f97316?style=flat-square&logo=rust&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.14.5"
__version__ = "0.15.0"
56 changes: 56 additions & 0 deletions frontend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,3 +459,59 @@ Decisions and removed code for the `frontend/` area. Newest section last.
- `ui/notices.ts` (new) builds a closed `<details>` "Third-party notices" once; Preferences, General ends with an "About FormRig" group holding it. The first opening fetches `/api/notices` (about 1.1 MB, so not with the dialog) and sets the text in place; a failure says so in the same box and the next opening asks again. The box is 320 px high from the start and scrolls inside itself, so the text arriving moves nothing. Styles `.cv-notices` and `.cv-notices-text` in `styles/dialogs.css` use tokens.
- The two new strings are translated in every full table; "Loading..." reuses the existing "Loading" key. The About dialog in `app.ts` is unchanged.
- Removed code: none.

## v0.15.0 · menus under the bar (FORM-MENU-OVERLAP-FIX 1.2.0)

- refers-to: src/ui/menu.ts :: `MENU_SHARE`, `MENU_PAD`, `menuCap` (top of file), `PopupMenu.floor`, `PopupMenu.openUnder` (new), `PopupMenu.openBeside`, `MenuBar.open`
- kind: removed-code, rationale
- logged: v0.15.0 · 2026-11-30

Cause: `MenuBar.open` placed bar dropdowns with `openAt`, the routine meant for a point. When a menu did not fit below its point, `openAt` put it above the point and clamped it to 4 px from the window top, so a menu longer than the room under the bar covered the bar. The stylesheet cap `calc(100vh - 8px)` is taller than that room. `openBeside` clamped submenus to the window top in the same way.

Fix: `openUnder(x, y)` keeps the top at `y` (bar bottom plus 4), sets `floor = y`, and sets the inline `max-height` to `menuCap(y)` (the smaller of 75% of `innerHeight` and `innerHeight - y - 4`) while the panel is `visibility: hidden`, before it is measured. `openBeside` reads the floor of its root menu, takes the same cap before measuring and never places a submenu above the floor. The bar closes its menu on `resize`, so a stale cap is never seen.

```ts
b.menu.openAt(r.left, r.bottom + 4);
```

```ts
this.panel.scrollTop = 0;
const w = this.panel.offsetWidth, h = this.panel.offsetHeight, pad = 4;
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));
```

## v0.15.0 · the more-below hint

- refers-to: src/ui/menu.ts :: `PopupMenu` constructor, `list`, `setItems`, `items`, `showSub`, `openUnder`, `openBeside`, `showMore` (new); src/styles/shell.css :: `.cv-menu-list`, `.cv-menu-more`, `@property --menu-more` (after `.cv-menu-sep`)
- kind: removed-code, rationale
- logged: v0.15.0 · 2026-11-30

The panel is now a card that does not scroll, holding `.cv-menu-list` (the rows, which scroll) and `.cv-menu-more` (the pill). The mask goes on the list, so the rows fade into the card's own glass; a gradient over the rows would show as a band on the glass, and a mask on the card would fade its border and shadow too. `max-height` stays on the panel. Rows, `items()`, `subTop` and every scroll reset use the list. Nothing outside `ui/menu.ts` reads the panel's children or `scrollTop` (searched `src` and `tests`).

`showMore(true)` runs while the panel is still `visibility: hidden`, with `no-fade` set across a style read, so a long menu paints its first frame with the hint already in place and never fades it in. The list's `scroll` calls `showMore()`: the transition of the state being entered runs, 160 ms out at the last row and 490 ms back in. `scroll-padding-block-end` keeps a row focused with the arrow keys out of the fade. Glass tokens `--glass-bg` and `--glass-border` are the ones the card uses.

```ts
this.panel = el<HTMLElement>('<div class="cv-menu" role="menu" hidden></div>');
this.panel.addEventListener('scroll', () => { if (this.panel.scrollTop !== this.subTop) this.closeSub(); }, { passive: true });
this.panel.replaceChildren();
this.panel.appendChild(sep);
this.panel.appendChild(node);
items(): HTMLButtonElement[] { return Array.from(this.panel.children).filter((n): n is HTMLButtonElement => n instanceof HTMLButtonElement && !n.disabled); }
this.subTop = this.panel.scrollTop;
this.panel.scrollTop = 0;
```

## v0.15.0 · menus opened at a point

- refers-to: src/ui/menu.ts :: `barFloor` (top of file), `PopupMenu.openAt`
- kind: removed-code, rationale
- logged: v0.15.0 · 2026-11-30

`openAt` is the point-anchored routine (right-click and other menus made with `new PopupMenu(commands, null, true)`). It still opens at the pointer, below and right of it or flipped above or left, and gains three things: its floor is `barFloor()` (the bottom of `.cv-menubar` plus 4, or 4 when the bar is not drawn, as with the macOS system menu, where `r.height` is 0), the cap `menuCap(floor)` is set before measuring, and the hint is in place before it paints. Its submenus take the floor and the cap through `root().floor` in `openBeside`. A search of `src` for `openAt(`, `contextmenu`, `ContextMenu`, `place(` and `popover` found no caller of `openAt` after the bar moved to `openUnder`, and no other right-click menu: the `contextmenu` listener in `ui/settings.ts` toggles a favourite theme and opens nothing; `ui/dropdown.ts`, the retarget popover and the dock menu are anchored to a button, not a point, and are left as they are.

```ts
this.panel.scrollTop = 0;
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": "formrig",
"private": true,
"version": "0.14.5",
"version": "0.15.0",
"description": "formrig · character rigging in the NodeMode style",
"license": "Apache-2.0",
"type": "module",
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.

63 changes: 49 additions & 14 deletions frontend/src/ui/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { anyDialogOpen } from './dialogs';
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; };

let hiddenIds = new Set<string>();
let itemColors: Record<string, string> = {};
Expand All @@ -28,19 +31,22 @@ export function trimMenu(items: MenuItem[]): MenuItem[] {

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<HTMLElement>('<div class="cv-menu" role="menu" hidden></div>');
this.panel = el<HTMLElement>('<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', () => { 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 @@ -54,12 +60,12 @@ export class PopupMenu {
this.key = key;
this.closeSub();
for (const s of this.subs) s.menu.panel.remove();
this.panel.replaceChildren();
this.list.replaceChildren();
this.rows = [];
this.subs = [];
this.seps = [];
for (const item of items) {
if (item === '-') { const sep = el<HTMLElement>('<div class="cv-menu-sep"></div>'); this.seps.push(sep); this.panel.appendChild(sep); continue; }
if (item === '-') { const sep = el<HTMLElement>('<div class="cv-menu-sep"></div>'); this.seps.push(sep); this.list.appendChild(sep); 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'), t(item.label));
Expand All @@ -68,7 +74,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 @@ -79,13 +85,13 @@ 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);
}
}

private root(): PopupMenu { let m: PopupMenu = this; while (m.parent) m = m.parent; return m; }

items(): HTMLButtonElement[] { return Array.from(this.panel.children).filter((n): n is HTMLButtonElement => n instanceof HTMLButtonElement && !n.disabled); }
items(): HTMLButtonElement[] { return Array.from(this.list.children).filter((n): n is HTMLButtonElement => n instanceof HTMLButtonElement && !n.disabled); }

deepest(): PopupMenu { let m: PopupMenu = this; while (m.openSub?.isOpen) m = m.openSub; return m; }

Expand All @@ -109,7 +115,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 @@ -123,33 +129,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 { width: w, height: h } = this.panel.getBoundingClientRect();
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 @@ -315,7 +350,7 @@ export class MenuBar {
this.openIndex = i;
setClass(b.btn, 'is-open', true);
const r = b.btn.getBoundingClientRect();
b.menu.openAt(r.left, r.bottom + 4);
b.menu.openUnder(r.left, r.bottom + 4);
if (keyboard) b.menu.items()[0]?.focus();
}

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.5';
export const VERSION = '0.15.0';
Loading