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(`