From 8c1049d9b503aef36c53b0f7c8a8778c04c1cbd3 Mon Sep 17 00:00:00 2001
From: nodemode-ai
Date: Mon, 30 Nov 2026 15:39:26 -0500
Subject: [PATCH 1/4] fix(menu): keep bar dropdowns and their submenus under
the bar, three quarters tall at most (0.47.0)
A bar dropdown's cap was the room below it with a 160 px minimum, so in a
short window the minimum pushed it past the bottom, and submenus clamped
their top to the window top, over the bar. openAt(x, y, true) now keeps
floor = y and caps the panel at menuCap(y), at most 75% of the window and
never past its bottom, set before measuring. openBeside takes the root's
floor and the same cap. Hover aim is unchanged. HASHOUT_LOG entry 231.
---
frontend/HASHOUT_LOG.md | 13 +++++++++++++
frontend/src/ui/menu.ts | 13 +++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md
index cff309b..072de46 100644
--- a/frontend/HASHOUT_LOG.md
+++ b/frontend/HASHOUT_LOG.md
@@ -1399,3 +1399,16 @@ The case entry 228 left open (a window started before its engine) was the test's
formdeck has no About page in Preferences; its About block is the top of the Help dialog, so the notices go there, below Learn more, as a closed "Third-party notices" disclosure. Opening it the first time asks `GET /api/notices` and writes the text into a monospace box (fixed 280 px height, its own scroll; `translate="no"`, so the licence texts are never machine-translated). On a failure a sentence names THIRD-PARTY-NOTICES.txt beside the app and the next opening asks again. Nothing is rebuilt: the box and the sentence exist from the start and are patched. Key part 47 carries the two sentences in all 25 tables; no native speaker has read them.
Checked: i18n check passed; built window, Chromium, English, German and Japanese: the summary reads "Third-party notices", "Hinweise zu Drittanbietern", "サードパーティの通知", and opening it shows the whole file (1,490,149 characters) with the failure sentence hidden.
+
+## 231. Bar dropdowns and their submenus keep under the bar, three quarters tall at most · _v0.47.0 (ui/menu.ts MENU_SHARE, MENU_PAD, menuCap, PopupMenu.floor, PopupMenu.openAt below, PopupMenu.openBeside)
+
+FORM-MENU-OVERLAP-FIX 1.2.0 (group B). Entry 43 already kept a bar dropdown at `y`, but its cap was the room below `y` with a 160 px minimum, so in a short window the minimum pushed the menu past the window's bottom, and a submenu clamped its top to 4 px from the window top, over the bar. `openAt(x, y, true)` now records `floor = y` and caps the panel at `menuCap(y)`: at most 75% of `innerHeight` and never past `innerHeight - y - 4`, set inline before the panel is measured, while it is `visibility: hidden`. `openBeside` reads the root menu's floor, takes the same cap before measuring, and never places a submenu above that floor; it still opens beside its row. The ribbon's dropdowns and File menu use the same `below` path and get the same cap. The hover-aim code (`within`, `AIM_MS`) is unchanged; the bar already closes its menu on `resize`.
+
+Removed:
+
+```ts
+const MIN_DROP = 160;
+this.panel.style.maxHeight = below ? `${Math.max(MIN_DROP, window.innerHeight - y - 8)}px` : '';
+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));
+```
diff --git a/frontend/src/ui/menu.ts b/frontend/src/ui/menu.ts
index 4867a0a..2a93e37 100644
--- a/frontend/src/ui/menu.ts
+++ b/frontend/src/ui/menu.ts
@@ -5,7 +5,8 @@ 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 MIN_DROP = 160;
+const MENU_SHARE = 0.75, MENU_PAD = 4;
+export const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(window.innerHeight - top - MENU_PAD)));
const AIM_MS = 260;
let px = NaN, py = NaN, tracking = false;
@@ -41,6 +42,7 @@ export class PopupMenu {
private subTop = 0;
private aim = 0;
private from: Pt | null = null;
+ private floor: number | null = null;
onClose: (() => void) | null = null;
constructor(private readonly commands: Commands, private readonly parent: PopupMenu | null = null, standalone = false) {
@@ -124,9 +126,10 @@ export class PopupMenu {
}
openAt(x: number, y: number, below = false): void {
+ this.floor = below ? y : null;
this.refresh();
this.panel.style.visibility = 'hidden';
- this.panel.style.maxHeight = below ? `${Math.max(MIN_DROP, window.innerHeight - y - 8)}px` : '';
+ this.panel.style.maxHeight = below ? `${menuCap(y)}px` : '';
this.panel.hidden = false;
this.panel.scrollTop = 0;
const w = this.panel.offsetWidth, h = this.panel.offsetHeight;
@@ -142,11 +145,13 @@ export class PopupMenu {
this.refresh();
this.panel.style.visibility = 'hidden';
this.panel.hidden = false;
+ const floor = this.root().floor, pad = MENU_PAD;
+ this.panel.style.maxHeight = floor === null ? '' : `${menuCap(floor)}px`;
this.panel.scrollTop = 0;
- const w = this.panel.offsetWidth, h = this.panel.offsetHeight, pad = 4;
+ 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.panel.style.visibility = '';
From 83beb570f022f1ad0e0252b21116f4bb68bb310a Mon Sep 17 00:00:00 2001
From: nodemode-ai
Date: Mon, 30 Nov 2026 15:40:54 -0500
Subject: [PATCH 2/4] feat(menu): show a fade and a small pill while a menu has
rows below (0.47.0)
Every .fd-menu is now a glass card holding a scrolling .fd-menu-list and
a .fd-menu-more pill. While rows remain below, the list's bottom rows fade
into the card's glass and the pill shows; at the last row both fade out in
160 ms and come back in 490 ms. A menu opens with the hint already in place
and a menu that fits shows nothing. The bar's PopupMenu, the ribbon's
ActionMenu and Home's card menu all use it. HASHOUT_LOG entry 232.
---
frontend/HASHOUT_LOG.md | 15 +++++++++++++++
frontend/src/styles/dialogs.css | 9 +++++++++
frontend/src/ui/home.ts | 16 +++++++++++-----
frontend/src/ui/menu.ts | 33 ++++++++++++++++++++++++---------
frontend/src/ui/ribbon.ts | 15 +++++++++------
5 files changed, 68 insertions(+), 20 deletions(-)
diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md
index 072de46..58ac389 100644
--- a/frontend/HASHOUT_LOG.md
+++ b/frontend/HASHOUT_LOG.md
@@ -1412,3 +1412,18 @@ this.panel.style.maxHeight = below ? `${Math.max(MIN_DROP, window.innerHeight -
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));
```
+
+## 232. A cut-off menu shows that more rows are below · _v0.47.0 (ui/menu.ts MENU_CARD, moreHint, PopupMenu constructor, setItems, showSub, openAt, openBeside, showMore; ui/ribbon.ts ActionMenu; ui/home.ts card menu; styles/dialogs.css .fd-menu-list, .fd-menu-more)
+
+The person who reported the overlap asked for a sign that a menu scrolls. Menus are glass, so a gradient painted over the rows would show as a band and a mask on the scrolling panel would fade its glass, border and shadow too. Every `.fd-menu` is now a card (`MENU_CARD`) that does not scroll, holding `.fd-menu-list`, which does, and the `.fd-menu-more` pill. The mask sits on the list, so the bottom rows fade into the card's own glass: opaque to `100% - min(88px, 40%)`, clear from `100% - min(22px, 10%)` while `--fd-menu-more` is 1. The pill is 56 by 12, 6 px above the bottom, glass border and background, a currentColor chevron, `pointer-events: none`. `moreHint` sets `has-more` while rows remain below (more than 1 px), on open and on every list scroll; at the last row both fade out in 160 ms and come back in 490 ms (the transition of the state entered). On open it runs with `no-fade` and a forced style read, so the hint is in place on the first painted frame and never fades in. `has-more` adds `scroll-padding-block-end`, so a row focused with the arrow keys is never left inside the fade. `--fd-menu-more` is a registered `@property` so the mask can animate; reduced motion switches with no fade.
+
+Rows, separators, `subTop` and `scrollTop = 0` moved from the panel to the list; `has-checks`, `max-height`, position and visibility stay on the card. The ribbon's `ActionMenu` and Home's card menu share the class, so they take the same card and hint (their keyboard and focus code reads buttons by selector, which still finds them). Nothing outside these files reads a menu's children or `scrollTop`.
+
+Removed:
+
+```ts
+this.panel = el('');
+this.panel.addEventListener('scroll', () => { if (this.panel.scrollTop !== this.subTop) this.closeSub(); }, { passive: true });
+private readonly panel = el('');
+this.menu = el('');
+```
diff --git a/frontend/src/styles/dialogs.css b/frontend/src/styles/dialogs.css
index 48c4b89..bf00003 100644
--- a/frontend/src/styles/dialogs.css
+++ b/frontend/src/styles/dialogs.css
@@ -1,5 +1,14 @@
.fd-menu { position: fixed; min-width: 232px; max-height: calc(100vh - 8px); padding: 6px; overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-xl); }
.fd-menu[hidden] { display: none; }
+@property --fd-menu-more { syntax: ''; inherits: false; initial-value: 0; }
+.fd-menu:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
+.fd-menu-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; --fd-menu-more: 0; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - min(88px, 40%)), rgb(0 0 0 / calc(1 - var(--fd-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(--fd-menu-more))) calc(100% - min(22px, 10%))); transition: --fd-menu-more 160ms ease-out; }
+.fd-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; }
+.fd-menu-more svg { width: 12px; height: 8px; }
+.fd-menu.has-more > .fd-menu-list { --fd-menu-more: 1; scroll-padding-block-end: min(88px, 40%); transition-duration: 490ms; }
+.fd-menu.has-more > .fd-menu-more { opacity: 1; transition-duration: 490ms; }
+.fd-menu.no-fade > .fd-menu-list, .fd-menu.no-fade > .fd-menu-more { transition: none; }
+@media (prefers-reduced-motion: reduce) { .fd-menu-list, .fd-menu-more { transition: none; } }
.fd-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(--fd-14); text-align: left; cursor: default; }
.fd-menu.has-checks .fd-menu-item { grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 8px; padding-left: 8px; }
.fd-menu-item:hover:not(:disabled), .fd-menu-item.is-focus:not(:disabled), .fd-menu-sub.is-open:not(:disabled) { background: color-mix(in srgb, var(--text-primary) 10%, transparent); color: var(--text-primary); }
diff --git a/frontend/src/ui/home.ts b/frontend/src/ui/home.ts
index d6265b1..6623c75 100644
--- a/frontend/src/ui/home.ts
+++ b/frontend/src/ui/home.ts
@@ -5,8 +5,9 @@ import { SlideView } from '../render/slide';
import { brandMark } from './brand';
import { DEMOS, type DemoId } from './demos';
import { Dialog } from './dialogs';
-import { el, escapeHtml, patchList, setClass, setHidden, setText } from './dom';
+import { el, escapeHtml, patchList, q, setClass, setHidden, setText } from './dom';
import { icon } from './icons';
+import { MENU_CARD, moreHint } from './menu';
import { dismissToast, pushToast, toast } from './toast';
export interface HomeHooks {
@@ -71,6 +72,7 @@ export class Home {
private readonly confirmBar: HTMLElement;
private onConfirm: (() => void) | null = null;
private readonly menu: HTMLElement;
+ private readonly menuList: HTMLElement;
constructor(private readonly hooks: HomeHooks) {
this.root = el(`
@@ -118,7 +120,10 @@ export class Home {
this.recentGridFull = this.root.querySelector('.fd-recent-full') as HTMLElement;
this.trashList = this.root.querySelector('.fd-trash-list') as HTMLElement;
this.confirmBar = this.root.querySelector('.fd-home-confirm') as HTMLElement;
- this.menu = el('');
+ this.menu = el(MENU_CARD);
+ this.menu.classList.add('fd-home-menu');
+ this.menuList = q(this.menu, '.fd-menu-list');
+ this.menuList.addEventListener('scroll', () => moreHint(this.menu, this.menuList), { passive: true });
document.getElementById('overlay-root')?.appendChild(this.menu);
this.preview = new TemplatePreviewDialog(this.hooks);
this.io = new IntersectionObserver((entries) => {
@@ -331,20 +336,21 @@ export class Home {
rows.push([allPinned ? 'Unpin from list' : 'Pin to list', 'pin', () => this.setPinned(ids, !allPinned)]);
rows.push(['Remove from list', 'hide', () => this.setHiddenRecent(ids, true)]);
rows.push([many ? `Delete ${ids.length} decks` : 'Delete', 'del', () => this.requestDelete(ids)]);
- this.menu.textContent = '';
+ this.menuList.textContent = '';
for (const [label, key, run] of rows) {
const b = el(``);
setText(b.querySelector('.fd-menu-label'), label);
b.addEventListener('click', () => { this.closeMenu(); run(); });
- this.menu.appendChild(b);
+ this.menuList.appendChild(b);
}
this.menu.style.visibility = 'hidden';
setHidden(this.menu, false);
const w = this.menu.offsetWidth, h = this.menu.offsetHeight;
this.menu.style.left = `${Math.round(Math.max(4, Math.min(x, window.innerWidth - w - 4)))}px`;
this.menu.style.top = `${Math.round(Math.max(4, Math.min(y, window.innerHeight - h - 4)))}px`;
+ moreHint(this.menu, this.menuList, true);
this.menu.style.visibility = '';
- (this.menu.firstElementChild as HTMLElement | null)?.focus();
+ (this.menuList.firstElementChild as HTMLElement | null)?.focus();
}
private saveRecent(): void {
diff --git a/frontend/src/ui/menu.ts b/frontend/src/ui/menu.ts
index 2a93e37..a77968b 100644
--- a/frontend/src/ui/menu.ts
+++ b/frontend/src/ui/menu.ts
@@ -7,6 +7,15 @@ 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;
export const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(window.innerHeight - top - MENU_PAD)));
+export const MENU_CARD = '';
+
+export function moreHint(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); }
+}
+
const AIM_MS = 260;
let px = NaN, py = NaN, tracking = false;
@@ -34,6 +43,7 @@ function within(a: Pt, e: PointerEvent, r: DOMRect): boolean {
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[] = [];
@@ -47,10 +57,11 @@ export class PopupMenu {
constructor(private readonly commands: Commands, private readonly parent: PopupMenu | null = null, standalone = false) {
track();
- this.panel = el('');
+ this.panel = el(MENU_CARD);
+ this.list = q(this.panel, '.fd-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);
}
@@ -64,13 +75,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(''); this.seps.push(s); this.panel.appendChild(s); continue; }
+ if (item === '-') { const s = el(''); this.seps.push(s); this.list.appendChild(s); continue; }
if (isSub(item)) {
const node = el(``);
setText(q(node, '.fd-menu-label'), item.label);
@@ -81,7 +92,7 @@ export class PopupMenu {
node.addEventListener('pointermove', (e) => this.hover(e, node, () => this.showSub(menu, node), false));
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);
@@ -93,7 +104,7 @@ export class PopupMenu {
node.addEventListener('pointermove', (e) => this.hover(e, node, () => this.closeSub(), false));
node.addEventListener('click', () => { this.root().close(); this.commands.run(item); });
this.rows.push({ id: item, node });
- this.panel.appendChild(node);
+ this.list.appendChild(node);
}
}
@@ -112,7 +123,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();
@@ -131,13 +142,14 @@ export class PopupMenu {
this.panel.style.visibility = 'hidden';
this.panel.style.maxHeight = below ? `${menuCap(y)}px` : '';
this.panel.hidden = false;
- this.panel.scrollTop = 0;
+ 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 = below ? y : Math.max(4, 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 = '';
}
@@ -147,16 +159,19 @@ export class PopupMenu {
this.panel.hidden = false;
const floor = this.root().floor, pad = MENU_PAD;
this.panel.style.maxHeight = floor === null ? '' : `${menuCap(floor)}px`;
- this.panel.scrollTop = 0;
+ 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(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 { moreHint(this.panel, this.list, instant); }
+
private refresh(): void {
for (const r of this.rows) {
const cmd = this.commands.get(r.id);
diff --git a/frontend/src/ui/ribbon.ts b/frontend/src/ui/ribbon.ts
index 06ed279..f74af73 100644
--- a/frontend/src/ui/ribbon.ts
+++ b/frontend/src/ui/ribbon.ts
@@ -1,7 +1,7 @@
import type { Commands } from './commands';
-import { el, escapeHtml, setClass, setDisabled, setHidden, setStyleVar, setTitle } from './dom';
+import { el, escapeHtml, q, setClass, setDisabled, setHidden, setStyleVar, setTitle } from './dom';
import { icon } from './icons';
-import { PopupMenu, type MenuItem } from './menu';
+import { MENU_CARD, moreHint, PopupMenu, type MenuItem } from './menu';
import type { TipHost } from './key-tips';
import { iconOf, plainLabel, type Qat } from './qat';
@@ -32,11 +32,13 @@ interface Meas { rev: number; steps: Step[]; w: number[] }
export interface MenuRow { label: string; run?: () => void; checked?: boolean; disabled?: boolean; sep?: boolean }
export class ActionMenu {
- private readonly panel = el('');
+ private readonly panel = el(MENU_CARD);
+ private readonly list = q(this.panel, '.fd-menu-list');
private opener: HTMLElement | null = null;
constructor() {
document.getElementById('overlay-root')?.appendChild(this.panel);
+ this.list.addEventListener('scroll', () => moreHint(this.panel, this.list), { passive: true });
this.panel.addEventListener('contextmenu', (e) => e.preventDefault());
document.addEventListener('pointerdown', (e) => { if (!this.panel.hidden && !this.panel.contains(e.target as Node)) this.close(false); }, true);
window.addEventListener('blur', () => this.close(false));
@@ -52,15 +54,15 @@ export class ActionMenu {
open(rows: MenuRow[], x: number, y: number, opener: HTMLElement | null = null): void {
this.opener = opener;
- this.panel.textContent = '';
+ this.list.textContent = '';
this.panel.classList.toggle('has-checks', rows.some((r) => r.checked !== undefined));
for (const r of rows) {
- if (r.sep) { this.panel.appendChild(el('')); continue; }
+ if (r.sep) { this.list.appendChild(el('')); continue; }
const b = el(``);
(b.querySelector('.fd-menu-label') as HTMLElement).textContent = r.label;
b.disabled = !!r.disabled;
b.addEventListener('click', () => { this.close(false); r.run?.(); });
- this.panel.appendChild(b);
+ this.list.appendChild(b);
}
this.panel.style.visibility = 'hidden';
this.panel.hidden = false;
@@ -69,6 +71,7 @@ export class ActionMenu {
const top = Math.max(4, Math.min(y + h <= window.innerHeight - 4 ? y : y - h, window.innerHeight - h - 4));
this.panel.style.left = `${Math.round(left)}px`;
this.panel.style.top = `${Math.round(top)}px`;
+ moreHint(this.panel, this.list, true);
this.panel.style.visibility = '';
this.panel.querySelector('button:not(:disabled)')?.focus();
}
From f7571f0a47c0db59fa63bb270e08ff57c185e730 Mon Sep 17 00:00:00 2001
From: nodemode-ai
Date: Mon, 30 Nov 2026 15:42:01 -0500
Subject: [PATCH 3/4] fix(menu): keep right-click menus under the bar and to
the same cap (0.47.0)
Menus opened at a point clamped their top to 4 px from the window top
with only the stylesheet's 100vh - 8px cap, so a long one opened low in a
short window slid over the menu bar. PopupMenu.openAt, the ribbon's
ActionMenu and Home's card menu now take the bar's bottom edge as their
floor (the window top when the bar is not drawn) and cap at menuCap(floor)
before measuring. They still open at the pointer, flipped when there is no
room, and their submenus keep to the same floor. HASHOUT_LOG entry 233.
---
frontend/HASHOUT_LOG.md | 14 ++++++++++++++
frontend/src/ui/home.ts | 6 ++++--
frontend/src/ui/menu.ts | 8 +++++---
frontend/src/ui/ribbon.ts | 6 ++++--
4 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md
index 58ac389..a3d2972 100644
--- a/frontend/HASHOUT_LOG.md
+++ b/frontend/HASHOUT_LOG.md
@@ -1427,3 +1427,17 @@ this.panel.addEventListener('scroll', () => { if (this.panel.scrollTop !== this.
private readonly panel = el('');
this.menu = el('');
```
+
+## 233. Right-click menus keep under the bar and take the same cap · _v0.47.0 (ui/menu.ts barFloor, PopupMenu.openAt; ui/ribbon.ts ActionMenu.open; ui/home.ts openMenu)
+
+`openAt(x, y)` without `below` (the editor's canvas and thumbnail menus, deck tabs, rulers, points, the table menu, Present and Share) clamped its top to 4 px from the window top, with only the stylesheet's `calc(100vh - 8px)` as a cap, so a long menu opened low in a short window slid over the menu bar. It now takes `barFloor()` (the bottom of `.fd-menubar` plus 4, or 4 when the bar is not drawn: macOS system menus, view-only), caps the panel at `menuCap(floor)` before measuring, and clamps its top to that floor instead of 4. It still opens at the pointer, flipped above or left when there is no room. Its submenus read that floor through `root()`, so the `null` branch in `openBeside` is now only a guard. The ribbon's `ActionMenu` (ribbon and Quick Access right-click, the Quick Access dropdown) and Home's card menu had their own copy of the clamp and get the same floor and cap.
+
+Removed:
+
+```ts
+this.floor = below ? y : null;
+this.panel.style.maxHeight = below ? `${menuCap(y)}px` : '';
+const top = below ? y : Math.max(4, Math.min(fitsBelow ? y : y - h, window.innerHeight - h - 4));
+const top = Math.max(4, Math.min(y + h <= window.innerHeight - 4 ? y : y - h, window.innerHeight - h - 4));
+this.menu.style.top = `${Math.round(Math.max(4, Math.min(y, window.innerHeight - h - 4)))}px`;
+```
diff --git a/frontend/src/ui/home.ts b/frontend/src/ui/home.ts
index 6623c75..fe887ad 100644
--- a/frontend/src/ui/home.ts
+++ b/frontend/src/ui/home.ts
@@ -7,7 +7,7 @@ import { DEMOS, type DemoId } from './demos';
import { Dialog } from './dialogs';
import { el, escapeHtml, patchList, q, setClass, setHidden, setText } from './dom';
import { icon } from './icons';
-import { MENU_CARD, moreHint } from './menu';
+import { barFloor, MENU_CARD, menuCap, moreHint } from './menu';
import { dismissToast, pushToast, toast } from './toast';
export interface HomeHooks {
@@ -343,11 +343,13 @@ export class Home {
b.addEventListener('click', () => { this.closeMenu(); run(); });
this.menuList.appendChild(b);
}
+ const floor = barFloor();
this.menu.style.visibility = 'hidden';
+ this.menu.style.maxHeight = `${menuCap(floor)}px`;
setHidden(this.menu, false);
const w = this.menu.offsetWidth, h = this.menu.offsetHeight;
this.menu.style.left = `${Math.round(Math.max(4, Math.min(x, window.innerWidth - w - 4)))}px`;
- this.menu.style.top = `${Math.round(Math.max(4, Math.min(y, window.innerHeight - h - 4)))}px`;
+ this.menu.style.top = `${Math.round(Math.max(floor, Math.min(y, window.innerHeight - h - 4)))}px`;
moreHint(this.menu, this.menuList, true);
this.menu.style.visibility = '';
(this.menuList.firstElementChild as HTMLElement | null)?.focus();
diff --git a/frontend/src/ui/menu.ts b/frontend/src/ui/menu.ts
index a77968b..381fc0a 100644
--- a/frontend/src/ui/menu.ts
+++ b/frontend/src/ui/menu.ts
@@ -7,6 +7,7 @@ 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;
export const menuCap = (top: number): number => Math.max(0, Math.min(Math.floor(window.innerHeight * MENU_SHARE), Math.floor(window.innerHeight - top - MENU_PAD)));
+export const barFloor = (): number => { const r = document.querySelector('.fd-menubar')?.getBoundingClientRect(); return r && r.height > 0 ? r.bottom + MENU_PAD : MENU_PAD; };
export const MENU_CARD = '';
export function moreHint(panel: HTMLElement, list: HTMLElement, instant = false): void {
@@ -137,16 +138,17 @@ export class PopupMenu {
}
openAt(x: number, y: number, below = false): void {
- this.floor = below ? y : null;
+ const floor = below ? y : barFloor();
+ this.floor = floor;
this.refresh();
this.panel.style.visibility = 'hidden';
- this.panel.style.maxHeight = below ? `${menuCap(y)}px` : '';
+ this.panel.style.maxHeight = `${menuCap(floor)}px`;
this.panel.hidden = false;
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 = below ? y : Math.max(4, Math.min(fitsBelow ? y : y - h, window.innerHeight - h - 4));
+ const top = below ? y : Math.max(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);
diff --git a/frontend/src/ui/ribbon.ts b/frontend/src/ui/ribbon.ts
index f74af73..e8f5ae9 100644
--- a/frontend/src/ui/ribbon.ts
+++ b/frontend/src/ui/ribbon.ts
@@ -1,7 +1,7 @@
import type { Commands } from './commands';
import { el, escapeHtml, q, setClass, setDisabled, setHidden, setStyleVar, setTitle } from './dom';
import { icon } from './icons';
-import { MENU_CARD, moreHint, PopupMenu, type MenuItem } from './menu';
+import { barFloor, MENU_CARD, menuCap, moreHint, PopupMenu, type MenuItem } from './menu';
import type { TipHost } from './key-tips';
import { iconOf, plainLabel, type Qat } from './qat';
@@ -64,11 +64,13 @@ export class ActionMenu {
b.addEventListener('click', () => { this.close(false); r.run?.(); });
this.list.appendChild(b);
}
+ const floor = barFloor();
this.panel.style.visibility = 'hidden';
+ this.panel.style.maxHeight = `${menuCap(floor)}px`;
this.panel.hidden = false;
const w = this.panel.offsetWidth, h = this.panel.offsetHeight;
const left = Math.max(4, Math.min(x, window.innerWidth - w - 4));
- const top = Math.max(4, Math.min(y + h <= window.innerHeight - 4 ? y : y - h, window.innerHeight - h - 4));
+ const top = Math.max(floor, Math.min(y + h <= window.innerHeight - 4 ? y : y - h, window.innerHeight - h - 4));
this.panel.style.left = `${Math.round(left)}px`;
this.panel.style.top = `${Math.round(top)}px`;
moreHint(this.panel, this.list, true);
From a15fa0ee73f02e039c0c4297433d6b21ae356182 Mon Sep 17 00:00:00 2001
From: nodemode-ai
Date: Mon, 30 Nov 2026 15:56:40 -0500
Subject: [PATCH 4/4] chore(release): 0.47.0, menus keep under the bar and show
when more rows are below (0.47.0)
Menu bar dropdowns, their submenus and right-click menus keep under the
menu bar, are at most three quarters of the window tall, and show a fade
and a small pill while rows remain below.
Version sites: frontend/package.json, both package-lock.json fields,
frontend/src/version.ts, backend/app/__init__.py, src-tauri/Cargo.toml,
formdeck's entry in src-tauri/Cargo.lock, src-tauri/tauri.conf.json, the
README badge, and a 0.47.0 line in the Flatpak release list.
The three browser demos (demo/, demos/present, demos/build) were rebuilt
with their own builds and came out byte-identical: they use neither the
menu code nor the menu styles, and do not show the version.
Checked: tests/test_f4_versions.py 3 passed; tsc --noEmit clean; vite
build clean.
---
README.md | 2 +-
backend/app/__init__.py | 2 +-
frontend/package-lock.json | 4 ++--
frontend/package.json | 2 +-
frontend/src/version.ts | 2 +-
src-tauri/Cargo.lock | 2 +-
src-tauri/Cargo.toml | 2 +-
src-tauri/flatpak/ai.nodemode.formdeck.metainfo.xml | 1 +
src-tauri/tauri.conf.json | 2 +-
9 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 8daf618..cf26c8c 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
with an MCP server so an agent can draft a deck from your material. Local-first, no account.
-
+
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
index b2ee5be..bf97bc4 100644
--- a/backend/app/__init__.py
+++ b/backend/app/__init__.py
@@ -1 +1 @@
-__version__ = "0.46.3"
+__version__ = "0.47.0"
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 772c810..4b9d05b 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "formdeck",
- "version": "0.46.3",
+ "version": "0.47.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "formdeck",
- "version": "0.46.3",
+ "version": "0.47.0",
"license": "Apache-2.0",
"dependencies": {
"@fontsource/archivo": "5.3.0",
diff --git a/frontend/package.json b/frontend/package.json
index b066f64..1435ab6 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,7 +1,7 @@
{
"name": "formdeck",
"private": true,
- "version": "0.46.3",
+ "version": "0.47.0",
"description": "formdeck · presentations and decks in the form family",
"license": "Apache-2.0",
"type": "module",
diff --git a/frontend/src/version.ts b/frontend/src/version.ts
index 0f0d74b..09afc31 100644
--- a/frontend/src/version.ts
+++ b/frontend/src/version.ts
@@ -1 +1 @@
-export const VERSION = '0.46.3';
+export const VERSION = '0.47.0';
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index f8c099d..783280c 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -1115,7 +1115,7 @@ dependencies = [
[[package]]
name = "formdeck"
-version = "0.46.3"
+version = "0.47.0"
dependencies = [
"fontdb",
"gtk",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 0c7de14..dc10057 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "formdeck"
-version = "0.46.3"
+version = "0.47.0"
description = "formdeck desktop shell"
authors = ["NodeAgentc, Inc."]
license = "Apache-2.0"
diff --git a/src-tauri/flatpak/ai.nodemode.formdeck.metainfo.xml b/src-tauri/flatpak/ai.nodemode.formdeck.metainfo.xml
index edf7c28..531af19 100644
--- a/src-tauri/flatpak/ai.nodemode.formdeck.metainfo.xml
+++ b/src-tauri/flatpak/ai.nodemode.formdeck.metainfo.xml
@@ -15,6 +15,7 @@
https://github.com/nodemode-dev/formdeck
+
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 5c3bdf0..cb6b7ae 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": "FormDeck",
- "version": "0.46.3",
+ "version": "0.47.0",
"identifier": "ai.nodemode.formdeck",
"build": {
"frontendDist": "../frontend/dist"