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.

refactor(ui): drop the properties pane title

Josh Corbett904e0a69db21
diff --git a/invokeai/frontend/webv2/public/locales/en.json b/invokeai/frontend/webv2/public/locales/en.json
index fe6351a4dd..97e5dba88b 100644
--- a/invokeai/frontend/webv2/public/locales/en.json
+++ b/invokeai/frontend/webv2/public/locales/en.json
@@ -2115,11 +2115,6 @@
"drag": "Draw or adjust the search box."
}
},
- "title": {
- "group": "Group: {{name}}",
- "layer": "Layer: {{name}}",
- "operation": "Operation: {{name}}"
- },
"target": {
"defaults": "Defaults",
"editing": "Editing: {{name}}",
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsx
index 345c3c832b..f99ffcf23f 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerEditorPanes.browser.test.tsx
@@ -505,31 +505,16 @@ describe('Properties pane', () => {
}
});
- it('titles the pane with the running operation, else the selected layer or group', async () => {
- const title = () => page.getByRole('heading', { level: 2 });
- await mount(PropertiesPane);
- await expect.element(title()).toHaveTextContent('No layer selected');
-
- await act(() => root?.unmount());
- host?.remove();
- registry?.releaseEngine('p');
- await mount(PropertiesPane, 'group');
- await expect.element(title()).toHaveTextContent('Group: Folder');
-
- await act(() => root?.unmount());
- host?.remove();
- registry?.releaseEngine('p');
+ it('names a running operation in its own section header', async () => {
+ const operationSection = () => host!.querySelector<HTMLElement>('[role="group"][aria-label="Operation"]');
await mount(PropertiesPane, 'mask');
- await expect.element(title()).toHaveTextContent('Layer: Mask');
+ expect(operationSection()).toBeNull();
await act(() => operations!.start(true));
await settle();
- await expect.element(title()).toHaveTextContent('Operation: Filter');
- // The title replaces the operation section's own header; the group keeps its accessible name.
- const section = host!.querySelector<HTMLElement>('[role="group"][aria-label="Operation"]')!;
- expect(section.textContent).not.toContain('Operation');
+ expect(operationSection()?.textContent).toContain('OperationFilter');
await act(() => operations!.start(false));
await settle();
- await expect.element(title()).toHaveTextContent('Layer: Mask');
+ expect(operationSection()).toBeNull();
});
it('puts a running operation first with Cancel, locks the tool rows in place and hands them focus over', async () => {
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.tsx
index e7fd73251b..92d62958e7 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/LayerSection.tsx
@@ -37,7 +37,7 @@ type LayerSectionEngine = Pick<
// Reference equality is exact: the document index hands back the same node
// object until the node itself changes, and the section renders the whole
// node, so a narrower comparison would serve stale views of it.
-export const selectSelectedNode = (project: {
+const selectSelectedNode = (project: {
canvas: { document: Pick<CanvasDocumentContractV3, 'stacks' | 'selectedLayerId'> };
}): CanvasNodeContract | null => getDocumentNode(project.canvas.document, project.canvas.document.selectedLayerId);
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsx
index 464706d318..4e5d91cdd2 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesPane.tsx
@@ -1,4 +1,4 @@
-import { Flex, Heading, Stack } from '@chakra-ui/react';
+import { Flex, Stack } from '@chakra-ui/react';
import { Scrollable } from '@platform/ui/Scrollable';
import { useCanvasEngine, type CanvasEngineHandle } from '@workbench/canvas-operations/react';
import { isCanvasInteractionLocked } from '@workbench/widgets/canvas/canvasInteractionLock';
@@ -13,7 +13,7 @@ import { useLayoutEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { GroupSelectedNotice } from './GroupSelectedNotice';
-import { LayerSection, selectSelectedNode } from './LayerSection';
+import { LayerSection } from './LayerSection';
import { PropertiesSection } from './PropertiesSection';
const OPERATION_TITLE_KEYS = {
@@ -21,37 +21,6 @@ const OPERATION_TITLE_KEYS = {
'select-object': 'widgets.layers.selectObject.title',
} as const;
-/** Name what the pane is editing: the running operation, else the selected layer or group. */
-const PropertiesTitle = ({ operationName }: { operationName: string | null }) => {
- const { t } = useTranslation();
- const node = useActiveProjectSelector(selectSelectedNode);
- const title =
- operationName !== null
- ? t('widgets.properties.title.operation', { name: operationName })
- : node
- ? t(node.type === 'group' ? 'widgets.properties.title.group' : 'widgets.properties.title.layer', {
- name: node.name,
- })
- : t('widgets.transform.noSelection');
- return (
- <Flex
- bg="bg.panel"
- borderBottomWidth="1px"
- borderColor="border.subtle"
- minW="0"
- position="sticky"
- px="3"
- py="2"
- top="0"
- zIndex="1"
- >
- <Heading as="h2" fontSize="lg" fontWeight="semibold" lineClamp={2} minW="0" wordBreak="break-word">
- {title}
- </Heading>
- </Flex>
- );
-};
-
/** Show active operation before tool forms; use existing engine stores/transactions without mirrored state. */
export const PropertiesPane = () => {
const { t } = useTranslation();
@@ -105,9 +74,11 @@ const ConnectedProperties = ({
return (
<Stack ref={root} gap="0">
- <PropertiesTitle operationName={running ? t(OPERATION_TITLE_KEYS[running.kind]) : null} />
{running ? (
- <PropertiesSection headerHidden title={t('widgets.properties.sections.operation')}>
+ <PropertiesSection
+ subtitle={t(OPERATION_TITLE_KEYS[running.kind])}
+ title={t('widgets.properties.sections.operation')}
+ >
{running.groups.map((group) => (
<PropertyGroup key={group.id} collapsible={group.collapsible} id={group.id} label={t(group.labelKey)}>
<group.body {...regionProps} />
diff --git a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesSection.tsx b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesSection.tsx
index c68c96b6e0..cebcb4f0d1 100644
--- a/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesSection.tsx
+++ b/invokeai/frontend/webv2/src/workbench/widgets/layers/panes/PropertiesSection.tsx
@@ -7,7 +7,6 @@ import { FieldLabel } from '@platform/ui/Field';
export const PropertiesSection = ({
children,
disabled = false,
- headerHidden = false,
ref,
subtitle,
title,
@@ -15,8 +14,6 @@ export const PropertiesSection = ({
children: ReactNode;
/** The surface is busy elsewhere (staging, generation, an operation): the rows stay in place but cannot act. */
disabled?: boolean;
- /** The pane title already names this section; `title` still labels the group for assistive technology. */
- headerHidden?: boolean;
ref?: Ref<HTMLDivElement>;
subtitle?: string;
title: string;
@@ -34,16 +31,14 @@ export const PropertiesSection = ({
py="2.5"
role="group"
>
- {headerHidden ? null : (
- <Flex align="baseline" gap="2" minW="0">
- <FieldLabel>{title}</FieldLabel>
- {subtitle ? (
- <Text color="fg.muted" minW="0" truncate>
- {subtitle}
- </Text>
- ) : null}
- </Flex>
- )}
+ <Flex align="baseline" gap="2" minW="0">
+ <FieldLabel>{title}</FieldLabel>
+ {subtitle ? (
+ <Text color="fg.muted" minW="0" truncate>
+ {subtitle}
+ </Text>
+ ) : null}
+ </Flex>
{children}
</Stack>
);