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(webv2): top-align the canvas and workflow tool strips
joshistoastbbd5c7ee0216
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.tsxindex eaf41dc25c..b54e807633 100644--- a/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.tsx+++ b/invokeai/frontend/webv2/src/features/workflow/ui/editor/EditorToolbar.tsx@@ -15,8 +15,9 @@ import {import { useCallback, useId, useMemo } from 'react';/**- * The editor's single tool strip, docked to the left edge: interaction tools- * on top (legacy-toolbar style), viewport actions and the node-opacity slider+ * The editor's single tool strip, docked to the left edge and topped out+ * directly beneath the region's floating chrome islands: interaction tools on+ * top (legacy-toolbar style), viewport actions and the node-opacity slider* below.* - pan: dragging the pane moves the viewport (Shift-drag still box-selects)* - box-select: dragging the pane draws a selection rectangle (middle-mouse pans)@@ -35,6 +36,13 @@ const TOOLS: { icon: typeof HandIcon; id: EditorTool; label: string }[] = [const POPOVER_POSITIONING = { placement: 'right' } as const;const TOOLTIP_POSITIONING = { placement: 'right-start' } as const;+/**+ * Clears the center region's floating chrome, whose inset already includes the+ * gap below the islands. In the left and bottom panels the variable is+ * undefined and the strip falls back to its own top margin.+ */+const EDITOR_TOOLBAR_TOP = 'var(--wb-center-chrome-inset, var(--chakra-spacing-2))';+export const EditorToolbar = ({nodeOpacity,tool,@@ -61,7 +69,7 @@ export const EditorToolbar = ({);return (- <Box left="3" position="absolute" top="50%" transform="translateY(-50%)" zIndex="5">+ <Box left="2" position="absolute" top={EDITOR_TOOLBAR_TOP} zIndex="5"><Toolbar>{TOOLS.map(({ icon, id, label }) => (<EditorToolButtondiff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsxindex 29a10612dc..4e56689d55 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsx@@ -23,6 +23,13 @@ import { useCanvasActiveTool } from './engineStoreHooks';type ToolStripEngine = CanvasCoreStoreCapability & { readonly tools: CanvasToolCapability };+/**+ * Clears the center region's floating chrome, whose inset already includes the+ * gap below the islands. Outside the center the variable is undefined and the+ * strip falls back to its own top margin.+ */+const TOOL_STRIP_TOP = 'var(--wb-center-chrome-inset, var(--chakra-spacing-2))';+interface ToolStripButtonProps {engine: ToolStripEngine;icon: typeof HandIcon;@@ -43,8 +50,9 @@ const ToolStripButton = ({ engine, icon, isInteractionLocked, label, toolId }: T};/**- * The canvas's left-docked, vertical tool strip. Color-picker is intentionally- * absent — it's alt-hold-only for now (see `canvas-engine/input/pointerPipeline.ts`),+ * The canvas's left-docked, vertical tool strip, topped out directly beneath+ * the region's floating chrome islands. Color-picker is intentionally absent —+ * it's alt-hold-only for now (see `canvas-engine/input/pointerPipeline.ts`),* not a sticky tool a user selects directly.*/const ToolStripRoot = ({@@ -57,7 +65,7 @@ const ToolStripRoot = ({const { t } = useTranslation();return (- <Box left="2" position="absolute" top="50%" transform="translateY(-50%)" zIndex="2">+ <Box left="2" position="absolute" top={TOOL_STRIP_TOP} zIndex="2"><Toolbar aria-label={t('widgets.canvas.tools.label')}><ToolStripButtonengine={engine}