Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
fix(ui): drop wheel scrolling from floating window title actions
Josh Corbettd66ea137f961
diff --git a/invokeai/frontend/webv2/ARCHITECTURE.md b/invokeai/frontend/webv2/ARCHITECTURE.mdindex 51a5e35b85..ad0ce1b640 100644--- a/invokeai/frontend/webv2/ARCHITECTURE.md+++ b/invokeai/frontend/webv2/ARCHITECTURE.md@@ -136,7 +136,7 @@ Workbench focus is transient and never persisted. `WorkbenchFocusProvider` (`wor- **One commit per gesture.** Pointer moves are coalesced to animation frames and previewed as inline custom properties on the window element; the store is written once, when the gesture ends — on release, or when the pointer is taken away (`pointercancel`, a release the page never saw), which keeps what was dragged so far. Escape discards the preview. Each keyboard step is its own commit.- **Resize handles.** Eight pointer-only handles (four edges, four corners) straddle the border with matching cursors and non-overlapping hit areas, above an isolated content frame so widget stacking cannot cover them. Inside the bottom-right corner sits the `ResizeCorner`, the single labelled, keyboard-operable resize control; the pointer-only handle there is clipped to the band outside the border. That control announces the size on screen — the stored size as the viewport caps it — and follows the viewport, so its value and its keyboard steps agree. `resizeFloatingGeometry` anchors the opposite side, holds the size between the minimum and the viewport, and stops the top edge at the viewport's top.- **One gesture path.** The title bar, the grip, and every handle start through the window's single pointer session, so a new gesture replaces the one before it and resize gestures all raise the platform's resize-drag signal. The preview names the mode the gesture began in and applies only while the window is still in that mode: a window that maximizes or collapses under a gesture shows its new frame at once, and the gesture ends itself — releasing the drag cursor and committing nothing — the next time it hears from the pointer. Docking, removing, or switching project unmounts the host (hosts are keyed by project and instance), which aborts the session.-- **Title bar.** Double-click maximizes or restores, and expands a collapsed window; Restore returns to the windowed geometry, which maximizing never touches. Collapse and Expand are explicit buttons. The label truncates first, down to its icon; contributed widget actions then give way in a strip that scrolls, without a scrollbar, by focus, wheel, or touch, so a focused action is always in view with its ring; the window's own controls never shrink.+- **Title bar.** Double-click maximizes or restores, and expands a collapsed window; Restore returns to the windowed geometry, which maximizing never touches. Collapse and Expand are explicit buttons. The label truncates first, down to its icon; contributed widget actions then give way in a strip that scrolls, without a scrollbar, by focus, a sideways scroll, or touch, so a focused action is always in view with its ring; the window's own controls never shrink.- **Shaded bodies stay mounted.** A shaded body is hidden with React `Activity`, so its local state survives and no second copy mounts. Drafts are flushed before shading, docking, and removing, because hiding or unmounting an editor stops its flusher.## Settings contributionsdiff --git a/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.browser.test.tsxindex c95511f468..66cc43115d 100644--- a/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.browser.test.tsx+++ b/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.browser.test.tsx@@ -444,17 +444,6 @@ describe('FloatingWidgetWindow chrome', () => {}});- it('scrolls the contributed actions with a plain wheel', async () => {- windowMocks.useWideActions = true;- await renderWindow({ ...state, widthPx: 280 });-- const strip = host!.querySelector<HTMLElement>('[data-floating-actions]')!;-- await act(() => strip.dispatchEvent(new WheelEvent('wheel', { bubbles: true, cancelable: true, deltaY: 60 })));-- expect(strip.scrollLeft).toBe(60);- });-it('keeps its own controls inside a minimum-width window whatever the widget contributes', async () => {windowMocks.useWideActions = true;await renderWindow({ ...state, widthPx: 280 });diff --git a/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.tsx b/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.tsxindex ed92f69471..4ed60027c0 100644--- a/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.tsx+++ b/invokeai/frontend/webv2/src/workbench/widget-frame/FloatingWidgetWindow.tsx@@ -6,7 +6,6 @@ import { flushWorkbenchDrafts } from '@platform/react/draftRegistry';import { IconButton } from '@platform/ui/Button';import { ResizeCorner, trackResizeDrag, usePointerDrag } from '@platform/ui/ResizeHandle';import { Tooltip } from '@platform/ui/Tooltip';-import { wheelScrollsHorizontally } from '@platform/ui/wheelScrollsHorizontally';import {clampWindowToViewport,commitResizedAxes,@@ -88,7 +87,7 @@ const WINDOW_SX: SystemStyleObject = {'&:focus-visible > [data-floating-frame]': FOCUS_RING,};-// The title bar has no room for a scrollbar; the strip scrolls by focus, wheel, and touch.+// The title bar has no room for a scrollbar; the strip scrolls by focus, a sideways scroll, and touch.const ACTIONS_SCROLL_SX: SystemStyleObject = { '&::-webkit-scrollbar': { display: 'none' }, scrollbarWidth: 'none' };/** A window is never shown larger than the viewport, so a resize does not grow past it either. */@@ -721,13 +720,12 @@ export const FloatingWidgetWindow = ({* Render widget actions and settings in a row because floating content has no frame header; window* controls already own layout actions. Contributed actions give way before they can push the window's* own controls out of a narrow title bar: the ones that do not fit scroll, so focus brings each into- * view and a wheel reaches the rest.+ * view and a sideways scroll or swipe reaches the rest.*/}{isEnabled && widget ? (<FloatingChromeBoundary><Suspense fallback={null}><HStack- ref={wheelScrollsHorizontally}css={ACTIONS_SCROLL_SX}flex="0 1 auto"gap="1"