From 7488734b022d5fcce502e908de8b6e5016a9141d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Mon, 30 Nov 2026 15:40:58 -0500 Subject: [PATCH 1/4] fix(menus): menu bar menus open under their button with a three-quarter cap, and submenus take the same cap (0.12.0) Bar menus went through openAt and placeFloating, whose cap was all the room down to the status bar and whose 96 px minimum could lift a menu off its button in a short window. MenuBar.open now calls a new PopupMenu.openUnder: top fixed at the button's bottom plus 4 (never above the title bar's safe area), no flip, and an inline max-height of min(75% of the window, room to the status bar) set while hidden, before measuring. openBeside passes the same cap to placeFloating through its new optional cap. Ran: tsc --noEmit. --- frontend/HASHOUT_LOG.md | 22 ++++++++++++++++++++++ frontend/src/ui/menu.ts | 28 +++++++++++++++++++++++++--- frontend/src/ui/position.ts | 6 ++++-- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 07c5161..93e9e78 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -7199,3 +7199,25 @@ Checked in a real Chrome against the engine: a reload keeps the dock working (th - **Text.** The dialog shows `THIRD-PARTY-NOTICES.txt` as the engine serves it (`GET /api/notices`, plain text, about 1.1 MB). It is fetched when the dialog first opens, not with About, and only once after it arrives; a failed fetch says where the same file is installed and is asked again on the next opening. - **No layout shift.** The box is a `pre` with a fixed 360 px height (at most 60vh) from the first paint and scrolls inside itself, so the text's arrival moves nothing. Colours, border, radius and spacing are tokens. - Removed code: none. + +## 2026-11-30 · v0.12.0 menus under the title bar, a three-quarter cap and the more-below hint {#menu-cap-v0120} + +- refers-to: src/ui/menu.ts :: MENU_SHARE, barFloor, menuCap, PopupMenu.floor, PopupMenu.openUnder, PopupMenu.openBeside, MenuBar.open; src/ui/position.ts :: PlaceOptions.cap, placeFloating +- kind: rationale +- logged: v0.12.0 · 2026-11-30 +- **Source.** The family fix FORM-MENU-OVERLAP-FIX (guide 1.2.0, from formvis 2.8.3 and 2.8.4), ported by hand. formcraft's menus already went through `placeFloating`, whose safe area starts under `.cv-titlebar`, so a bar menu here never reached the bar. What was missing: the cap was the whole room down to the status bar (about 90% of a 1280 by 800 window), and the 96 px `minHeight` could lift a bar menu off its button in a very short window. +- **Bar menus.** `MenuBar.open` calls `openUnder(r.left, r.bottom + 4)`. The top is `max(y, barFloor())` (`barFloor` is the safe area's top, the title bar's bottom plus 4) and nothing moves it up; there is no flip. The inline `max-height` is `menuCap(top)`, set while the panel is `visibility: hidden` and before the width is read, so the first painted frame has the final size. `left` is clamped into the safe area. +- **Cap.** `menuCap(top) = min(floor(0.75 * innerHeight), floor(safeArea().bottom - top))`. The bottom edge stays the status bar's top less 4, as `placeFloating` already used, so menus still never cover the status bar. +- **Submenus.** `openBeside` passes `cap: menuCap(root floor)` to `placeFloating`, so a submenu takes the same cap and keeps opening beside its row; its top was already clamped to the safe area's top. +- **placeFloating.** New optional `cap` (screen pixels, like the rest of its maths). The flip and fit use `min(measured, cap)`; the inline `max-height` is set whenever the measured height is above what is placed. Without `cap` it behaves exactly as before. +- **Resize.** `MenuBar` already closes on `resize`, so the cap follows the window. +- Removed code, in `MenuBar.open` and `placeFloating`: + +```ts + b.menu.openAt(r.left, r.bottom + 4); +``` + +```ts + const natural = panel.offsetHeight * k; + if (natural > height) { +``` diff --git a/frontend/src/ui/menu.ts b/frontend/src/ui/menu.ts index f91f6ff..1885eaa 100644 --- a/frontend/src/ui/menu.ts +++ b/frontend/src/ui/menu.ts @@ -4,7 +4,7 @@ import { anyDialogOpen } from './dialogs'; import { el, isMac, q, setAttr, setClass, setDisabled, setText } from './dom'; import { icon } from './icons'; import { t } from './i18n'; -import { placeFloating, pointTarget } from './position'; +import { placeFloating, pointTarget, safeArea } from './position'; import '../styles/menu.css'; export interface SubMenu { @@ -21,6 +21,10 @@ export interface MenuDef { const isSub = (i: MenuItem): i is SubMenu => typeof i === 'object'; +const MENU_SHARE = 0.75; +export const barFloor = (): number => safeArea().top; +export const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(safeArea().bottom - top))); + export function resolveItems(items: readonly MenuItem[]): MenuItem[] { const out: MenuItem[] = []; for (const i of items) { @@ -49,6 +53,7 @@ export class PopupMenu { private key = ''; private openSub: PopupMenu | null = null; private subTop = 0; + private floor: number | null = null; constructor(private readonly parent: PopupMenu | null = null, standalone = false) { this.panel = el(''); @@ -186,12 +191,29 @@ export class PopupMenu { this.panel.style.visibility = ''; } + openUnder(x: number, y: number): void { + const top = Math.max(y, barFloor()); + this.floor = top; + this.refresh(); + this.panel.style.visibility = 'hidden'; + this.panel.hidden = false; + this.panel.style.maxHeight = `${menuCap(top)}px`; + this.panel.scrollTop = 0; + const w = this.panel.offsetWidth; + const area = safeArea(); + const left = Math.max(area.left, Math.min(x, area.right - w)); + this.panel.style.left = `${Math.round(left)}px`; + this.panel.style.top = `${Math.round(top)}px`; + this.panel.style.visibility = ''; + } + private openBeside(row: DOMRect): void { + const floor = this.root().floor ?? barFloor(); this.refresh(); this.panel.style.visibility = 'hidden'; this.panel.hidden = false; this.panel.scrollTop = 0; - placeFloating(this.panel, { left: row.left, right: row.right, top: row.top - 4, bottom: row.bottom }, { side: 'right', align: 'start', gap: -2 }); + placeFloating(this.panel, { left: row.left, right: row.right, top: row.top - 4, bottom: row.bottom }, { side: 'right', align: 'start', gap: -2, cap: menuCap(floor) }); this.panel.style.visibility = ''; } @@ -427,7 +449,7 @@ export class MenuBar { setClass(b.btn, 'is-open', true); setAttr(b.btn, 'aria-expanded', '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] ?? b.menu.panel).focus(); } diff --git a/frontend/src/ui/position.ts b/frontend/src/ui/position.ts index e5c43ed..2533260 100644 --- a/frontend/src/ui/position.ts +++ b/frontend/src/ui/position.ts @@ -14,6 +14,7 @@ export interface PlaceOptions { gap?: number; pad?: number; minHeight?: number; + cap?: number; scale?: number; } @@ -67,7 +68,8 @@ export function placeFloating(panel: HTMLElement, target: Target, opts: PlaceOpt panel.style.maxHeight = ''; panel.style.overflowY = ''; const w = panel.offsetWidth * k; - const natural = panel.offsetHeight * k; + const full = panel.offsetHeight * k; + const natural = Math.min(full, opts.cap ?? full); const gapOf = point ? 0 : gap; const room = (s: Side): number => s === 'bottom' ? area.bottom - target.bottom - gapOf : s === 'top' ? target.top - area.top - gapOf : s === 'right' ? area.right - target.right - gapOf : target.left - area.left - gapOf; @@ -91,7 +93,7 @@ export function placeFloating(panel: HTMLElement, target: Target, opts: PlaceOpt left = Math.max(area.left, Math.min(left, area.right - w)); } const maxHeight = Math.floor(Math.min(height, area.bottom - area.top) / k); - if (natural > height) { + if (full > height) { panel.style.maxHeight = `${maxHeight}px`; panel.style.overflowY = 'auto'; } From 1728f8205287b41ad7a648faf63d0d50356dc3ff Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Mon, 30 Nov 2026 15:44:15 -0500 Subject: [PATCH 2/4] feat(menus): a menu cut off by the cap fades its bottom rows and shows a small pill while rows remain below (0.12.0) The panel becomes a glass card that does not scroll, holding a scrolling .cv-menu-list with the mask and a .cv-menu-more pill, so the fade goes into the menu's own glass. showMore sets has-more from the list's scroll position, instantly while the panel is still hidden on opening, then on every scroll: out in 160 ms at the last row, back in 490 ms. Rows, items(), subTop and scrollTop now use the list. Ran: tsc --noEmit. --- frontend/HASHOUT_LOG.md | 25 ++++++++++++++++++++++ frontend/src/styles/menu.css | 11 +++++++++- frontend/src/ui/menu.ts | 41 +++++++++++++++++++++++++----------- 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 93e9e78..f132168 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -7221,3 +7221,28 @@ Checked in a real Chrome against the engine: a reload keeps the dock working (th const natural = panel.offsetHeight * k; if (natural > height) { ``` + +- refers-to: src/ui/menu.ts :: MENU_MORE, showMore, PopupMenu.list, PopupMenu constructor, setItems, items, showSub, openUnder, openBeside; src/styles/menu.css :: .cv-menu, .cv-menu-list, .cv-menu-more, has-more, no-fade +- kind: rationale +- logged: v0.12.0 · 2026-11-30 +- **More-below hint.** A menu cut off by the cap fades its bottom rows into its own glass and shows a 56 by 12 pill with a down chevron, 6 px above the bottom edge, while rows remain below. It goes in 160 ms at the last row and comes back in 490 ms (the transition of the state being entered runs, so `has-more` carries 490 ms). Nothing shows at the top, a menu that fits shows nothing, and the pill takes no clicks. +- **Card and list.** The menus are see-through glass, so a gradient over the rows would show as a band and a mask on the panel would fade its glass, border and shadow. The panel is now a card that does not scroll (`display: flex; overflow: hidden` while shown) holding `.cv-menu-list`, which scrolls and carries the mask, plus the pill. `max-height` stays on the panel. Rows, `items()`, `subTop` and every `scrollTop = 0` use the list; the list's `scroll` closes an open submenu and calls `showMore`. Nothing outside the menu files reads the panel's children or `scrollTop` (checked: board toolbar, outliner, canvas tool and layer menus only add a class, a keydown listener, focus or remove the panel). +- **First frame.** `showMore(panel, list, true)` runs while the panel is still `visibility: hidden`: it sets `no-fade`, sets `has-more`, flushes style, then drops `no-fade`, so the hint is in place on the first painted frame and never fades in on opening. Rows are never rebuilt to measure. +- **Tokens.** Pill border and background are `--glass-border` and `--glass-bg`, the chevron is `currentColor` on `--text-secondary`. The `#000` in the mask gradient is an alpha mask, not a painted colour. `--menu-more` is a registered `@property` so the mask can animate; where that is not supported it switches without a fade. Reduced motion (the media query here and the tokens' global rule) and `animations-disabled` turn the fades off. +- **Focus.** `has-more` puts `scroll-padding-block-end: min(88px, 40%)` on the list, so arrowing scrolls the focused row clear of the fade; End reaches the last row, which hides the hint. +- Removed code, from `.cv-menu` in menu.css and the PopupMenu constructor: + +```css +overflow-y: auto; overscroll-behavior: contain; +``` + +```ts + this.panel = el(''); + this.panel.addEventListener( + 'scroll', + () => { + if (this.panel.scrollTop !== this.subTop) this.closeSub(); + }, + { passive: true }, + ); +``` diff --git a/frontend/src/styles/menu.css b/frontend/src/styles/menu.css index 6c52c50..4df55c6 100644 --- a/frontend/src/styles/menu.css +++ b/frontend/src/styles/menu.css @@ -3,9 +3,18 @@ .cv-menu-btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: -2px; background: var(--bg-tertiary); color: var(--text-primary); } .is-menu-mnemonics .cv-menu-btn::first-letter { text-decoration: underline; } -.cv-menu { position: fixed; min-width: 232px; max-height: calc(100vh - 8px); overflow-y: auto; overscroll-behavior: contain; padding: var(--space-1); border-radius: var(--radius-lg); user-select: none; -webkit-user-select: none; } +.cv-menu { position: fixed; min-width: 232px; max-height: calc(100vh - 8px); padding: var(--space-1); border-radius: var(--radius-lg); user-select: none; -webkit-user-select: none; } .cv-menu[hidden] { display: none; } .cv-menu:focus { outline: none; } +@property --menu-more { syntax: ''; inherits: false; initial-value: 0; } +.cv-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-menu-item { display: grid; grid-template-columns: var(--space-4) minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-2); width: 100%; height: var(--ctl-md); padding: 0 var(--space-3) 0 var(--space-2); border: 0; border-radius: var(--radius); background: transparent; color: var(--text-primary); font-size: var(--fs-13); text-align: left; cursor: default; } .cv-menu-item:hover:not(:disabled), .cv-menu-item:focus:not(:disabled), .cv-menu-sub.is-open { background: var(--bg-hover); outline: none; } .cv-menu-item:disabled { color: var(--text-muted); opacity: 0.55; } diff --git a/frontend/src/ui/menu.ts b/frontend/src/ui/menu.ts index 1885eaa..2f460d6 100644 --- a/frontend/src/ui/menu.ts +++ b/frontend/src/ui/menu.ts @@ -24,6 +24,18 @@ const isSub = (i: MenuItem): i is SubMenu => typeof i === 'object'; const MENU_SHARE = 0.75; export const barFloor = (): number => safeArea().top; export const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(safeArea().bottom - top))); +export const MENU_MORE = + ''; + +export function showMore(panel: HTMLElement, list: HTMLElement, instant = false): void { + const more = !panel.hidden && list.scrollHeight - list.clientHeight - list.scrollTop > 1; + if (instant) setClass(panel, 'no-fade', true); + setClass(panel, 'has-more', more); + if (instant) { + void getComputedStyle(panel.lastElementChild ?? panel).opacity; + setClass(panel, 'no-fade', false); + } +} export function resolveItems(items: readonly MenuItem[]): MenuItem[] { const out: MenuItem[] = []; @@ -47,6 +59,7 @@ export const itemsOf = (def: MenuDef): MenuItem[] => resolveItems(typeof def.ite export class PopupMenu { readonly panel: HTMLElement; + readonly list: HTMLElement; onClose: (() => void) | null = null; private rows: Array<{ id: string; node: HTMLButtonElement }> = []; private subs: Array<{ sub: SubMenu; node: HTMLButtonElement; menu: PopupMenu }> = []; @@ -56,14 +69,16 @@ export class PopupMenu { private floor: number | null = null; constructor(private readonly parent: PopupMenu | null = null, standalone = false) { - this.panel = el(''); + this.panel = el(``); + 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('pointerdown', (e) => e.preventDefault()); - this.panel.addEventListener( + this.list.addEventListener( 'scroll', () => { - if (this.panel.scrollTop !== this.subTop) this.closeSub(); + if (this.list.scrollTop !== this.subTop) this.closeSub(); + showMore(this.panel, this.list); }, { passive: true }, ); @@ -93,12 +108,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 = []; for (const item of list) { if (item === '-') { - this.panel.appendChild(el('')); + this.list.appendChild(el('')); continue; } if (isSub(item)) { @@ -111,7 +126,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 = commands.get(item); @@ -125,7 +140,7 @@ export class PopupMenu { void commands.run(item); }); this.rows.push({ id: item, node }); - this.panel.appendChild(node); + this.list.appendChild(node); } this.refresh(); } @@ -137,7 +152,7 @@ export class PopupMenu { } items(): HTMLButtonElement[] { - return Array.from(this.panel.children).filter((n): n is HTMLButtonElement => n instanceof HTMLButtonElement && !n.disabled); + return Array.from(this.list.children).filter((n): n is HTMLButtonElement => n instanceof HTMLButtonElement && !n.disabled); } deepest(): PopupMenu { @@ -166,7 +181,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); setAttr(row, 'aria-expanded', 'true'); menu.onClose = () => { @@ -186,7 +201,7 @@ export class PopupMenu { this.refresh(); this.panel.style.visibility = 'hidden'; this.panel.hidden = false; - this.panel.scrollTop = 0; + this.list.scrollTop = 0; placeFloating(this.panel, pointTarget(x, y), { side: 'bottom', align: 'start' }); this.panel.style.visibility = ''; } @@ -198,12 +213,13 @@ export class PopupMenu { this.panel.style.visibility = 'hidden'; this.panel.hidden = false; this.panel.style.maxHeight = `${menuCap(top)}px`; - this.panel.scrollTop = 0; + this.list.scrollTop = 0; const w = this.panel.offsetWidth; const area = safeArea(); const left = Math.max(area.left, Math.min(x, area.right - w)); this.panel.style.left = `${Math.round(left)}px`; this.panel.style.top = `${Math.round(top)}px`; + showMore(this.panel, this.list, true); this.panel.style.visibility = ''; } @@ -212,8 +228,9 @@ export class PopupMenu { this.refresh(); this.panel.style.visibility = 'hidden'; this.panel.hidden = false; - this.panel.scrollTop = 0; + this.list.scrollTop = 0; placeFloating(this.panel, { left: row.left, right: row.right, top: row.top - 4, bottom: row.bottom }, { side: 'right', align: 'start', gap: -2, cap: menuCap(floor) }); + showMore(this.panel, this.list, true); this.panel.style.visibility = ''; } From 698588a6f60fece7927760a182a477997b1f5312 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Mon, 30 Nov 2026 16:07:30 -0500 Subject: [PATCH 3/4] fix(menus): right-click and other point menus keep under the title bar, take the three-quarter cap and show the more-below hint (0.12.0) PopupMenu.openAt, the library ContextMenu and the Edit timeline's openList still opened at the pointer with all the room to the status bar as their cap. Each now passes menuCap(barFloor()) to placeFloating while hidden, before measuring, so the flip and the clamp work on the capped height; PopupMenu.openAt records the floor so its submenus cap from it. ContextMenu and openList move their rows into a .cv-menu-list with the .cv-menu-more pill, and run showMore before the first paint and on every scroll. A standalone PopupMenu closes on resize. Pointer-corner placement is unchanged. Ran: npm run build (tsc --noEmit and vite build), vitest (56 files, 1189 tests). --- frontend/HASHOUT_LOG.md | 24 ++++++++++++++++++++++++ frontend/src/ui/edit/timeline/menu.ts | 14 +++++++++----- frontend/src/ui/library/context-menu.ts | 17 +++++++++++------ frontend/src/ui/menu.ts | 5 ++++- 4 files changed, 48 insertions(+), 12 deletions(-) diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index f132168..d2a3739 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -7246,3 +7246,27 @@ overflow-y: auto; overscroll-behavior: contain; { passive: true }, ); ``` + +- refers-to: src/ui/menu.ts :: PopupMenu.openAt, PopupMenu constructor (standalone resize); src/ui/library/context-menu.ts :: ContextMenu constructor, open, setRows; src/ui/edit/timeline/menu.ts :: openList +- kind: rationale +- logged: v0.12.0 · 2026-11-30 +- **Point menus found.** Three implementations open at a point: `PopupMenu.openAt` (the outliner row menu, the Canvas right-click menu, the Board toolbar and Canvas layer export menus), `ContextMenu` (library tiles, folders and sidebar, Home project cards, feed results, scene materials, the starter picker) and the Edit timeline's `openList` (clip menu, cross dissolve menu). Each keeps its pointer-corner placement through `placeFloating` (below and right, flipped up or left when there is no room) and gets three changes: the floor (`placeFloating`'s safe area already started under the title bar; `PopupMenu.openAt` now also records `floor = barFloor()` so its submenus cap from it), the cap (`cap: menuCap(barFloor())`, which also decides the flip, so a capped menu that fits below the pointer stays below), and the hint (card and list, `showMore(..., true)` before the first paint, `showMore` on the list's scroll). +- **Zoom.** `ContextMenu` still passes `scale: zoomOf()`; the cap is in screen pixels like the rest of `placeFloating`, which divides `max-height` by the scale. +- **Resize.** A standalone `PopupMenu` now closes on `resize`, as `MenuBar`, `ContextMenu` and `openList` already did, so a cap never outlives the window size it was made for. +- **Not changed.** Button-anchored popovers that are not menus opened at a point (`board/shell/popover.ts`, `scene/chrome/popover.ts`, `scene/timeline/pop.ts`, `jobs-popover.ts`, the Edit speed popover, `tool-menu.ts`, the prompt pickers) keep their own placement; `native-menu.ts` is untouched. +- Removed code, from `PopupMenu.openAt`, `ContextMenu` and `openList`: + +```ts + placeFloating(this.panel, pointTarget(x, y), { side: 'bottom', align: 'start' }); +``` + +```ts + this.panel = el(''); + this.panel.scrollTop = 0; + placeFloating(this.panel, pointTarget(x, y), { side: 'bottom', align: 'start', pad: PAD, scale: zoomOf() }); +``` + +```ts + const node = html(''); + placeFloating(node, pointTarget(x, y), { side: 'bottom', align: 'start' }); +``` diff --git a/frontend/src/ui/edit/timeline/menu.ts b/frontend/src/ui/edit/timeline/menu.ts index ada2663..63d514b 100644 --- a/frontend/src/ui/edit/timeline/menu.ts +++ b/frontend/src/ui/edit/timeline/menu.ts @@ -2,8 +2,9 @@ import { patchElementOp } from '../../../engine/edit/ops-clip'; import { DISSOLVE_DEFAULT, nextAt, setDissolveOp } from '../../../engine/edit/transitions'; import { TICKS_PER_SECOND } from '../../../engine/edit/types'; import { shortcuts } from '../../../engine/shortcuts'; -import { el as html, setText } from '../../dom'; +import { el as html, q, setText } from '../../dom'; import { t } from '../../i18n'; +import { MENU_MORE, barFloor, menuCap, showMore } from '../../menu'; import { placeFloating, pointTarget } from '../../position'; import { selectedElements, splitTargets, type Actions } from './actions'; import type { Core } from './core'; @@ -105,10 +106,11 @@ export interface ListItem { export function openList(list: readonly (ListItem | '-')[], x: number, y: number): void { closeMenu(); - const node = html(''); + const node = html(``); + const body = q(node, '.cv-menu-list'); for (const it of list) { if (it === '-') { - node.appendChild(html('')); + body.appendChild(html('')); continue; } const b = html(''); @@ -121,12 +123,14 @@ export function openList(list: readonly (ListItem | '-')[], x: number, y: number done(); it.run(); }); - node.appendChild(b); + body.appendChild(b); } + body.addEventListener('scroll', () => showMore(node, body), { passive: true }); node.addEventListener('contextmenu', (e) => e.preventDefault()); node.addEventListener('pointerdown', (e) => e.preventDefault()); (document.getElementById('overlay-root') ?? document.body).appendChild(node); - placeFloating(node, pointTarget(x, y), { side: 'bottom', align: 'start' }); + placeFloating(node, pointTarget(x, y), { side: 'bottom', align: 'start', cap: menuCap(barFloor()) }); + showMore(node, body, true); panel = node; const off = (e: Event): void => { if (e.target instanceof Node && node.contains(e.target)) return; diff --git a/frontend/src/ui/library/context-menu.ts b/frontend/src/ui/library/context-menu.ts index edb5414..422e294 100644 --- a/frontend/src/ui/library/context-menu.ts +++ b/frontend/src/ui/library/context-menu.ts @@ -1,6 +1,7 @@ import { el, q, setAttr, setDisabled, setText } from '../dom'; import { t } from '../i18n'; import { icon } from '../icons'; +import { MENU_MORE, barFloor, menuCap, showMore } from '../menu'; import { placeFloating, pointTarget } from '../position'; import { zoomOf } from './grid-shared'; import '../../styles/menu.css'; @@ -21,13 +22,16 @@ const PAD = 4; export class ContextMenu { readonly panel: HTMLElement; + private readonly list: HTMLElement; onClose: (() => void) | null = null; private rows: Array<{ entry: MenuEntry; node: HTMLButtonElement }> = []; private key = ''; private back: HTMLElement | null = null; constructor() { - this.panel = el(''); + this.panel = el(``); + this.list = q(this.panel, '.cv-menu-list'); + this.list.addEventListener('scroll', () => showMore(this.panel, this.list), { passive: true }); document.getElementById('overlay-root')?.appendChild(this.panel); this.panel.addEventListener('contextmenu', (e) => e.preventDefault()); this.panel.addEventListener('pointerdown', (e) => e.preventDefault()); @@ -52,8 +56,9 @@ export class ContextMenu { this.back = returnTo; this.panel.style.visibility = 'hidden'; this.panel.hidden = false; - this.panel.scrollTop = 0; - placeFloating(this.panel, pointTarget(x, y), { side: 'bottom', align: 'start', pad: PAD, scale: zoomOf() }); + this.list.scrollTop = 0; + placeFloating(this.panel, pointTarget(x, y), { side: 'bottom', align: 'start', pad: PAD, scale: zoomOf(), cap: menuCap(barFloor()) }); + showMore(this.panel, this.list, true); this.panel.style.visibility = ''; this.panel.focus({ preventScroll: true }); } @@ -82,11 +87,11 @@ export class ContextMenu { return; } this.key = key; - this.panel.replaceChildren(); + this.list.replaceChildren(); this.rows = []; for (const r of clean) { if (r === '-') { - this.panel.appendChild(el('')); + this.list.appendChild(el('')); continue; } const node = el( @@ -102,7 +107,7 @@ export class ContextMenu { row.entry.run(); }); this.rows.push(row); - this.panel.appendChild(node); + this.list.appendChild(node); } } diff --git a/frontend/src/ui/menu.ts b/frontend/src/ui/menu.ts index 2f460d6..e02fc02 100644 --- a/frontend/src/ui/menu.ts +++ b/frontend/src/ui/menu.ts @@ -90,6 +90,7 @@ export class PopupMenu { }, true, ); + window.addEventListener('resize', () => this.close()); } } @@ -198,11 +199,13 @@ export class PopupMenu { } openAt(x: number, y: number): void { + this.floor = barFloor(); this.refresh(); this.panel.style.visibility = 'hidden'; this.panel.hidden = false; this.list.scrollTop = 0; - placeFloating(this.panel, pointTarget(x, y), { side: 'bottom', align: 'start' }); + placeFloating(this.panel, pointTarget(x, y), { side: 'bottom', align: 'start', cap: menuCap(this.floor) }); + showMore(this.panel, this.list, true); this.panel.style.visibility = ''; } From 0117002c8a688f2a79903e87e319cdc400a9f39f Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Mon, 30 Nov 2026 16:09:04 -0500 Subject: [PATCH 4/4] chore(release): 0.12.0, menus under the title bar with a three-quarter cap and the more-below hint Version sites, the changelog section and the two side logs' current-version lines for 0.12.0, a minor release with the menu cap, the more-below hint and the right-click menu fix. 0.11.1 was never tagged, so this release also carries its changes. Ran: npm run build (tsc --noEmit and vite build), vitest (56 files, 1189 tests), setup/versions.py (all 10 sites at 0.12.0) and a headless Chrome probe of the bar menus at 1280x800 and 1000x480 with the CPU slowed 4 times. --- CHANGELOG.md | 19 +++++++++++++++++++ LICENSES.md | 2 +- README.md | 2 +- backend/HASHOUT_LOG.md | 2 +- backend/app/core/config.py | 2 +- frontend/HASHOUT_LOG.md | 2 +- frontend/package-lock.json | 4 ++-- frontend/package.json | 2 +- setup/form-app.json | 2 +- setup/mcpb/manifest.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 13 files changed, 32 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e5103c..941ccb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ Versions follow `v*.*.*` with dots. Dates are UTC. +## 0.12.0 · 2026-11-30 + +Menus that stay clear of the title bar and say when there is more to scroll. + +### Added + +- A long menu that is cut off fades out its bottom rows and shows a small pill with a down arrow while rows remain below. At the last row both fade away, and they come back when you scroll up. A menu that fits shows nothing. + +### Fixed + +- Menus from the title bar always open just under their button and are at most three quarters of the window tall; the rest scrolls. Before, a long menu in a short window could be lifted off its button. +- Submenus keep under the title bar and take the same three-quarter limit. +- Right-click menus (library tiles, folders, Home project cards, results, the outliner, the Canvas, timeline clips) and the toolbar menus opened beside a button keep opening at the pointer, but no longer reach past three quarters of the window, stay under the title bar and show the same pill when rows remain below. + +### Checked + +- Type check, production build and 1189 frontend tests pass on Linux. +- Not run: the menus measured in a browser, the hint timings, keyboard checks, the engine tests, the installer and the desktop build. + ## 0.11.1 · 2026-11-29 A hardening release for agents and the local engine, on top of 0.11.0. diff --git a/LICENSES.md b/LICENSES.md index b686f2a..9528e8b 100644 --- a/LICENSES.md +++ b/LICENSES.md @@ -1,6 +1,6 @@ # Third-party licences · formcraft -Version v0.11.1 · 2026-11-29 +Version v0.12.0 · 2026-11-30 formcraft is licensed under the Apache License, Version 2.0 (see `LICENSE`), Copyright 2026 NodeAgentc, Inc. This file lists every third-party item that ships with formcraft or is used to build it, with its version, licence, where it ships and what the licence asks of us. `NOTICE` carries the short list of obligations that travel with the app and points here. diff --git a/README.md b/README.md index e8d6bb9..d15e028 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

- version v0.11.1 + version v0.12.0 TypeScript, Vite and Three.js Python and FastAPI macOS, Windows and Linux diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 5cdb5a8..9bd0e3c 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of comment content, explainers, rationale, TODOs and removed code for the engine side of the repo. Source files stay comment-free per the owner's hashout-log rule; what they would have said lives here, indexed. Read this first, then edit code surgically. -Current build version: v0.11.1 +Current build version: v0.12.0 Last updated: 2026-11-02 · v0.8.0 engine MCP (dual-era protocol, 44 tools, consent, token, bridge, engine.port, the stdio launcher and mcp mode), the export preview, and the D1 fixes (bridge disconnects and bye, approval keys, withdrawals, root checks before asking, frozen launcher). Before that, B3 v0.7.0 engine (kind edit, /api/edit capability and export sessions with a POST cancel alias, GET /api/media/{id}/probe, /api/sounds with an original synthesised set) and its F2 fix. Before that, A1 v0.6.0 catalogue (Meshy rigging and character models, pages rig and character); W1 v0.6.0 engine (a finished world keeps all its assets and `meta.world`, POST /api/media/{id}/world/complete, the starter pack routes and install job). Before that, 2026-11-01 · E1 v0.5.0 engine (canvas and board project kinds, POST /api/media/mask-video, GET /api/media/{id}/frame). Before that, F5 v0.4.0 fixes (ASCII FBX stored as a 3D model with a start-up correction of earlier items, the FBX original found from its GLB in both link directions, a visible import unhides an identical hidden item). Before that, S5 v0.4.0 engine for the Scene studio: scene projects (kind `scene`, cover upload, role and meta carried in `.fcrft`), media migration 4 (`role`, `meta`), the H.264 encoder probe and the engine encode sessions, library 3D items as mesh-tool inputs in the planner. Before that, F2 v0.3.0 fixes (the mask edit colour in the catalogue, hidden media import, a private copy of a character's image, the sog extension). Before that, v0.3.0 library and projects engine: folders, tags, favourite and hidden flags, covers for 3D objects and worlds, characters with an avatar job, prompt history read from the jobs, the .fcrft project store with its hardened reader (schema 3), the mesh-tools page key, and a window policy that lets the 3D viewers run. Before that (v0.2.0), generation: provider clients for fal and World Labs with a key check, the model catalogue and the planner (request to provider call and price), POST /api/generate with the gen.* job runners, and job lanes so long generation jobs cannot block imports and downloads. Before that (v0.1.0), E1 (Phase 3 gaps): `askLocation` setting, save-dialog downloads (`path`, `overwrite`), batch download (inline or as a `download` job), auto-download on job success, CSP on the served window. Before that, wave 2 (C6): ffmpeg found or fetched the family way, ffprobe fill-in of durations and sizes, video poster frames, `ffmpeg` in capabilities. Before that: engine core (Phase 1 skeleton, Phase 3 jobs, events, media, costs, keys) --- diff --git a/backend/app/core/config.py b/backend/app/core/config.py index 57ed872..127ff07 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -3,7 +3,7 @@ from pathlib import Path APP_NAME = "formcraft" -VERSION = "0.11.1" +VERSION = "0.12.0" FRONTEND_PORT = 5290 BACKEND_PORT = 8290 SUBFOLDERS = ("library", "thumbs", "downloads", "db", "settings", "logs") diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index d2a3739..2a60835 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of comment content, explainers, rationale, TODOs and removed code for the frontend side of the repo. Source files stay comment-free per the owner's hashout-log rule; what they would have said lives here, anchored by file and symbol. Read the map and the table of contents first. -Current build version: v0.11.1 +Current build version: v0.12.0 Last updated: 2026-11-02 · v0.8.0 command metadata, live edit commands, the automation bridge and 30 window tools, approvals with withdrawal, the Agents and Updates panels, the bridge goodbye beacon, the new icon in the splash and favicon. Before that, v0.7.0 Edit studio (engine/edit, ui/edit: contract, store and operations, renderer, effects, masks and audio mix, preview and transport, timeline, properties and assets panels, studio shell, files and export), the shared media panel in Canvas, Board and Scene (ui/panels), Add to edit in the Scene strip, lightbox and library, and the F1 and F2 fixes. Before that, v0.6.0 Scene studio from scene to shot: worlds as the environment (ui/scene/world), light and materials (view/ibl.ts, view/contact.ts, models keep their materials), the prompt bar and shot results (ui/scene/shot, replacing the Generate panel), generate into the scene (ui/scene/make), the downloadable starter pack (ui/scene/pack). Before that, 2026-11-01 · v0.5.0 Canvas studio (engine/canvas, ui/canvas: stage and tools, files, generate, results, 3D model nodes), Board studio (engine/board, ui/board: shell, grid, inspector, Present, board canvas view), Background change and video region removal (ui/tools/background-change, remove-region video mode), the app.ts wiring and `maskVideo` in io/api.ts. Before that, v0.4.0 F5 fixes (FBX conversion, pooled model renderer, Coming later), v0.4.0 Scene studio (engine/scene, ui/scene: host and view, object builders, procedural starter kit, editor chrome and files, presets and placement, outliner and inspector, timeline, posing and animation library, capture and record with mediabunny, Generate box and preview), Mesh tools and FBX conversion (ui/tools/mesh-tools.ts, ui/viewers/fbx-convert.ts, io/api-media-meta.ts), the upload dialog's 3D review step, and the app.ts wiring (mounts, studio-aware drops, close guard). Before that, v0.3.0 F1 fixes (lightbox hand-offs to Remove background, 3D object and World, Open in Scene placeholders, batch groups in the Library studio and the picker, mask polarity from the catalogue, one-step hidden import, character dedupe by content), on top of v0.3.0 Library studio (virtual grid, folders, tags, favourites, hidden items, covers), characters and prompt history, tags and favourite in the lightbox, 3D object and Gaussian splat viewers with covers, the 3D object and World pages, the tool pages (Angles, Remove background, Remove a region, Frame extractor, Storyboard) and projects (New and Open, .fcrft files, Home project lists). Before that (v0.2.0) Create pages: window model store and labels, model picker and options bar, prompt box with the mention editor and the fullscreen editor, reference deck and library modal, generation feed, lightbox, audio player and upload dialog, the Image, Video and Audio pages with the prompt store and handoffs, Behavior and Generation preferences, and gen.* job names in the job toasts. Before that (v0.1.0), E2 gap closing (job toasts, downloads with Ask where to save, Home file selection and delete, studio restore prefs, About dialog, cheatsheet hold time and pin), on top of wave 2 (title bar and menus, status bar and Jobs list, Home and importer, Preferences and panels, shortcuts panel, cheatsheet, alert sounds) and the orchestrator's integration edits in app.ts, ui/dom.ts, ui/menus.ts and styles/home.css --- diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 1c0338c..a5fd6a2 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "formcraft-frontend", - "version": "0.11.1", + "version": "0.12.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "formcraft-frontend", - "version": "0.11.1", + "version": "0.12.0", "license": "Apache-2.0", "dependencies": { "@fontsource/inter": "5.3.0", diff --git a/frontend/package.json b/frontend/package.json index ee3a2e2..ed2d49b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "formcraft-frontend", "private": true, - "version": "0.11.1", + "version": "0.12.0", "description": "formcraft frontend · the studio window", "license": "Apache-2.0", "type": "module", diff --git a/setup/form-app.json b/setup/form-app.json index 863d26f..5f7f207 100644 --- a/setup/form-app.json +++ b/setup/form-app.json @@ -4,7 +4,7 @@ "id": "formcraft", "app": "formcraft", "name": "FormCraft", - "version": "0.11.1", + "version": "0.12.0", "agents": { "mcp": { "available": true, diff --git a/setup/mcpb/manifest.json b/setup/mcpb/manifest.json index e07dcc8..0b8db8d 100644 --- a/setup/mcpb/manifest.json +++ b/setup/mcpb/manifest.json @@ -2,7 +2,7 @@ "manifest_version": "0.3", "name": "formcraft", "display_name": "FormCraft", - "version": "0.11.1", + "version": "0.12.0", "description": "Drive the FormCraft studio from an agent: generate images, video, audio, 3D and worlds, search the library, manage projects and cut edits.", "long_description": "Starts the FormCraft engine in MCP mode over stdio. It attaches to a running FormCraft app when there is one and otherwise runs headless. Generation uses your own provider keys stored in FormCraft; agents must be allowed in FormCraft Preferences.", "author": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 01572b3..850391b 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1073,7 +1073,7 @@ dependencies = [ [[package]] name = "formcraft" -version = "0.11.1" +version = "0.12.0" dependencies = [ "objc2", "objc2-app-kit", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e4c56fb..0faf2ba 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "formcraft" -version = "0.11.1" +version = "0.12.0" description = "formcraft desktop shell" authors = ["NodeAgentc, Inc."] license = "Apache-2.0" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6c641dc..631b9b6 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "FormCraft", - "version": "0.11.1", + "version": "0.12.0", "identifier": "ai.nodemode.formcraft", "build": { "frontendDist": "../frontend/dist"