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
feat(canvas): move the Layer editors into the Properties pane
Josh Corbett149bf3b8cd77
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.jsonindex 68be324dd2..39b1910ab2 100644--- a/invokeai/frontend/webv2/public/locales/en.json+++ b/invokeai/frontend/webv2/public/locales/en.json@@ -1505,7 +1505,9 @@},"sections": {"operation": "Operation",- "tool": "Tool"+ "tool": "Tool",+ "generation": "Generation",+ "layer": "Layer"}},"transform": {diff --git a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelEditForm.browser.test.tsx b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelEditForm.browser.test.tsxindex 885dce570f..f34c7fdea7 100644--- a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelEditForm.browser.test.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelEditForm.browser.test.tsx@@ -59,6 +59,16 @@ const setInputValue = (input: HTMLInputElement, value: string): void => {input.dispatchEvent(new Event('input', { bubbles: true }));};+/** Each select trigger's accessible name, resolved through its aria-labelledby references. */+const selectTriggerNames = (host: HTMLElement): string[] =>+ [...host.querySelectorAll('[data-scope="select"][data-part="trigger"]')].map((trigger) =>+ (trigger.getAttribute('aria-labelledby') ?? '')+ .split(' ')+ .map((id) => document.getElementById(id)?.textContent?.trim() ?? '')+ .join(' ')+ .trim()+ );+describe('ModelEditForm', () => {let host: HTMLDivElement;let root: Root;@@ -99,9 +109,10 @@ describe('ModelEditForm', () => {it('offers format, a constrained variant select, and config path for a checkpoint main', async () => {await mount(checkpointMain);- expect(host.querySelector('[aria-label="models.format"]')).not.toBeNull();+ // Each select trigger is named by its surrounding field's label.+ expect(selectTriggerNames(host)).toContain('models.format');// sd-1 main has a curated variant list, so the field is a select.- expect(host.querySelector('[aria-label="models.variant"]')).not.toBeNull();+ expect(selectTriggerNames(host)).toContain('models.variant');expect(host.textContent).toContain('models.configPath');expect(host.querySelector<HTMLInputElement>('input[value="v1-inference.yaml"]')).not.toBeNull();});@@ -111,7 +122,7 @@ describe('ModelEditForm', () => {expect(host.textContent).not.toContain('models.configPath');// sdxl vae has no variant concept: free-text input, no select trigger.- expect(host.querySelector('[aria-label="models.variant"]')).toBeNull();+ expect(selectTriggerNames(host)).not.toContain('models.variant');});it('submits format and config_path alongside the identity fields', async () => {diff --git a/invokeai/frontend/webv2/src/platform/ui/Select.tsx b/invokeai/frontend/webv2/src/platform/ui/Select.tsxindex 1c917eca75..36d4eadc8e 100644--- a/invokeai/frontend/webv2/src/platform/ui/Select.tsx+++ b/invokeai/frontend/webv2/src/platform/ui/Select.tsx@@ -9,7 +9,7 @@ import type {} from '@chakra-ui/react';import type { Key, ReactNode } from 'react';-import { Portal, Select as ChakraSelect } from '@chakra-ui/react';+import { Portal, Select as ChakraSelect, useFieldContext } from '@chakra-ui/react';const getDefaultItemKey = <T extends CollectionItem>(item: T, index: number): Key => {const keyedItem = item as { id?: Key; value?: Key };@@ -38,6 +38,7 @@ export interface SelectProps<T extends CollectionItem> extends Omit<SelectRootPr/** Workbench Select: Chakra's custom Select with the standard trigger, portal, and item markup pre-wired. */export const Select = <T extends CollectionItem>({+ 'aria-label': ariaLabel,collection,contentProps,getItemKey = getDefaultItemKey,@@ -50,28 +51,38 @@ export const Select = <T extends CollectionItem>({valueText,valueTextProps,...rootProps-}: SelectProps<T>) => (- <ChakraSelect.Root collection={collection} {...rootProps}>- <ChakraSelect.HiddenSelect />- <ChakraSelect.Control>- <ChakraSelect.Trigger {...triggerProps}>- <ChakraSelect.ValueText {...valueTextProps}>{valueText}</ChakraSelect.ValueText>- </ChakraSelect.Trigger>- <ChakraSelect.IndicatorGroup {...indicatorGroupProps}>- <ChakraSelect.Indicator />- </ChakraSelect.IndicatorGroup>- </ChakraSelect.Control>- <Portal disabled={!portalled}>- <ChakraSelect.Positioner {...positionerProps}>- <ChakraSelect.Content {...contentProps}>- {collection.items.map((item, index) => (- <ChakraSelect.Item key={getItemKey(item, index)} item={item}>- <ChakraSelect.ItemText>{renderItem(item)}</ChakraSelect.ItemText>- {itemIndicator ? <ChakraSelect.ItemIndicator /> : null}- </ChakraSelect.Item>- ))}- </ChakraSelect.Content>- </ChakraSelect.Positioner>- </Portal>- </ChakraSelect.Root>-);+}: SelectProps<T>) => {+ // Inside a Field the machine adopts the field's label id, so rendering our+ // own Label part there would duplicate that id; the field's visible label+ // already names the trigger.+ const field = useFieldContext();+ return (+ <ChakraSelect.Root collection={collection} {...rootProps}>+ {/* A real (visually hidden) Label part: the machine's trigger always points+ its aria-labelledby at this id, so a bare aria-label must materialize it —+ left on the Root it lands on a div, which ARIA prohibits. */}+ {ariaLabel && !field ? <ChakraSelect.Label srOnly>{ariaLabel}</ChakraSelect.Label> : null}+ <ChakraSelect.HiddenSelect />+ <ChakraSelect.Control>+ <ChakraSelect.Trigger {...triggerProps}>+ <ChakraSelect.ValueText {...valueTextProps}>{valueText}</ChakraSelect.ValueText>+ </ChakraSelect.Trigger>+ <ChakraSelect.IndicatorGroup {...indicatorGroupProps}>+ <ChakraSelect.Indicator />+ </ChakraSelect.IndicatorGroup>+ </ChakraSelect.Control>+ <Portal disabled={!portalled}>+ <ChakraSelect.Positioner {...positionerProps}>+ <ChakraSelect.Content {...contentProps}>+ {collection.items.map((item, index) => (+ <ChakraSelect.Item key={getItemKey(item, index)} item={item}>+ <ChakraSelect.ItemText>{renderItem(item)}</ChakraSelect.ItemText>+ {itemIndicator ? <ChakraSelect.ItemIndicator /> : null}+ </ChakraSelect.Item>+ ))}+ </ChakraSelect.Content>+ </ChakraSelect.Positioner>+ </Portal>+ </ChakraSelect.Root>+ );+};diff --git a/invokeai/frontend/webv2/src/workbench/accountOwnedUiStores.test.ts b/invokeai/frontend/webv2/src/workbench/accountOwnedUiStores.test.tsindex 9bc48bae24..8388753d76 100644--- a/invokeai/frontend/webv2/src/workbench/accountOwnedUiStores.test.ts+++ b/invokeai/frontend/webv2/src/workbench/accountOwnedUiStores.test.ts@@ -15,7 +15,7 @@ describe('account-owned workbench UI stores', () => {commandPaletteStore.setSnapshot({ isOpen: true });settingsDialogStore.setSnapshot({ isOpen: true, sectionId: 'developer' });const unregisterModal = registerHotkeyModalLayer('settings');- requestLayerProperties('user-a-layer', 'filter');+ requestLayerProperties('user-a-layer');// Partial stand-in: the snapshot only needs to be observably non-empty.imageMapStore.patchSnapshot({clusterLabels: { '0': { alternates: [], label: 'cats' } },diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/GenerateCanvasCompositingSection.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/GenerateCanvasCompositingSection.tsxindex 00c1a2381d..19b7cee346 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/GenerateCanvasCompositingSection.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/GenerateCanvasCompositingSection.tsx@@ -1,8 +1,8 @@/*** Canvas compositing settings for the generate widget.*- * Denoising strength USED to live here; it moved to the layers panel's- * Photoshop-style header (`widgets/layers/LayersPanelHeader.tsx`). This section+ * Denoising strength USED to live here; it moved to the Properties pane's+ * Generation section (`widgets/layers/panes/LayerSection.tsx`). This section* holds the rest of the legacy canvas compositing controls — infill method,* coherence pass mode / edge size / min denoise, and mask blur — persisted* per-project in the canvas widget's own `state.values` (same store asdiff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/FilterOptions.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/FilterOptions.test.tsxindex 1000f53965..d4a1891405 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/FilterOptions.test.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/tool-options/FilterOptions.test.tsx@@ -179,11 +179,12 @@ describe('filter operation regions', () => {state({ draft: { settings: { high_threshold: 200, low_threshold: 100 }, type: 'canny_edge_detection' } }));- expect(modes).toContain('aria-label="Filter"');+ // The select names itself through a real (visually hidden) label part.+ expect(modes).toContain('>Filter</label>');expect(modes).toContain('>Auto<');expect(modes).not.toContain('>Process<');- expect(more).not.toContain('aria-label="Filter"');+ expect(more).not.toContain('>Filter</label>');expect(more.indexOf('>Process<')).toBeLessThan(more.indexOf('>Reset<'));expect(more.indexOf('>Reset<')).toBeLessThan(more.indexOf('>Raster layer<'));expect(more.indexOf('>Raster layer<')).toBeLessThan(more.indexOf('>Control layer<'));diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerContextMenu.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerContextMenu.tsxindex 452645e51f..26fa94d98b 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerContextMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerContextMenu.tsx@@ -53,7 +53,6 @@ import type {LayerContextSubmenuId,} from './layerContextMenuLayout';import type { LayerMenuDialogKind, LayerMenuDialogState } from './layerMenuState';-import type { LayerPropertiesSection } from './layerPropertiesRequestStore';import { resolveDefaultControlModelForBase } from './controlModelOptions';import {@@ -536,13 +535,10 @@ const LayerMenu = ({}}, [engine, layer.id, makeStatusError]);- const handleOpenProperties = useCallback(- (section: LayerPropertiesSection) => {- widgets.open({ region: 'right', widgetId: 'layers' });- requestLayerProperties(layer.id, section);- },- [layer.id, widgets]- );+ const handleOpenProperties = useCallback(() => {+ widgets.open({ region: 'right', widgetId: 'layers' });+ requestLayerProperties(layer.id);+ }, [layer.id, widgets]);const handleBooleanRaster = useCallback(async (operation: BooleanRasterOperation) => {diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerPropertiesPopover.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerPropertiesPopover.tsxdeleted file mode 100644index 985ea95a4f..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerPropertiesPopover.tsx+++ /dev/null@@ -1,163 +0,0 @@-import type { CanvasLayerContract } from '@workbench/canvas-engine/api';-import type { CanvasEngineHandle } from '@workbench/widgets/canvas/useCanvasEngine';--import { Popover, Portal, Stack, Switch, Text } from '@chakra-ui/react';-import { useCanvasDocumentEditingLocked } from '@workbench/widgets/canvas/engineStoreHooks';-import { usePreparedCommit } from '@workbench/widgets/canvas/useStructuralCommit';-import { useActiveProjectSelector } from '@workbench/WorkbenchContext';-import { useCallback, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { AdjustmentsPopover } from './AdjustmentsPopover';-import { ControlLayerSettings } from './ControlLayerSettings';-import { InpaintMaskSettings } from './InpaintMaskSettings';-import { RasterLayerFilterSection } from './RasterLayerFilterSection';-import { RegionalGuidanceSettings } from './RegionalGuidanceSettings';--export type LayerPropertiesEngine = Pick<- CanvasEngineHandle,- 'document' | 'exports' | 'interaction' | 'layers' | 'projectId'->;--/** A viewport box the popover anchors to: the row's properties button, or the row itself. */-export interface LayerPropertiesAnchor {- readonly x: number;- readonly y: number;- readonly width: number;- readonly height: number;-}--interface LayerPropertiesPopoverProps {- anchor: LayerPropertiesAnchor;- engine: LayerPropertiesEngine | null;- layer: CanvasLayerContract;- onClose: () => void;-}--/**- * The one per-panel "properties/configure" surface: a popover holding the addressed layer's- * type-specific settings, anchored to the row that asked for it. Rows hold no popover of their- * own, so a large document mounts one settings instance at most. Starting a canvas operation- * closes it before the operation panel takes over; type-specific settings are keyed by layer so- * switching targets always mounts a fresh settings instance.- */-export const LayerPropertiesPopover = ({ anchor, engine, layer, onClose }: LayerPropertiesPopoverProps) => {- const editingLocked = useCanvasDocumentEditingLocked(engine);- const documentRevision = useActiveProjectSelector((project) => project.canvas.documentRevision);- const positioning = useMemo(() => ({ getAnchorRect: () => anchor, placement: 'left-start' as const }), [anchor]);- const handleOpenChange = useCallback(- (details: { open: boolean }) => {- if (!details.open) {- onClose();- }- },- [onClose]- );- return (- <Popover.Root- lazyMount- open={!editingLocked}- positioning={positioning}- unmountOnExit- onOpenChange={handleOpenChange}- >- <Portal>- <Popover.Positioner>- <Popover.Content bg="bg.muted" borderColor="border.emphasized" borderWidth="1px" w="20rem">- <Popover.Body p="2.5">- <Stack gap="2">- <LayerTypeSettings- documentRevision={documentRevision}- engine={engine}- layer={layer}- onOperationStarted={onClose}- />- </Stack>- </Popover.Body>- </Popover.Content>- </Popover.Positioner>- </Portal>- </Popover.Root>- );-};--/** Dispatches to the correct per-type settings block for the layer. */-const LayerTypeSettings = ({- documentRevision,- engine,- layer,- onOperationStarted,-}: {- documentRevision: number;- engine: LayerPropertiesEngine | null;- layer: CanvasLayerContract;- onOperationStarted(): void;-}) => {- switch (layer.type) {- case 'inpaint_mask':- return <InpaintMaskSettings key={layer.id} engine={engine} layer={layer} />;- case 'regional_guidance':- return <RegionalGuidanceSettings key={layer.id} engine={engine} layer={layer} />;- case 'control':- return (- <ControlLayerSettings key={layer.id} engine={engine} layer={layer} onOperationStarted={onOperationStarted} />- );- case 'raster':- return (- <RasterLayerSettings- key={`${engine?.projectId ?? 'none'}-${layer.id}-${documentRevision}`}- engine={engine}- layer={layer}- onOperationStarted={onOperationStarted}- />- );- }-};--/** Raster-layer properties: transparency lock + non-destructive adjustments. */-const RasterLayerSettings = ({- engine,- layer,- onOperationStarted,-}: {- engine: LayerPropertiesEngine | null;- layer: Extract<CanvasLayerContract, { type: 'raster' }>;- onOperationStarted(): void;-}) => {- const commitPrepared = usePreparedCommit(engine);- const { t } = useTranslation();- const isLocked = layer.isTransparencyLocked === true;-- const handleTransparencyLock = useCallback(- (details: { checked: boolean }) => {- commitPrepared(t('widgets.layers.adjustments.transparencyLock'), (model) =>- model.prepare({- before: { isTransparencyLocked: isLocked, layerType: 'raster' },- config: { isTransparencyLocked: details.checked, layerType: 'raster' },- id: layer.id,- type: 'patch-config',- })- );- },- [commitPrepared, isLocked, layer.id, t]- );-- return (- <Stack gap="2">- <Switch.Root checked={isLocked} size="sm" onCheckedChange={handleTransparencyLock}>- <Switch.HiddenInput />- <Switch.Control>- <Switch.Thumb />- </Switch.Control>- <Switch.Label>- <Text fontSize="xs">{t('widgets.layers.adjustments.transparencyLock')}</Text>- </Switch.Label>- </Switch.Root>- <Text color="fg.subtle" fontSize="2xs" fontWeight="700" textTransform="uppercase">- {t('widgets.layers.adjustments.title')}- </Text>- <AdjustmentsPopover engine={engine} layer={layer} />- <RasterLayerFilterSection engine={engine} layer={layer} onOperationStarted={onOperationStarted} />- </Stack>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerRow.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerRow.tsxindex b98b5708d1..7ecf642f03 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerRow.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerRow.tsx@@ -186,7 +186,7 @@ const LayerRowComponent = ({const handleOpenProperties = useCallback((event: MouseEvent<HTMLButtonElement>) => {event.stopPropagation();- commands.openProperties(row.id, anchorFromRect(event.currentTarget.getBoundingClientRect()));+ commands.openProperties(row.id);},[commands, row.id]);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerSurfaceHost.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerSurfaceHost.tsxindex 4cdad28339..a913a185c2 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerSurfaceHost.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerSurfaceHost.tsx@@ -10,17 +10,15 @@ import type { LayerSurfaceAnchor } from './layerRowCommands';import { CanvasLayerContextMenu, type LayerContextMenuEngine } from './LayerContextMenu';import { LayerGroupContextMenu, type LayerGroupContextMenuEngine } from './LayerGroupContextMenu';-import { LayerPropertiesPopover, type LayerPropertiesEngine } from './LayerPropertiesPopover';import { LayerStackMenu } from './LayerStackMenu';export type LayerSurfaceEngine = LayerContextMenuEngine &LayerGroupContextMenuEngine &- LayerPropertiesEngine &- Pick<CanvasEngineHandle, 'exports' | 'projectId'>;+ Pick<CanvasEngineHandle, 'document' | 'exports' | 'projectId'>;/** What the panel currently shows beside a row, addressed by node id rather than owned by the row. */export type LayerSurfaceRequest =- | { readonly kind: 'menu' | 'properties'; readonly id: string; readonly anchor: LayerSurfaceAnchor }+ | { readonly kind: 'menu'; readonly id: string; readonly anchor: LayerSurfaceAnchor }| { readonly kind: 'stack-menu'; readonly stack: LayerStackKind; readonly anchor: LayerSurfaceAnchor };interface LayerSurfaceHostProps {@@ -83,9 +81,6 @@ export const LayerSurfaceHost = ({onClose={onClose}/>) : null}- {surface?.kind === 'properties' && node && node.type !== 'group' && !editingLocked ? (- <LayerPropertiesPopover key={node.id} anchor={surface.anchor} engine={engine} layer={node} onClose={onClose} />- ) : null}</>);};diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.test.tsdeleted file mode 100644index 1dcecdff19..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.test.ts+++ /dev/null@@ -1,22 +0,0 @@-import { describe, expect, it } from 'vitest';--import { createEmptyPaintLayer } from './layerOps';-import { isLayerEditingDisabled, isSameSelection } from './LayersPanelHeader';--describe('LayersPanelHeader selection equality', () => {- it('invalidates the selected-layer view when blend mode changes', () => {- const normal = createEmptyPaintLayer('Layer', 'layer');- const multiply = { ...normal, blendMode: 'multiply' as const };-- expect(isSameSelection(normal, multiply)).toBe(false);- });-});--describe('LayersPanelHeader editing state', () => {- it('disables layer controls without a selection or while engine editing is locked', () => {- const layer = createEmptyPaintLayer('Layer', 'layer');- expect(isLayerEditingDisabled(null, false)).toBe(true);- expect(isLayerEditingDisabled(layer, true)).toBe(true);- expect(isLayerEditingDisabled(layer, false)).toBe(false);- });-});diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.browser.test.tsxindex 72a1596cef..70e0ca9918 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.browser.test.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.browser.test.tsx@@ -183,6 +183,7 @@ const Harness = ({ initialNodes }: { initialNodes: CanvasNodeContract[] }) => {editingLocked={false}engine={engine}panel={panel}+ onRevealProperties={() => undefined}projectId={PROJECT_ID}stacks={stacks}/>diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.tsxindex 981d74bd8a..2f0411d86a 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersTree.tsx@@ -73,6 +73,8 @@ interface LayersTreeProps {document: CanvasDocumentContractV3;editingLocked: boolean;engine: LayersTreeEngine | null;+ /** Reveals the Properties pane's Layer section for `layerId` (selecting it). */+ onRevealProperties: (layerId: string) => void;panel: LayerPanelState;projectId: string;stacks: LayerStackRowsByKind;@@ -112,6 +114,7 @@ export const LayersTree = ({document,editingLocked,engine,+ onRevealProperties,panel,projectId,stacks,@@ -393,7 +396,7 @@ export const LayersTree = ({focusItem(navigation.focus);},openMenu: (id, anchor: LayerSurfaceAnchor) => setSurface({ anchor, id, kind: 'menu' }),- openProperties: (id, anchor: LayerSurfaceAnchor) => setSurface({ anchor, id, kind: 'properties' }),+ openProperties: (id) => onRevealProperties(id),openStackMenu: (stack, anchor: LayerSurfaceAnchor) => setSurface({ anchor, kind: 'stack-menu', stack }),rename: (id, name) => runStructural(t('widgets.layers.actions.rename'), { id, patch: { name }, type: 'patch' }),select: (id, modifiers: LayerSelectionModifiers) => {@@ -434,7 +437,7 @@ export const LayersTree = ({}},}),- [focusItem, movingIds, runStructural, t]+ [onRevealProperties, focusItem, movingIds, runStructural, t]);const closeSurface = useCallback(() => {@@ -508,11 +511,14 @@ export const LayersTree = ({if (pending && pending.scrolled && !pending.opened) {const row = host.querySelector<HTMLElement>(`[data-layer-row-id="${CSS.escape(pending.id)}"]`);if (row) {- pendingProperties.current = { ...pending, opened: true };- setSurface({ anchor: anchorFromRect(row.getBoundingClientRect()), id: pending.id, kind: 'properties' });+ // The row is on screen: reveal the Properties pane's Layer section and+ // settle the request — there is no popover to keep open any more.+ pendingProperties.current = null;+ onRevealProperties(pending.id);+ clearLayerPropertiesRequest(pending.token);}}- }, [panelRows, virtualItems]);+ }, [onRevealProperties, panelRows, virtualItems]);// Focus repair: the browser drops focus to the body when a focused row unmounts, so the tree// remembers whether it owned focus and puts it back on the item that now holds the tab stop.diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersWidgetView.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersWidgetView.tsxindex 0c8423de6e..c8b7ee4591 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersWidgetView.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersWidgetView.tsx@@ -17,7 +17,6 @@ import type { LayerColorPaneLayout, LayerEditorPaneLayout } from './panes/editorimport { LayerMultiSelectionActions } from './LayerMultiSelectionActions';import { LAYER_PANEL_DEGRADE_THRESHOLD } from './layerPanelRows';import { LayersPanelFooter } from './LayersPanelFooter';-import { LayersPanelHeader } from './LayersPanelHeader';import { LayersTree } from './LayersTree';import { buildLayerStackRows } from './layerTreeRows';import {@@ -29,11 +28,10 @@ import {import { LayerColorPane, LayerEditorPanes } from './panes/LayerEditorPanes';/**- * The layers panel: a fixed header (selected layer's opacity + blend mode, global denoising- * strength), a fixed selection toolbar, the virtualized tree of the four stacks, and a fixed- * footer (summary, filter, density), and the editor panes (Properties, Transform) docked at the- * bottom. Regions keep their geometry; their controls disable instead of appearing and- * disappearing.+ * The layers panel: the Color pane at the top, a fixed selection toolbar, the virtualized tree+ * of the four stacks, a fixed footer (summary, filter, density), and the editor panes at the+ * bottom — the selected layer's own editors live in the Properties pane. Regions keep their+ * geometry; their controls disable instead of appearing and disappearing.*/export const LayersWidgetView = ({ runtime }: WidgetViewProps) => {const { t } = useTranslation();@@ -86,11 +84,17 @@ export const LayersWidgetView = ({ runtime }: WidgetViewProps) => {(next: LayerColorPaneLayout) => runtime.state.patch({ colorPane: next }),[runtime.state]);+ const revealProperties = useCallback(+ (layerId: string) => {+ dispatch({ id: layerId, type: 'setCanvasSelectedLayer' });+ runtime.state.patch({ editorPanes: { ...paneLayout, activePane: 'properties', isCollapsed: false } });+ },+ [dispatch, paneLayout, runtime.state]+ );return (<Stack gap="1" h="full" minH="0"><LayerColorPane layout={colorPaneLayout} onLayoutChange={handleColorPaneLayout} />- <LayersPanelHeader /><LayerMultiSelectionActionsdocument={document}editingLocked={editingLocked}@@ -130,6 +134,7 @@ export const LayersWidgetView = ({ runtime }: WidgetViewProps) => {panel={panel}projectId={projectId}stacks={stacks}+ onRevealProperties={revealProperties}/></Flex>)}diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.test.tsindex e9270de1d2..231c4f05f6 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.test.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.test.ts@@ -301,7 +301,7 @@ describe('layer context action registry', () => {getLayerContextActionDefinition('regional-auto-negative').handler(context);expect(effects.reorder).toHaveBeenCalledWith('front', 'move-to-front');- expect(effects.openProperties).toHaveBeenCalledWith('adjustments');+ expect(effects.openProperties).toHaveBeenCalledWith();expect(effects.startFilter).toHaveBeenCalledWith(rasterLayer.id);expect(effects.booleanMerge).toHaveBeenCalledWith('intersect');expect(effects.copyTo).toHaveBeenCalledWith('control');diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.tsindex 8ef7921e65..8ed46bb3e1 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerContextActions.ts@@ -36,8 +36,6 @@ import {WorkflowIcon,} from 'lucide-react';-import type { LayerPropertiesSection } from './layerPropertiesRequestStore';-import { canConvertRasterControl, canMergeLayerDown } from './layerOps';export type LayerContextActionId =@@ -114,7 +112,7 @@ export interface LayerContextActionEffects {startFilter(layerId: string): void;transform(): void;fitToBbox(): void;- openProperties(section: LayerPropertiesSection): void;+ openProperties(): void;saveToAssets(): Promise<void>;copyToClipboard(): Promise<void>;cropToBbox(): Promise<void>;@@ -442,7 +440,7 @@ export const LAYER_CONTEXT_ACTION_DEFINITIONS: readonly LayerContextActionDefini},{defaultLabel: 'Adjustments',- handler: ({ effects }) => effects.openProperties('adjustments'),+ handler: ({ effects }) => effects.openProperties(),icon: SlidersHorizontalIcon,id: 'adjustments',isEnabled: hasMutablePixels,diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.test.tsindex 5c769e43ae..7b692b3c2f 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.test.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.test.ts@@ -1,10 +1,8 @@import { beforeEach, describe, expect, it, vi } from 'vitest';-import { createControlLayer } from './layerOps';import {clearLayerPropertiesRequest,getLayerPropertiesRequest,- isLayerPropertiesRequestedWithin,layerPropertiesRequestStore,requestLayerProperties,} from './layerPropertiesRequestStore';@@ -14,14 +12,14 @@ describe('layerPropertiesRequestStore', () => {clearLayerPropertiesRequest();});- it.each(['filter', 'adjustments'] as const)('publishes and token-safely clears a %s request', (section) => {- requestLayerProperties('layer-1', section);+ it('publishes and token-safely clears a request', () => {+ requestLayerProperties('layer-1');const first = getLayerPropertiesRequest();- requestLayerProperties('layer-2', section);+ requestLayerProperties('layer-2');const second = getLayerPropertiesRequest();- expect(first).toMatchObject({ layerId: 'layer-1', section });- expect(second).toMatchObject({ layerId: 'layer-2', section });+ expect(first).toMatchObject({ layerId: 'layer-1' });+ expect(second).toMatchObject({ layerId: 'layer-2' });clearLayerPropertiesRequest(first?.token);expect(getLayerPropertiesRequest()).toEqual(second);clearLayerPropertiesRequest(second?.token);@@ -32,9 +30,9 @@ describe('layerPropertiesRequestStore', () => {const listener = vi.fn();const unsubscribe = layerPropertiesRequestStore.subscribe(listener);- requestLayerProperties('control-1', 'filter');+ requestLayerProperties('control-1');const first = getLayerPropertiesRequest();- requestLayerProperties('control-1', 'filter');+ requestLayerProperties('control-1');const second = getLayerPropertiesRequest();expect(second?.token).toBeGreaterThan(first?.token ?? 0);@@ -43,9 +41,9 @@ describe('layerPropertiesRequestStore', () => {});it('only clears the request matching the supplied token', () => {- requestLayerProperties('control-1', 'filter');+ requestLayerProperties('control-1');const first = getLayerPropertiesRequest();- requestLayerProperties('control-2', 'filter');+ requestLayerProperties('control-2');const second = getLayerPropertiesRequest();clearLayerPropertiesRequest(first?.token);@@ -53,13 +51,4 @@ describe('layerPropertiesRequestStore', () => {clearLayerPropertiesRequest(second?.token);expect(getLayerPropertiesRequest()).toBeNull();});-- it('identifies the collapsed layer group that must mount to consume the request', () => {- const control = createControlLayer('Control', 'control-1');- requestLayerProperties(control.id, 'filter');- const request = getLayerPropertiesRequest();-- expect(isLayerPropertiesRequestedWithin(request, [control.id])).toBe(true);- expect(isLayerPropertiesRequestedWithin(request, ['raster-1'])).toBe(false);- });});diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.tsindex f4f15ecc88..bbc53dc6cc 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerPropertiesRequestStore.ts@@ -1,11 +1,8 @@import { registerAccountOwnedResource } from '@platform/state/accountLifecycle';import { createExternalStore } from '@platform/state/externalStore';-export type LayerPropertiesSection = 'filter' | 'adjustments';-export interface LayerPropertiesRequest {layerId: string;- section: LayerPropertiesSection;token: number;}@@ -22,8 +19,8 @@ registerAccountOwnedResource({name: 'layer-properties-requests',});-export const requestLayerProperties = (layerId: string, section: LayerPropertiesSection): void => {- layerPropertiesRequestStore.setSnapshot({ request: { layerId, section, token: nextToken++ } });+export const requestLayerProperties = (layerId: string): void => {+ layerPropertiesRequestStore.setSnapshot({ request: { layerId, token: nextToken++ } });};export const clearLayerPropertiesRequest = (token?: number): void => {@@ -37,17 +34,5 @@ export const clearLayerPropertiesRequest = (token?: number): void => {export const getLayerPropertiesRequest = (): LayerPropertiesRequest | null =>layerPropertiesRequestStore.getSnapshot().request;-export const useLayerPropertiesRequest = (layerId: string): LayerPropertiesRequest | null =>- layerPropertiesRequestStore.useSelector(- (snapshot) => (snapshot.request?.layerId === layerId ? snapshot.request : null),- Object.is- );-export const useCurrentLayerPropertiesRequest = (): LayerPropertiesRequest | null =>layerPropertiesRequestStore.useSelector((snapshot) => snapshot.request, Object.is);--/** Whether the pending request targets one of `nodeIds`, so its stack must stay expanded to honour it. */-export const isLayerPropertiesRequestedWithin = (- request: LayerPropertiesRequest | null,- nodeIds: readonly string[]-): boolean => !!request && nodeIds.includes(request.layerId);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerRowCommands.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerRowCommands.tsindex 99db4344fb..1d0944a05e 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/layerRowCommands.ts+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/layerRowCommands.ts@@ -25,7 +25,7 @@ export interface LayerRowCommands {rename(id: string, name: string): void;endRename(): void;openMenu(id: string, anchor: LayerSurfaceAnchor): void;- openProperties(id: string, anchor: LayerSurfaceAnchor): void;+ openProperties(id: string): void;openStackMenu(stack: LayerStackKind, anchor: LayerSurfaceAnchor): void;toggleCollapse(stack: LayerStackKind): void;/** `id` is a node id or a stack header key; the tree tells them apart. */diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.test.tsnew file mode 100644index 0000000000..db639f0088--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.test.ts@@ -0,0 +1,13 @@+import { createEmptyPaintLayer } from '@workbench/widgets/layers/layerOps';+import { describe, expect, it } from 'vitest';++import { isLayerEditingDisabled } from './LayerSection';++describe('LayerSection editing state', () => {+ it('disables layer controls without a selection or while engine editing is locked', () => {+ const layer = createEmptyPaintLayer('Layer', 'layer');+ expect(isLayerEditingDisabled(null, false)).toBe(true);+ expect(isLayerEditingDisabled(layer, true)).toBe(true);+ expect(isLayerEditingDisabled(layer, false)).toBe(false);+ });+});diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.tsxsimilarity index 71%rename from invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.tsxrename to invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.tsxindex bd61a4ee0d..193c662471 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayersPanelHeader.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.tsx@@ -11,7 +11,7 @@ import type {} from '@workbench/canvas-engine/api';import type { CanvasEngineHandle } from '@workbench/widgets/canvas/useCanvasEngine';-import { Box, createListCollection, Flex, HStack, NumberInput, Stack } from '@chakra-ui/react';+import { Box, createListCollection, Flex, HStack, NumberInput, Stack, Switch, Text } from '@chakra-ui/react';import { useDebouncedDraftValue, useRegisterGenerateDraftFlusher } from '@features/generation/react';import { ColorPicker, Field, Select, Slider } from '@platform/ui';import { getDocumentLayer } from '@workbench/canvas-engine/api';@@ -25,15 +25,22 @@ import {} from '@workbench/widgets/canvas/invoke/canvasStrength';import { useCanvasEngine } from '@workbench/widgets/canvas/useCanvasEngine';import { usePreparedCommit } from '@workbench/widgets/canvas/useStructuralCommit';+import { AdjustmentsPopover } from '@workbench/widgets/layers/AdjustmentsPopover';+import { ControlLayerSettings } from '@workbench/widgets/layers/ControlLayerSettings';+import { DenoisingStrengthWave } from '@workbench/widgets/layers/DenoisingStrengthWave';+import { InpaintMaskSettings } from '@workbench/widgets/layers/InpaintMaskSettings';+import { applyStructuralPreview, CANVAS_BLEND_MODES } from '@workbench/widgets/layers/layerOps';+import { RasterLayerFilterSection } from '@workbench/widgets/layers/RasterLayerFilterSection';+import { RegionalGuidanceSettings } from '@workbench/widgets/layers/RegionalGuidanceSettings';import { getProjectWidgetValues } from '@workbench/widgetState';import { useActiveProjectSelector, useWorkbenchCommands } from '@workbench/WorkbenchContext';import { useCallback, useMemo, useRef } from 'react';import { useTranslation } from 'react-i18next';-import { DenoisingStrengthWave } from './DenoisingStrengthWave';-import { applyStructuralPreview, CANVAS_BLEND_MODES } from './layerOps';+import { GroupSelectedNotice } from './GroupSelectedNotice';+import { PropertiesSection } from './PropertiesSection';-type LayersPanelHeaderEngine = Pick<CanvasEngineHandle, 'document' | 'interaction' | 'layers'>;+type LayerSectionEngine = Pick<CanvasEngineHandle, 'document' | 'exports' | 'interaction' | 'layers' | 'projectId'>;const STRENGTH_DEBOUNCE_MS = 250;const SELECT_POSITIONING = { placement: 'bottom-start', sameWidth: true } as const;@@ -47,45 +54,130 @@ type MaskLayer = Extract<CanvasLayerContract, { type: 'inpaint_mask' | 'regionalconst isMaskLayer = (layer: CanvasLayerContract | null): layer is MaskLayer =>layer !== null && (layer.type === 'inpaint_mask' || layer.type === 'regional_guidance');+// Reference equality is exact: the document index hands back the same node+// object until the layer itself changes, and the section renders the whole+// layer, so a narrower comparison would serve stale views of it.const selectSelectedLayer = (project: {canvas: { document: Pick<CanvasDocumentContractV3, 'stacks' | 'selectedLayerId'> };}): CanvasLayerContract | null => getDocumentLayer(project.canvas.document, project.canvas.document.selectedLayerId);-export const isSameSelection = (left: CanvasLayerContract | null, right: CanvasLayerContract | null): boolean => {- if (left?.id !== right?.id || left?.opacity !== right?.opacity || left?.blendMode !== right?.blendMode) {- return false;- }- const leftFill = isMaskLayer(left) ? left.mask.fill.color : null;- const rightFill = isMaskLayer(right) ? right.mask.fill.color : null;- return leftFill === rightFill;-};-export const isLayerEditingDisabled = (layer: CanvasLayerContract | null, editingLocked: boolean): boolean =>!layer || editingLocked;/**- * The slimmed Photoshop-style region above the layer groups (round 3): exactly two- * rows — the global canvas denoising-strength slider + a per-selection Opacity row- * (percent stepper + a mask-fill colour swatch for mask layers). Blend mode and the- * per-type settings that used to stack here now live in each row's properties- * popover, matching the legacy layout.+ * The Layer and Generation sections of the Properties pane: the selected+ * layer's blend mode, opacity, mask fill and type-specific settings (moved out+ * of the Layers header and its per-row popover), plus the document-wide+ * denoising strength. Every editor commits through the same document seams it+ * always did — this is the one implementation, reparented.*/-export const LayersPanelHeader = () => {+export const LayerSection = ({ disabled }: { disabled: boolean }) => {+ const { t } = useTranslation();const engine = useCanvasEngine();- const layer = useActiveProjectSelector(selectSelectedLayer, isSameSelection);+ const layer = useActiveProjectSelector(selectSelectedLayer);+ const documentRevision = useActiveProjectSelector((project) => project.canvas.documentRevision);const editingLocked = useCanvasDocumentEditingLocked(engine);return (- <Stack gap="0">- <Box borderBottomWidth={1} px="1.5" py="1">+ <>+ <PropertiesSection+ disabled={disabled}+ subtitle={layer?.name ?? t('widgets.transform.noSelection')}+ title={t('widgets.properties.sections.layer')}+ >+ {layer ? (+ <Stack gap="2">+ <Flex align="center" gap="2">+ <BlendModeControl editingLocked={editingLocked} engine={engine} layer={layer} />+ <OpacityRow editingLocked={editingLocked} engine={engine} layer={layer} />+ </Flex>+ <LayerTypeSettings documentRevision={documentRevision} engine={engine} layer={layer} />+ </Stack>+ ) : (+ <GroupSelectedNotice />+ )}+ </PropertiesSection>+ <PropertiesSection disabled={disabled} title={t('widgets.properties.sections.generation')}><DenoisingStrengthControl />- </Box>- <Box borderBottomWidth={1} px="1.5" py="1">- <Flex align="center" gap="2">- <BlendModeControl editingLocked={editingLocked} engine={engine} layer={layer} />- <OpacityRow editingLocked={editingLocked} engine={engine} layer={layer} />- </Flex>- </Box>+ </PropertiesSection>+ </>+ );+};++/** Dispatches to the correct per-type settings block for the layer. */+const LayerTypeSettings = ({+ documentRevision,+ engine,+ layer,+}: {+ documentRevision: number;+ engine: LayerSectionEngine | null;+ layer: CanvasLayerContract;+}) => {+ switch (layer.type) {+ case 'inpaint_mask':+ return <InpaintMaskSettings key={layer.id} engine={engine} layer={layer} />;+ case 'regional_guidance':+ return <RegionalGuidanceSettings key={layer.id} engine={engine} layer={layer} />;+ case 'control':+ return <ControlLayerSettings key={layer.id} engine={engine} layer={layer} onOperationStarted={noop} />;+ case 'raster':+ return (+ <RasterLayerSettings+ key={`${engine?.projectId ?? 'none'}-${layer.id}-${documentRevision}`}+ engine={engine}+ layer={layer}+ />+ );+ }+};++// Starting an operation used to close the popover; the pane's Operation+// section now simply appears above, so there is nothing to do.+const noop = (): void => undefined;++/** Raster-layer properties: transparency lock + non-destructive adjustments. */+const RasterLayerSettings = ({+ engine,+ layer,+}: {+ engine: LayerSectionEngine | null;+ layer: Extract<CanvasLayerContract, { type: 'raster' }>;+}) => {+ const commitPrepared = usePreparedCommit(engine);+ const { t } = useTranslation();+ const isLocked = layer.isTransparencyLocked === true;++ const handleTransparencyLock = useCallback(+ (details: { checked: boolean }) => {+ commitPrepared(t('widgets.layers.adjustments.transparencyLock'), (model) =>+ model.prepare({+ before: { isTransparencyLocked: isLocked, layerType: 'raster' },+ config: { isTransparencyLocked: details.checked, layerType: 'raster' },+ id: layer.id,+ type: 'patch-config',+ })+ );+ },+ [commitPrepared, isLocked, layer.id, t]+ );++ return (+ <Stack gap="2">+ <Switch.Root checked={isLocked} size="sm" onCheckedChange={handleTransparencyLock}>+ <Switch.HiddenInput />+ <Switch.Control>+ <Switch.Thumb />+ </Switch.Control>+ <Switch.Label>+ <Text fontSize="xs">{t('widgets.layers.adjustments.transparencyLock')}</Text>+ </Switch.Label>+ </Switch.Root>+ <Text color="fg.muted" fontSize="2xs" fontWeight="700" textTransform="uppercase">+ {t('widgets.layers.adjustments.title')}+ </Text>+ <AdjustmentsPopover engine={engine} layer={layer} />+ <RasterLayerFilterSection engine={engine} layer={layer} onOperationStarted={noop} /></Stack>);};@@ -101,7 +193,7 @@ const BlendModeControl = ({layer,}: {editingLocked: boolean;- engine: LayersPanelHeaderEngine | null;+ engine: LayerSectionEngine | null;layer: CanvasLayerContract | null;}) => {const commitPrepared = usePreparedCommit(engine);@@ -154,7 +246,7 @@ const OpacityRow = ({layer,}: {editingLocked: boolean;- engine: LayersPanelHeaderEngine | null;+ engine: LayerSectionEngine | null;layer: CanvasLayerContract | null;}) => {const commitPrepared = usePreparedCommit(engine);@@ -276,7 +368,7 @@ const MaskFillSwatch = ({layer,}: {disabled: boolean;- engine: LayersPanelHeaderEngine | null;+ engine: LayerSectionEngine | null;layer: MaskLayer;}) => {const commitPrepared = usePreparedCommit(engine);diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsxindex 8a789bc9e7..194d019549 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsx@@ -13,6 +13,7 @@ import { useLayoutEffect, useRef } from 'react';import { useTranslation } from 'react-i18next';import { GroupSelectedNotice } from './GroupSelectedNotice';+import { LayerSection } from './LayerSection';import { PropertiesRow, PropertiesSection } from './PropertiesSection';const REGION_LABEL_KEYS = {@@ -122,6 +123,7 @@ const ConnectedProperties = ({)}{ToolStatus ? <ToolStatus engine={engine} isExternalInteractionLocked={isSurfaceInteractionLocked} /> : null}</PropertiesSection>+ <LayerSection disabled={isSurfaceInteractionLocked || running !== null} /></Stack>);};