Skip to content

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.

fix(canvas): clear layer accessibility blockers

joshistoastf9fb07fef639
diff --git a/.superpowers/sdd/mixed-media-gallery-parity/task-11a-report.md b/.superpowers/sdd/mixed-media-gallery-parity/task-11a-report.md
new file mode 100644
index 0000000000..72af346561
--- /dev/null
+++ b/.superpowers/sdd/mixed-media-gallery-parity/task-11a-report.md
@@ -0,0 +1,120 @@
+# Task 11A Report: Canvas layer accessibility release blocker
+
+## Status
+
+Complete. The Canvas representative surface no longer reports Axe
+`nested-interactive` or `target-size` violations. Layer selection, pointer and
+keyboard sorting, visibility controls, thumbnail retry, and locked-state
+semantics remain separated and keyboard accessible.
+
+## Root cause
+
+`LayerListItem` spread all dnd-kit attributes and listeners onto the visual
+`Row`. dnd-kit therefore gave that container `role="button"` and `tabindex="0"`
+while the row still contained visibility, lock, properties, context-menu, and
+thumbnail-retry buttons. Axe correctly reported every rendered row as an
+interactive control containing focusable descendants.
+
+The visibility control used `ToggleDot`'s compact `h="3" w="3"` button itself
+as both the visual dot and hit target. Its measured target was 12×12 pixels,
+with insufficient spacing to satisfy Axe's 24-pixel target-size rule.
+
+The repository's working `useWidgetSortable`/`SortableCenterTab` pattern and
+local dnd-kit implementation showed the required seam: a dedicated activator
+node receives the keyboard listener and sortable semantics, while the sortable
+node remains a noninteractive transform/layout container.
+
+## Implementation
+
+- The transformed outer wrapper remains the sortable node.
+- The visual row is noninteractive and retains the pointer listener, preserving
+ whole-row pointer sorting with the existing six-pixel activation constraint.
+- A full-row native `chakra.button` owns mouse, Enter, and Space selection. It is
+ a sibling—not an ancestor—of every row control.
+- A visible, localized GripVertical button owns dnd-kit attributes, the
+ `setActivatorNodeRef`, and keyboard sorting.
+- The established modified-Enter and portal-origin keyboard guard remains in
+ the keyboard-handle listener.
+- Real controls restore pointer events over the otherwise pointer-transparent
+ visual layer and keep their existing pointer isolation.
+- Thumbnail retry now stops pointerdown before it reaches the row sensor, while
+ preserving native focus and click behavior.
+- The visibility button has a real 24×24 hit area and a centered 12×12
+ pseudo-element dot, preserving the compact visual, semantic tokens, hover
+ state, focus ring, tooltip, accessible label, and disabled behavior.
+- Added the localized layer-selection accessible label.
+
+No `useEffect`, production module, file rename, `@platform/ui` importer,
+migration exception, mock/media behavior, performance baseline, or
+architecture-budget change was introduced.
+
+## TDD evidence
+
+The first focused browser RED reproduced both Axe causes:
+
+```text
+2 tests failed:
+- sortable control contained Toggle visibility
+- visibility target measured 12px, expected >=24px
+```
+
+The expanded pre-production interaction RED produced seven expected failures
+and one pass: independent pointer/Enter/Space selection, row-surface pointer
+sorting, and handle-only keyboard sorting did not yet exist; existing visibility
+isolation already passed.
+
+After the semantic split, all eight cases passed. The independent review then
+identified a real thumbnail-retry gap hidden by the original thumbnail mock.
+The test was changed to render the real error-state `LayerThumbnail` with a
+faithful preview engine. Its retry-drag case failed by reordering
+`first,second` to `second,first`. Adding retry pointerdown isolation made all
+nine focused cases pass while also proving focus, click/request, and selection
+isolation.
+
+## Verification
+
+All commands ran from `invokeai/frontend/webv2` on the final exact tree.
+
+```text
+pnpm lint
+ format: passed
+ OXC: passed
+ tsc: passed
+ architecture: 3 files, 34 tests passed
+
+pnpm test
+ Test Files 376 passed
+ Tests 5005 passed
+
+pnpm test:browser
+ Test Files 70 passed
+ Tests 358 passed
+
+pnpm test:fixtures
+ Tests 10 passed
+
+pnpm test:accessibility
+ production build passed
+ all 9 representative/keyboard/video reports passed
+```
+
+The focused `workbench-canvas-representative` journey passes with every Axe rule
+enabled. The `workbench-video-preview-representative` journey also passes with
+its sole existing generated-media caption exception.
+
+Invariant scans confirmed `git diff --check` is clean and the diff contains no
+new production source file, `useEffect`, gallery/preview/media/mock change,
+performance-baseline change, migration exception, or new platform barrel
+import.
+
+## Independent review
+
+The first read-only review reported one Important finding and one Minor
+finding:
+
+- the real thumbnail retry button did not stop pointerdown from reaching
+ row-level DnD;
+- the component comment still described the old no-visible-handle design.
+
+Both were corrected. The scoped re-review approved the fixes with no remaining
+Critical, Important, or Minor findings.
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index 7fb44a32b2..ff94c34120 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -1691,6 +1691,7 @@
"reorder": "Reorder layer",
"runWorkflow": "Run workflow",
"saveLayerToAssets": "Save layer to assets",
+ "select": "Select {{name}}",
"selectObject": "Select object",
"show": "Show layer",
"toggleAutoNegative": "Toggle auto-negative",
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerListItem.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerListItem.browser.test.tsx
new file mode 100644
index 0000000000..a62da98a83
--- /dev/null
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerListItem.browser.test.tsx
@@ -0,0 +1,293 @@
+/* oxlint-disable react-perf/jsx-no-new-function-as-prop */
+import type { CanvasProjectMutation } from '@workbench/canvasProjectMutations';
+
+import { ChakraProvider } from '@chakra-ui/react';
+import {
+ closestCenter,
+ DndContext,
+ KeyboardSensor,
+ PointerSensor,
+ useSensor,
+ useSensors,
+ type DragEndEvent,
+} from '@dnd-kit/core';
+import { arrayMove, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
+import { system } from '@theme/system';
+import { createInstance } from 'i18next';
+import { act, useCallback, useMemo, useState } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { I18nextProvider, initReactI18next } from 'react-i18next';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import { userEvent } from 'vitest/browser';
+
+import { LAYER_KEYBOARD_SENSOR_OPTIONS } from './layerDndConfig';
+import { LayerListItem, type LayerListItemEngine } from './LayerListItem';
+import { createEmptyPaintLayer } from './layerOps';
+
+vi.mock('./ControlLayerWarningIcon', () => ({
+ ControlLayerWarningIcon: () => null,
+}));
+
+vi.mock('@workbench/widgets/canvas/engineStoreHooks', () => ({
+ useLayerThumbnailStatus: () => 'error',
+ useLayerThumbnailVersion: () => 0,
+}));
+
+vi.mock('./LayerPropertiesPopover', () => ({
+ LayerPropertiesPopover: () => <button aria-label="Layer properties" type="button" />,
+}));
+
+vi.mock('./LayerContextMenu', () => ({
+ CanvasLayerContextMenu: () => null,
+ LayerContextMenu: () => <button aria-label="Layer menu" type="button" />,
+}));
+
+const i18n = createInstance();
+void i18n.use(initReactI18next).init({
+ fallbackLng: 'en',
+ initAsync: false,
+ lng: 'en',
+ resources: {
+ en: {
+ translation: {
+ widgets: {
+ layers: {
+ actions: {
+ reorder: 'Reorder layer',
+ select: 'Select {{name}}',
+ toggleLock: 'Toggle lock',
+ toggleVisibility: 'Toggle visibility',
+ },
+ types: { paint: 'Paint' },
+ },
+ },
+ },
+ },
+ },
+});
+
+const INITIAL_LAYERS = [createEmptyPaintLayer('First layer', 'first'), createEmptyPaintLayer('Second layer', 'second')];
+const requestLayerThumbnail = vi.fn();
+
+const Harness = () => {
+ const [layers, setLayers] = useState(INITIAL_LAYERS);
+ const [selectedLayerId, setSelectedLayerId] = useState<string | null>(null);
+ const sensors = useSensors(
+ useSensor(PointerSensor, { activationConstraint: { distance: 6 } }),
+ useSensor(KeyboardSensor, LAYER_KEYBOARD_SENSOR_OPTIONS)
+ );
+ const layerIds = useMemo(() => layers.map((layer) => layer.id), [layers]);
+ const dispatch = useCallback((mutation: CanvasProjectMutation) => {
+ if (mutation.type === 'setCanvasSelectedLayer') {
+ setSelectedLayerId(mutation.id);
+ } else if (mutation.type === 'updateCanvasLayer' && mutation.patch.isEnabled !== undefined) {
+ setLayers((current) =>
+ current.map((layer) =>
+ layer.id === mutation.id ? { ...layer, isEnabled: mutation.patch.isEnabled ?? layer.isEnabled } : layer
+ )
+ );
+ }
+ }, []);
+ const engine = useMemo(
+ () =>
+ ({
+ layers: {
+ commitStructural: (_label: string, mutation: CanvasProjectMutation) => dispatch(mutation),
+ },
+ previews: {
+ drawLayerThumbnail: () => false,
+ requestLayerThumbnail,
+ },
+ projectId: 'test-project',
+ }) as unknown as LayerListItemEngine,
+ [dispatch]
+ );
+ const handleDragEnd = useCallback((event: DragEndEvent) => {
+ if (!event.over || event.active.id === event.over.id) {
+ return;
+ }
+ setLayers((current) => {
+ const from = current.findIndex((layer) => layer.id === event.active.id);
+ const to = current.findIndex((layer) => layer.id === event.over?.id);
+ return from === -1 || to === -1 ? current : arrayMove(current, from, to);
+ });
+ }, []);
+
+ return (
+ <DndContext collisionDetection={closestCenter} sensors={sensors} onDragEnd={handleDragEnd}>
+ <SortableContext items={layerIds} strategy={verticalListSortingStrategy}>
+ {layers.map((layer, index) => (
+ <LayerListItem
+ key={layer.id}
+ dispatch={dispatch}
+ editingLocked={false}
+ engine={engine}
+ index={index}
+ isSelected={selectedLayerId === layer.id}
+ layer={layer}
+ layers={layers}
+ />
+ ))}
+ </SortableContext>
+ <output data-testid="selected-layer">{selectedLayerId ?? 'none'}</output>
+ <output data-testid="layer-order">{layers.map((layer) => layer.id).join(',')}</output>
+ </DndContext>
+ );
+};
+
+let host: HTMLDivElement | null = null;
+let root: Root | null = null;
+(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
+
+const renderHarness = async () => {
+ host = document.createElement('div');
+ host.style.width = '480px';
+ document.body.append(host);
+ root = createRoot(host);
+
+ await act(() => {
+ root?.render(
+ <I18nextProvider i18n={i18n}>
+ <ChakraProvider value={system}>
+ <Harness />
+ </ChakraProvider>
+ </I18nextProvider>
+ );
+ });
+};
+
+const pointer = (type: string, target: EventTarget, clientX: number, clientY: number): void => {
+ target.dispatchEvent(
+ new PointerEvent(type, { bubbles: true, button: 0, clientX, clientY, isPrimary: true, pointerId: 1 })
+ );
+};
+
+const selectionButton = (name: string): HTMLButtonElement =>
+ host!.querySelector<HTMLButtonElement>(`button[aria-label="Select ${name}"]`)!;
+
+const reorderButton = (name: string): HTMLButtonElement =>
+ host!.querySelector<HTMLButtonElement>(`button[aria-label="Reorder layer: ${name}"]`)!;
+
+const selectedLayer = (): string => host!.querySelector<HTMLOutputElement>('[data-testid="selected-layer"]')!.value;
+const layerOrder = (): string => host!.querySelector<HTMLOutputElement>('[data-testid="layer-order"]')!.value;
+
+afterEach(async () => {
+ await act(() => root?.unmount());
+ host?.remove();
+ host = null;
+ root = null;
+ vi.clearAllMocks();
+});
+
+describe('LayerListItem accessibility', () => {
+ it('keeps the sortable control free of interactive descendants', async () => {
+ await renderHarness();
+
+ const sortableControl = host!.querySelector<HTMLElement>('[aria-roledescription="sortable"]');
+ expect(sortableControl).not.toBeNull();
+ expect(
+ sortableControl!.querySelector('button, input, select, textarea, a[href], [tabindex]:not([tabindex="-1"])')
+ ).toBeNull();
+ });
+
+ it('gives the compact visibility control a 24px touch target', async () => {
+ await renderHarness();
+
+ const visibility = host!.querySelector<HTMLButtonElement>('button[aria-label="Toggle visibility"]');
+ expect(visibility).not.toBeNull();
+ const rect = visibility!.getBoundingClientRect();
+ expect(rect.width).toBeGreaterThanOrEqual(24);
+ expect(rect.height).toBeGreaterThanOrEqual(24);
+ });
+
+ it('selects a layer with a pointer without requiring the drag handle', async () => {
+ await renderHarness();
+
+ await act(() => userEvent.click(selectionButton('First layer')));
+
+ expect(selectedLayer()).toBe('first');
+ });
+
+ it.each([
+ ['Enter', '{Enter}'],
+ ['Space', ' '],
+ ])('selects a layer with %s on the selection control', async (_label, key) => {
+ await renderHarness();
+ selectionButton('Second layer').focus();
+
+ await act(() => userEvent.keyboard(key));
+
+ expect(selectedLayer()).toBe('second');
+ expect(layerOrder()).toBe('first,second');
+ });
+
+ it('keeps visibility toggling isolated from row selection', async () => {
+ await renderHarness();
+ const visibility = host!.querySelectorAll<HTMLButtonElement>('button[aria-label="Toggle visibility"]')[0]!;
+
+ await act(() => userEvent.click(visibility));
+
+ expect(visibility).toHaveAttribute('aria-pressed', 'false');
+ expect(selectedLayer()).toBe('none');
+ });
+
+ it('keeps thumbnail retry focus, click, and pointer movement isolated from row selection and sorting', async () => {
+ await renderHarness();
+ const retry = host!.querySelector<HTMLButtonElement>('button[aria-label="Retry thumbnail for First layer"]')!;
+ const second = selectionButton('Second layer');
+ retry.focus();
+ expect(document.activeElement).toBe(retry);
+
+ await act(() => userEvent.click(retry));
+ expect(requestLayerThumbnail).toHaveBeenCalledWith('first');
+ expect(selectedLayer()).toBe('none');
+
+ const retryRect = retry.getBoundingClientRect();
+ const secondRect = second.getBoundingClientRect();
+ const startX = retryRect.left + retryRect.width / 2;
+ const startY = retryRect.top + retryRect.height / 2;
+ const endX = secondRect.left + secondRect.width / 2;
+ const endY = secondRect.top + secondRect.height / 2;
+
+ await act(() => pointer('pointerdown', retry, startX, startY));
+ await act(() => pointer('pointermove', retry.ownerDocument, startX + 8, startY));
+ await act(() => pointer('pointermove', retry.ownerDocument, endX, endY));
+ await act(() => pointer('pointerup', retry.ownerDocument, endX, endY));
+
+ expect(layerOrder()).toBe('first,second');
+ expect(selectedLayer()).toBe('none');
+ });
+
+ it('preserves whole-row pointer sorting outside the dedicated handle', async () => {
+ await renderHarness();
+ const first = selectionButton('First layer');
+ const second = selectionButton('Second layer');
+ const firstRect = first.getBoundingClientRect();
+ const secondRect = second.getBoundingClientRect();
+ const startX = firstRect.left + firstRect.width / 2;
+ const startY = firstRect.top + firstRect.height / 2;
+ const endX = secondRect.left + secondRect.width / 2;
+ const endY = secondRect.top + secondRect.height / 2;
+
+ await act(() => pointer('pointerdown', first, startX, startY));
+ await act(() => pointer('pointermove', first.ownerDocument, startX + 8, startY));
+ await act(() => pointer('pointermove', first.ownerDocument, endX, endY));
+ await act(() => pointer('pointerup', first.ownerDocument, endX, endY));
+
+ expect(layerOrder()).toBe('second,first');
+ });
+
+ it('sorts with Enter from the dedicated keyboard drag handle', async () => {
+ await renderHarness();
+ const handle = reorderButton('First layer');
+ handle.focus();
+
+ await act(() => userEvent.keyboard('{Enter}'));
+ expect(handle).toHaveAttribute('aria-pressed', 'true');
+ await act(() => userEvent.keyboard('{ArrowDown}'));
+ await act(() => userEvent.keyboard('{Enter}'));
+
+ expect(layerOrder()).toBe('second,first');
+ expect(selectedLayer()).toBe('none');
+ });
+});
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerListItem.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerListItem.tsx
index fa58deed96..a1f62ce8c1 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerListItem.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerListItem.tsx
@@ -3,12 +3,12 @@ import type { CanvasProjectMutation } from '@workbench/canvasProjectMutations';
import type { CanvasEngineHandle } from '@workbench/widgets/canvas/useCanvasEngine';
import type { Dispatch, KeyboardEvent, MouseEvent } from 'react';
-import { Badge, Box, HStack, Input, Stack, Text } from '@chakra-ui/react';
+import { Badge, Box, chakra, HStack, Input, Stack, Text } from '@chakra-ui/react';
import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import { IconButton, Row, ToggleDot } from '@platform/ui';
import { isHideableLayer, isLayerHidden } from '@workbench/canvas-engine/api';
-import { EyeIcon, EyeOffIcon, LockIcon, LockOpenIcon } from 'lucide-react';
+import { EyeIcon, EyeOffIcon, GripVerticalIcon, LockIcon, LockOpenIcon } from 'lucide-react';
import { useCallback, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -25,6 +25,49 @@ import { applyStructural } from './layerOps';
import { LayerPropertiesPopover, type LayerPropertiesEngine } from './LayerPropertiesPopover';
import { LayerThumbnail } from './LayerThumbnail';
+const ROW_INTERACTIVE_DESCENDANTS = {
+ '& button, & input': {
+ pointerEvents: 'auto',
+ },
+};
+const ROW_SELECTION_FOCUS = {
+ outline: '2px solid',
+ outlineColor: 'accent.solid',
+ outlineOffset: '-2px',
+};
+const VISIBILITY_DOT_BASE = {
+ borderRadius: 'full',
+ borderWidth: '1px',
+ content: '""',
+ h: '3',
+ inset: '50% auto auto 50%',
+ position: 'absolute',
+ transform: 'translate(-50%, -50%)',
+ transition: 'background var(--wb-motion-duration-fast), border-color var(--wb-motion-duration-fast)',
+ w: '3',
+};
+const VISIBILITY_DOT_CHECKED = {
+ ...VISIBILITY_DOT_BASE,
+ bg: 'accent.solid',
+ borderColor: 'accent.solid',
+};
+const VISIBILITY_DOT_UNCHECKED = {
+ ...VISIBILITY_DOT_BASE,
+ bg: 'transparent',
+ borderColor: 'border.emphasized',
+};
+const VISIBILITY_DOT_CHECKED_HOVER = {
+ _before: {
+ bg: 'accent.emphasized',
+ borderColor: 'accent.emphasized',
+ },
+};
+const VISIBILITY_DOT_UNCHECKED_HOVER = {
+ _before: {
+ borderColor: 'fg.muted',
+ },
+};
+
export type LayerListItemEngine = LayerContextMenuEngine & LayerPropertiesEngine & Pick<CanvasEngineHandle, 'previews'>;
/** i18n key for a layer's short type/source badge. */
@@ -56,10 +99,10 @@ export const getLayerListItemInteractionState = (editingLocked: boolean) => ({
/**
* One layer row: thumbnail, name (double-click to rename), type badge,
* visibility + lock toggles, a properties popover (blend mode + the layer's
- * type-specific settings), and an overflow/context menu. The whole row is the
- * drag target — no visible handle — with a pointer distance activation
- * constraint so clicks, double-click rename, and the row buttons still work;
- * the selected layer's opacity (and mask fill swatch) lives in the panel header.
+ * type-specific settings), and an overflow/context menu. The whole row remains
+ * the pointer drag target, while a dedicated reorder button owns keyboard
+ * sorting. The pointer distance constraint keeps clicks, double-click rename,
+ * and row buttons working; selected-layer opacity lives in the panel header.
*/
export const LayerListItem = ({
dispatch,
@@ -72,7 +115,7 @@ export const LayerListItem = ({
}: LayerListItemProps) => {
const { t } = useTranslation();
const interaction = getLayerListItemInteractionState(editingLocked);
- const { attributes, isDragging, listeners, setNodeRef, transform, transition } = useSortable({
+ const { attributes, isDragging, listeners, setActivatorNodeRef, setNodeRef, transform, transition } = useSortable({
disabled: interaction.sortableDisabled,
id: layer.id,
});
@@ -211,34 +254,59 @@ export const LayerListItem = ({
*/
const sortableListeners = useMemo(() => {
if (interaction.sortableDisabled || !listeners) {
- return {};
+ return { handle: {}, row: {} };
}
const { onKeyDown, ...rest } = listeners;
return {
- ...rest,
- onKeyDown: (event: KeyboardEvent<HTMLElement>) => {
- if (!shouldStartLayerKeyboardDrag(event, rowRef.current)) {
- return;
- }
- onKeyDown?.(event);
+ handle: {
+ onKeyDown: (event: KeyboardEvent<HTMLElement>) => {
+ if (!shouldStartLayerKeyboardDrag(event, rowRef.current)) {
+ return;
+ }
+ onKeyDown?.(event);
+ },
},
+ row: rest,
};
}, [interaction.sortableDisabled, listeners]);
return (
<Box ref={setRowRef} style={dndStyle}>
<Row
- {...(interaction.sortableDisabled ? {} : attributes)}
- {...sortableListeners}
+ {...sortableListeners.row}
active={isSelected ? 'muted' : undefined}
cursor={isDragging ? 'grabbing' : 'default'}
display="flex"
gap="1.5"
p="1.5"
- onClick={handleSelect}
+ position="relative"
onContextMenu={handleContextMenu}
>
- <HStack gap="1.5" w="full">
+ <chakra.button
+ aria-label={t('widgets.layers.actions.select', { name: layer.name })}
+ aria-pressed={isSelected}
+ inset="0"
+ position="absolute"
+ rounded="sm"
+ type="button"
+ _focusVisible={ROW_SELECTION_FOCUS}
+ onClick={handleSelect}
+ onDoubleClick={interaction.canRename ? startEditing : undefined}
+ />
+ <HStack css={ROW_INTERACTIVE_DESCENDANTS} gap="1.5" pointerEvents="none" position="relative" w="full">
+ <IconButton
+ ref={setActivatorNodeRef}
+ {...(interaction.sortableDisabled ? {} : attributes)}
+ {...sortableListeners.handle}
+ aria-label={`${t('widgets.layers.actions.reorder')}: ${layer.name}`}
+ color="fg.subtle"
+ cursor={isDragging ? 'grabbing' : 'grab'}
+ disabled={interaction.sortableDisabled}
+ size="2xs"
+ variant="ghost"
+ >
+ <GripVerticalIcon aria-hidden="true" />
+ </IconButton>
<LayerThumbnail engine={engine} layer={layer} />
<Stack flex="1" gap="0.5" minW="0">
{isEditing ? (
@@ -254,13 +322,7 @@ export const LayerListItem = ({
onPointerDown={stopPropagation}
/>
) : (
- <Text
- aria-disabled={!interaction.canRename}
- fontSize="2xs"
- fontWeight="700"
- truncate
- onDoubleClick={interaction.canRename ? startEditing : undefined}
- >
+ <Text aria-disabled={!interaction.canRename} fontSize="2xs" fontWeight="700" truncate>
{layer.name}
</Text>
)}
@@ -287,10 +349,19 @@ export const LayerListItem = ({
) : null}
<Box flexShrink="0" onClick={stopPropagation} onPointerDown={stopPropagation}>
<ToggleDot
+ _before={layer.isEnabled ? VISIBILITY_DOT_CHECKED : VISIBILITY_DOT_UNCHECKED}
+ _focusVisible={ROW_SELECTION_FOCUS}
+ _hover={layer.isEnabled ? VISIBILITY_DOT_CHECKED_HOVER : VISIBILITY_DOT_UNCHECKED_HOVER}
+ bg="transparent"
+ borderWidth="0"
checked={layer.isEnabled}
cursor={interaction.canToggleVisibility ? 'pointer' : 'not-allowed'}
disabled={!interaction.canToggleVisibility}
+ h="6"
label={t('widgets.layers.actions.toggleVisibility')}
+ position="relative"
+ transition="none"
+ w="6"
onCheckedChange={handleToggleVisible}
/>
</Box>
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsx
index 9a3e74fd43..df7ed17413 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/LayerThumbnail.tsx
@@ -118,6 +118,7 @@ const LayerThumbnailContent = ({
minH="0"
minW="0"
onClick={retry}
+ onPointerDown={stopPropagation}
position="absolute"
size="xs"
variant="surface"
@@ -149,3 +150,5 @@ export const LayerThumbnail = ({
/>
);
};
+
+const stopPropagation = (event: { stopPropagation: () => void }): void => event.stopPropagation();