diff --git a/invokeai/frontend/web/src/app/components/App.tsx b/invokeai/frontend/web/src/app/components/App.tsx index f9e53f2ddd..f281b92bb7 100644 --- a/invokeai/frontend/web/src/app/components/App.tsx +++ b/invokeai/frontend/web/src/app/components/App.tsx @@ -75,23 +75,9 @@ const App = ({ config = DEFAULT_CONFIG, selectedImage }: Props) => { > - + {headerComponent || } - + diff --git a/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx b/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx index 9a8a177f58..b2fd529848 100644 --- a/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx +++ b/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx @@ -38,41 +38,35 @@ const AppErrorBoundaryFallback = ({ error, resetErrorBoundary }: Props) => { return ( {t('common.somethingWentWrong')} {error.name}: {error.message} - + } onClick={resetErrorBoundary} diff --git a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx index 65c4a0e3bf..8fd4d66935 100644 --- a/invokeai/frontend/web/src/common/components/IAIDndImage.tsx +++ b/invokeai/frontend/web/src/common/components/IAIDndImage.tsx @@ -1,4 +1,8 @@ -import type { ChakraProps, FlexProps } from '@chakra-ui/react'; +import type { + ChakraProps, + FlexProps, + SystemStyleObject, +} from '@chakra-ui/react'; import { Flex, Icon, Image } from '@chakra-ui/react'; import { IAILoadingImageFallback, @@ -17,7 +21,7 @@ import type { ReactNode, SyntheticEvent, } from 'react'; -import { memo, useCallback, useState } from 'react'; +import { memo, useCallback, useMemo, useState } from 'react'; import { FaImage, FaUpload } from 'react-icons/fa'; import type { ImageDTO, PostUploadAction } from 'services/api/types'; @@ -25,14 +29,7 @@ import IAIDraggable from './IAIDraggable'; import IAIDroppable from './IAIDroppable'; import SelectionOverlay from './SelectionOverlay'; -const defaultUploadElement = ( - -); +const defaultUploadElement = ; const defaultNoContentFallback = ; @@ -115,16 +112,29 @@ const IAIDndImage = (props: IAIDndImageProps) => { isDisabled: isUploadDisabled, }); - const uploadButtonStyles = isUploadDisabled - ? {} - : { + const uploadButtonStyles = useMemo(() => { + const styles: SystemStyleObject = { + minH: minSize, + w: 'full', + h: 'full', + alignItems: 'center', + justifyContent: 'center', + borderRadius: 'base', + transitionProperty: 'common', + transitionDuration: '0.1s', + color: 'base.500', + }; + if (!isUploadDisabled) { + Object.assign(styles, { cursor: 'pointer', bg: 'base.700', _hover: { bg: 'base.650', color: 'base.300', }, - }; + }); + } + }, [isUploadDisabled, minSize]); return ( @@ -133,27 +143,23 @@ const IAIDndImage = (props: IAIDndImageProps) => { ref={ref} onMouseOver={handleMouseOver} onMouseOut={handleMouseOut} - sx={{ - width: 'full', - height: 'full', - alignItems: 'center', - justifyContent: 'center', - position: 'relative', - minW: minSize ? minSize : undefined, - minH: minSize ? minSize : undefined, - userSelect: 'none', - cursor: isDragDisabled || !imageDTO ? 'default' : 'pointer', - }} + width="full" + height="full" + alignItems="center" + justifyContent="center" + position="relative" + minW={minSize ? minSize : undefined} + minH={minSize ? minSize : undefined} + userSelect="none" + cursor={isDragDisabled || !imageDTO ? 'default' : 'pointer'} > {imageDTO && ( { } onError={onError} draggable={false} - sx={{ - w: imageDTO.width, - objectFit: 'contain', - maxW: 'full', - maxH: 'full', - borderRadius: 'base', - ...imageSx, - }} + w={imageDTO.width} + objectFit="contain" + maxW="full" + maxH="full" + borderRadius="base" + sx={imageSx} data-testid={dataTestId} /> {withMetadataOverlay && ( @@ -189,21 +193,7 @@ const IAIDndImage = (props: IAIDndImageProps) => { )} {!imageDTO && !isUploadDisabled && ( <> - + {uploadElement} diff --git a/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx b/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx index 9975917203..ce0fecb20c 100644 --- a/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx +++ b/invokeai/frontend/web/src/common/components/IAIDndImageIcon.tsx @@ -1,6 +1,6 @@ import type { SystemStyleObject } from '@chakra-ui/react'; import type { MouseEvent, ReactElement } from 'react'; -import { memo } from 'react'; +import { memo, useMemo } from 'react'; import { InvIconButton } from './InvIconButton/InvIconButton'; @@ -14,6 +14,25 @@ type Props = { const IAIDndImageIcon = (props: Props) => { const { onClick, tooltip, icon, styleOverrides } = props; + const sx = useMemo( + () => ({ + position: 'absolute', + top: 1, + insetInlineEnd: 1, + p: 0, + minW: 0, + svg: { + transitionProperty: 'common', + transitionDuration: 'normal', + fill: 'base.100', + _hover: { fill: 'base.50' }, + filter: 'drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))', + }, + ...styleOverrides, + }), + [styleOverrides] + ); + return ( { icon={icon} size="sm" variant="link" - sx={{ - position: 'absolute', - top: 1, - insetInlineEnd: 1, - p: 0, - minW: 0, - svg: { - transitionProperty: 'common', - transitionDuration: 'normal', - fill: 'base.100', - _hover: { fill: 'base.50' }, - filter: 'drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))', - }, - ...styleOverrides, - }} + sx={sx} data-testid={tooltip} /> ); diff --git a/invokeai/frontend/web/src/common/components/IAIDropOverlay.tsx b/invokeai/frontend/web/src/common/components/IAIDropOverlay.tsx index 83f4e8858c..8fa305323b 100644 --- a/invokeai/frontend/web/src/common/components/IAIDropOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/IAIDropOverlay.tsx @@ -27,59 +27,45 @@ export const IAIDropOverlay = (props: Props) => { transition: { duration: 0.1 }, }} > - + {label} diff --git a/invokeai/frontend/web/src/common/components/IAIFillSkeleton.tsx b/invokeai/frontend/web/src/common/components/IAIFillSkeleton.tsx index 8081714432..52d57398fe 100644 --- a/invokeai/frontend/web/src/common/components/IAIFillSkeleton.tsx +++ b/invokeai/frontend/web/src/common/components/IAIFillSkeleton.tsx @@ -1,28 +1,27 @@ +import type { SystemStyleObject } from '@chakra-ui/react'; import { Box, Skeleton } from '@chakra-ui/react'; import { memo } from 'react'; +const skeletonStyles: SystemStyleObject = { + position: 'relative', + height: 'full', + width: 'full', + '::before': { + content: "''", + display: 'block', + pt: '100%', + }, +}; + const IAIFillSkeleton = () => { return ( - + ); diff --git a/invokeai/frontend/web/src/common/components/IAIImageFallback.tsx b/invokeai/frontend/web/src/common/components/IAIImageFallback.tsx index 83f3d79f4a..1c7775eb57 100644 --- a/invokeai/frontend/web/src/common/components/IAIImageFallback.tsx +++ b/invokeai/frontend/web/src/common/components/IAIImageFallback.tsx @@ -1,5 +1,6 @@ import type { As, FlexProps, StyleProps } from '@chakra-ui/react'; import { Flex, Icon, Skeleton, Spinner } from '@chakra-ui/react'; +import { useMemo } from 'react'; import { FaImage } from 'react-icons/fa'; import type { ImageDTO } from 'services/api/types'; @@ -11,27 +12,23 @@ export const IAILoadingImageFallback = (props: Props) => { if (props.image) { return ( ); } return ( @@ -47,23 +44,25 @@ type IAINoImageFallbackProps = FlexProps & { export const IAINoContentFallback = (props: IAINoImageFallbackProps) => { const { icon = FaImage, boxSize = 16, sx, ...rest } = props; + const styles = useMemo( + () => ({ + w: 'full', + h: 'full', + alignItems: 'center', + justifyContent: 'center', + borderRadius: 'base', + flexDir: 'column', + gap: 2, + userSelect: 'none', + opacity: 0.7, + color: 'base.500', + ...sx, + }), + [sx] + ); + return ( - + {icon && } {props.label && {props.label}} @@ -78,24 +77,25 @@ export const IAINoContentFallbackWithSpinner = ( props: IAINoImageFallbackWithSpinnerProps ) => { const { sx, ...rest } = props; + const styles = useMemo( + () => ({ + w: 'full', + h: 'full', + alignItems: 'center', + justifyContent: 'center', + borderRadius: 'base', + flexDir: 'column', + gap: 2, + userSelect: 'none', + opacity: 0.7, + color: 'base.500', + ...sx, + }), + [sx] + ); return ( - + {props.label && {props.label}} diff --git a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx index ed9ff41eb2..d57838678c 100644 --- a/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx +++ b/invokeai/frontend/web/src/common/components/IAIInformationalPopover/IAIInformationalPopover.tsx @@ -103,13 +103,7 @@ const PopoverContent = ({ data, feature }: PopoverContentProps) => { - + {heading && ( <> {heading} @@ -119,12 +113,10 @@ const PopoverContent = ({ data, feature }: PopoverContentProps) => { {data?.image && ( <> Optional Image diff --git a/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx b/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx index 59291f5e1f..08226d6d48 100644 --- a/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/ImageMetadataOverlay.tsx @@ -9,16 +9,14 @@ type ImageMetadataOverlayProps = { const ImageMetadataOverlay = ({ imageDTO }: ImageMetadataOverlayProps) => { return ( {imageDTO.width} × {imageDTO.height} diff --git a/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx b/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx index 630b733013..5af456a5a2 100644 --- a/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/ImageUploadOverlay.tsx @@ -23,57 +23,49 @@ const ImageUploadOverlay = (props: ImageUploadOverlayProps) => { return ( {isDragAccept ? ( {t('gallery.dropToUpload')} diff --git a/invokeai/frontend/web/src/common/components/InvEditable/theme.ts b/invokeai/frontend/web/src/common/components/InvEditable/theme.ts index dc46be44ff..15ace5ccbf 100644 --- a/invokeai/frontend/web/src/common/components/InvEditable/theme.ts +++ b/invokeai/frontend/web/src/common/components/InvEditable/theme.ts @@ -20,7 +20,7 @@ const baseStyleInput = defineStyle(() => ({ transitionProperty: 'common', transitionDuration: 'normal', width: 'full', - _focusVisible: { boxShadow: 'outline' }, + _focusVisible: { boxShadow: 'none' }, _placeholder: { opacity: 0.6 }, '::selection': { color: 'blue.50', diff --git a/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx b/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx index bb3e9a6db5..58f17a2255 100644 --- a/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/NodeSelectionOverlay.tsx @@ -21,19 +21,17 @@ const SelectionOverlay = ({ isSelected, isHovered }: Props) => { return ( ); }; diff --git a/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx b/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx index 1b18634d0d..12e83c43c5 100644 --- a/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx +++ b/invokeai/frontend/web/src/common/components/OverlayScrollbars/ScrollableContent.tsx @@ -1,46 +1,24 @@ import type { StyleProps } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react'; +import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'; -import type { PropsWithChildren } from 'react'; +import type { CSSProperties, PropsWithChildren } from 'react'; import { memo } from 'react'; type Props = PropsWithChildren & { maxHeight?: StyleProps['maxHeight']; }; +const styles: CSSProperties = { height: '100%', width: '100%' }; + const ScrollableContent = ({ children, maxHeight }: Props) => { return ( - - + + {children} diff --git a/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx b/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx index 30aabdd57c..2143b1615c 100644 --- a/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx +++ b/invokeai/frontend/web/src/common/components/SelectionOverlay.tsx @@ -1,33 +1,37 @@ import { Box } from '@chakra-ui/react'; -import { memo } from 'react'; +import { memo, useMemo } from 'react'; type Props = { isSelected: boolean; isHovered: boolean; }; const SelectionOverlay = ({ isSelected, isHovered }: Props) => { + const shadow = useMemo(() => { + if (isSelected && isHovered) { + return 'hoverSelected'; + } + if (isSelected && !isHovered) { + return 'selected'; + } + if (!isSelected && isHovered) { + return 'hoverUnselected'; + } + return undefined; + }, [isHovered, isSelected]); return ( ); }; diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx index f62f0836c2..1f6bf151a6 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvas.tsx @@ -18,7 +18,7 @@ import { import type Konva from 'konva'; import type { KonvaEventObject } from 'konva/lib/Node'; import type { Vector2d } from 'konva/lib/types'; -import { memo, useCallback, useEffect, useRef } from 'react'; +import { memo, useCallback, useEffect, useMemo, useRef } from 'react'; import { Layer, Stage } from 'react-konva'; import IAICanvasBoundingBoxOverlay from './IAICanvasBoundingBoxOverlay'; @@ -163,35 +163,32 @@ const IAICanvas = () => { }; }, [dispatch]); + const stageStyles = useMemo( + () => ({ + outline: 'none', + overflow: 'hidden', + cursor: stageCursor ? stageCursor : undefined, + canvas: { + outline: 'none', + }, + }), + [stageCursor] + ); + return ( - + { return ( - {`${t('unifiedCanvas.activeLayer')}: ${t( + {`${t('unifiedCanvas.activeLayer')}: ${t( `unifiedCanvas.${layer}` )}`} {`${t('unifiedCanvas.canvasScale')}: ${canvasScaleString}%`} {shouldPreserveMaskedArea && ( - + {t('unifiedCanvas.preserveMaskedArea')}: {t('common.on')} )} {shouldShowBoundingBox && ( - {`${t( + {`${t( 'unifiedCanvas.boundingBox' )}: ${boundingBoxDimensionsString}`} )} {shouldShowScaledBoundingBox && ( - {`${t( + {`${t( 'unifiedCanvas.scaledBoundingBox' )}: ${scaledBoundingBoxDimensionsString}`} )} diff --git a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx index d96b434922..62f302ee32 100644 --- a/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx +++ b/invokeai/frontend/web/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx @@ -150,7 +150,7 @@ const IAICanvasMaskOptions = () => { onChange={handleChangePreserveMaskedArea} /> - + { /> - + { acceptButtonText={t('boards.move')} cancelButtonText={t('boards.cancel')} > - + {t('boards.movingImagesToBoard', { count: imagesToChange.length, diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx index f61ff6f567..cc5379b50d 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterConfig.tsx @@ -65,18 +65,14 @@ const ControlAdapterConfig = (props: { id: string; number: number }) => { return ( - + { /> - + @@ -128,57 +122,46 @@ const ControlAdapterConfig = (props: { id: string; number: number }) => { } onClick={toggleIsExpanded} variant="ghost" - sx={{ - _hover: { - bg: 'none', - }, - }} icon={ } /> - - + + {!isExpanded && ( )} - + diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterImagePreview.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterImagePreview.tsx index 67034399ba..f6bcf6d587 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterImagePreview.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/ControlAdapterImagePreview.tsx @@ -177,13 +177,11 @@ const ControlAdapterImagePreview = ({ isSmall, id }: Props) => { { /> { {pendingControlImages.includes(id) && ( - + )} diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx index 41e1ec35c5..bde576ef12 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/imports/ControlNetCanvasImageImports.tsx @@ -29,11 +29,7 @@ const ControlNetCanvasImageImports = ( }, [id, dispatch]); return ( - + } diff --git a/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx b/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx index 8bfe7afa3d..6178b4f1c2 100644 --- a/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx +++ b/invokeai/frontend/web/src/features/controlAdapters/components/processors/common/ProcessorWrapper.tsx @@ -5,7 +5,7 @@ type Props = PropsWithChildren; export default function ProcessorWrapper(props: Props) { return ( - + {props.children} ); diff --git a/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx b/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx index 14c4ff7dc7..c39a7a97cd 100644 --- a/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx +++ b/invokeai/frontend/web/src/features/deleteImageModal/components/ImageUsageMessage.tsx @@ -29,7 +29,7 @@ const ImageUsageMessage = (props: Props) => { return ( <> {topMessage} - + {imageUsage.isInitialImage && ( {t('common.img2img')} )} diff --git a/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx b/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx index 22be340aa0..4647fd8c3f 100644 --- a/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx +++ b/invokeai/frontend/web/src/features/dnd/components/DragPreview.tsx @@ -11,7 +11,7 @@ type OverlayDragImageProps = { const BOX_SIZE = 28; -const STYLES: ChakraProps['sx'] = { +const imageStyles: ChakraProps['sx'] = { w: BOX_SIZE, h: BOX_SIZE, maxW: BOX_SIZE, @@ -24,6 +24,14 @@ const STYLES: ChakraProps['sx'] = { color: 'base.100', }; +const multiImageStyles: ChakraProps['sx'] = { + position: 'relative', + alignItems: 'center', + justifyContent: 'center', + flexDir: 'column', + ...imageStyles, +}; + const DragPreview = (props: OverlayDragImageProps) => { const { t } = useTranslation(); if (!props.dragData) { @@ -34,17 +42,15 @@ const DragPreview = (props: OverlayDragImageProps) => { const { field, fieldTemplate } = props.dragData.payload; return ( {field.label || fieldTemplate.title} @@ -55,19 +61,15 @@ const DragPreview = (props: OverlayDragImageProps) => { const { thumbnail_url, width, height } = props.dragData.payload.imageDTO; return ( { if (props.dragData.payloadType === 'IMAGE_DTOS') { return ( - + {props.dragData.payload.imageDTOs.length} {t('parameters.images')} diff --git a/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx b/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx index 14141f42a1..46fbb6b0ca 100644 --- a/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx +++ b/invokeai/frontend/web/src/features/embedding/EmbeddingSelect.tsx @@ -68,7 +68,7 @@ export const EmbeddingSelect = ({ onChange={onChange} onMenuClose={onClose} data-testid="add-embedding" - sx={{ w: 'full' }} + w="full" /> ); diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx index d50699a3fe..459f0e987e 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/AutoAddIcon.tsx @@ -5,15 +5,8 @@ import { useTranslation } from 'react-i18next'; const AutoAddIcon = () => { const { t } = useTranslation(); return ( - - + + {t('common.auto')} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx index 17f3c3c225..d43666b795 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardContextMenu.tsx @@ -93,10 +93,7 @@ const BoardContextMenu = ({ const renderMenuFunc = useCallback( () => ( - + } diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx index 08a261ac8f..feef52f4c3 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/BoardsList.tsx @@ -5,6 +5,7 @@ import { useAppSelector } from 'app/store/storeHooks'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import DeleteBoardModal from 'features/gallery/components/Boards/DeleteBoardModal'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'; +import type { CSSProperties} from 'react'; import { memo, useState } from 'react'; import { useListAllBoardsQuery } from 'services/api/endpoints/boards'; import type { BoardDTO } from 'services/api/types'; @@ -14,6 +15,11 @@ import BoardsSearch from './BoardsSearch'; import GalleryBoard from './GalleryBoard'; import NoBoardBoard from './NoBoardBoard'; +const overlayScrollbarsStyles: CSSProperties = { + height: '100%', + width: '100%', +}; + const selector = createMemoizedSelector([stateSelector], ({ gallery }) => { const { selectedBoardId, boardSearchText } = gallery; return { selectedBoardId, boardSearchText }; @@ -39,39 +45,35 @@ const BoardsList = (props: Props) => { - + - + {filteredBoards && filteredBoards.map((board, index) => ( + {coverImage?.thumbnail_url ? ( ) : ( )} @@ -213,21 +212,19 @@ const GalleryBoard = ({ isHovered={isHovered} /> - + diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx index 9d7a1336a4..1484db850b 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/BoardsList/NoBoardBoard.tsx @@ -71,19 +71,17 @@ const NoBoardBoard = memo(({ isSelected }: Props) => { ); const { t } = useTranslation(); return ( - + {(ref) => ( @@ -91,58 +89,50 @@ const NoBoardBoard = memo(({ isSelected }: Props) => { invoke-ai-logo {autoAddBoardId === 'none' && } {boardName} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx index 85d26dbe96..9fb5771abd 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/DeleteBoardModal.tsx @@ -139,9 +139,7 @@ const DeleteBoardModal = (props: Props) => { - + {t('boards.cancel')} diff --git a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx index c58e8455ed..0425ac1fa3 100644 --- a/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/Boards/GalleryBoardContextMenuItems.tsx @@ -20,11 +20,7 @@ const GalleryBoardContextMenuItems = ({ board, setBoardToDelete }: Props) => { return ( <> - } - onClick={handleDelete} - > + } onClick={handleDelete}> {t('boards.deleteBoard')} diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx index 387291de9c..cd37070374 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx @@ -217,14 +217,7 @@ const CurrentImageButtons = () => { return ( <> - + { return ( diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx index ad14bba238..2599e9002c 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImagePreview.tsx @@ -14,8 +14,17 @@ import ImageMetadataViewer from 'features/gallery/components/ImageMetadataViewer import NextPrevImageButtons from 'features/gallery/components/NextPrevImageButtons'; import { useNextPrevImage } from 'features/gallery/hooks/useNextPrevImage'; import { selectLastSelectedImage } from 'features/gallery/store/gallerySelectors'; +import type { AnimationProps} from 'framer-motion'; import { AnimatePresence, motion } from 'framer-motion'; -import { memo, useCallback, useMemo, useRef, useState } from 'react'; +import type { + CSSProperties} from 'react'; +import { + memo, + useCallback, + useMemo, + useRef, + useState, +} from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; import { useTranslation } from 'react-i18next'; import { FaImage } from 'react-icons/fa'; @@ -128,13 +137,11 @@ const CurrentImagePreview = () => { {hasDenoiseProgress && shouldShowProgressInViewer ? ( @@ -158,13 +165,11 @@ const CurrentImagePreview = () => { )} {shouldShowImageDetails && imageDTO && ( @@ -173,24 +178,10 @@ const CurrentImagePreview = () => { {!shouldShowImageDetails && imageDTO && shouldShowNextPrevButtons && ( @@ -201,3 +192,22 @@ const CurrentImagePreview = () => { }; export default memo(CurrentImagePreview); + +const initial: AnimationProps['initial'] = { + opacity: 0, +}; +const animate: AnimationProps['animate'] = { + opacity: 1, + transition: { duration: 0.1 }, +}; +const exit: AnimationProps['exit'] = { + opacity: 0, + transition: { duration: 0.1 }, +}; +const motionStyles: CSSProperties = { + position: 'absolute', + top: '0', + width: '100%', + height: '100%', + pointerEvents: 'none', +}; diff --git a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx index dabc26743d..d36f6517b6 100644 --- a/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/CurrentImage/ProgressImage.tsx @@ -1,6 +1,7 @@ +import type { SystemStyleObject } from '@chakra-ui/react'; import { Image } from '@chakra-ui/react'; import { useAppSelector } from 'app/store/storeHooks'; -import { memo } from 'react'; +import { memo, useMemo } from 'react'; const CurrentImagePreview = () => { const progress_image = useAppSelector( @@ -10,6 +11,13 @@ const CurrentImagePreview = () => { (state) => state.system.shouldAntialiasProgressImage ); + const sx = useMemo( + () => ({ + imageRendering: shouldAntialiasProgressImage ? 'auto' : 'pixelated', + }), + [shouldAntialiasProgressImage] + ); + if (!progress_image) { return null; } @@ -21,15 +29,12 @@ const CurrentImagePreview = () => { height={progress_image.height} draggable={false} data-testid="progress-image" - sx={{ - objectFit: 'contain', - maxWidth: 'full', - maxHeight: 'full', - height: 'auto', - position: 'absolute', - borderRadius: 'base', - imageRendering: shouldAntialiasProgressImage ? 'auto' : 'pixelated', - }} + objectFit="contain" + maxWidth="full" + maxHeight="full" + position="absolute" + borderRadius="base" + sx={sx} /> ); }; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx index 672d920ba6..b46dfb2d03 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/ImageContextMenu.tsx @@ -36,20 +36,14 @@ const ImageContextMenu = ({ imageDTO, children }: Props) => { if (selectionCount > 1) { return ( - + ); } return ( - + ); diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx index 91748ce1fb..1d32bac5b9 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/MultipleSelectionMenuItems.tsx @@ -113,7 +113,7 @@ const MultipleSelectionMenuItems = () => { {t('boards.changeBoard')} } onClickCapture={handleDeleteSelection} > diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx index 837488784f..aa80a206d6 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageContextMenu/SingleSelectionMenuItems.tsx @@ -248,7 +248,7 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => { )} } onClickCapture={handleDelete} > diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx index 0cc96e4789..0b8b8b1055 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGalleryContent.tsx @@ -50,22 +50,18 @@ const ImageGalleryContent = () => { return ( - + { - + @@ -98,9 +88,7 @@ const ImageGalleryContent = () => { size="sm" isChecked={galleryView === 'images'} onClick={handleClickImages} - sx={{ - w: 'full', - }} + w="full" leftIcon={} data-testid="images-tab" > @@ -111,9 +99,7 @@ const ImageGalleryContent = () => { size="sm" isChecked={galleryView === 'assets'} onClick={handleClickAssets} - sx={{ - w: 'full', - }} + w="full" leftIcon={} data-testid="assets-tab" > diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx index 119d7bf265..87ca7a324b 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImage.tsx @@ -1,3 +1,4 @@ +import type { SystemStyleObject } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react'; import { useStore } from '@nanostores/react'; import { $customStarUI } from 'app/store/nanostores/customStarUI'; @@ -26,6 +27,11 @@ import { useUnstarImagesMutation, } from 'services/api/endpoints/images'; +const imageSx: SystemStyleObject = { w: 'full', h: 'full' }; +const imageIconStyleOverrides: SystemStyleObject = { + bottom: 2, + top: 'auto', +}; interface HoverableImageProps { imageName: string; index: number; @@ -130,19 +136,14 @@ const GalleryImage = (props: HoverableImageProps) => { } return ( - + { draggableData={draggableData} isSelected={isSelected} minSize={0} - imageSx={{ w: 'full', h: 'full' }} + imageSx={imageSx} isDropDisabled={true} isUploadDisabled={true} thumbnail={true} @@ -170,10 +171,7 @@ const GalleryImage = (props: HoverableImageProps) => { onClick={handleDelete} icon={} tooltip={t('gallery.deleteImage')} - styleOverrides={{ - bottom: 2, - top: 'auto', - }} + styleOverrides={imageIconStyleOverrides} /> )} diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx index 8576ebcdbc..bb181e6118 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx @@ -9,10 +9,12 @@ import { $useNextPrevImageState } from 'features/gallery/hooks/useNextPrevImage' import { selectListImagesBaseQueryArgs } from 'features/gallery/store/gallerySelectors'; import { IMAGE_LIMIT } from 'features/gallery/store/types'; import { useOverlayScrollbars } from 'overlayscrollbars-react'; +import type { CSSProperties } from 'react'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FaExclamationCircle, FaImage } from 'react-icons/fa'; import type { + GridComponents, ItemContent, ListRange, VirtuosoGridHandle, @@ -28,6 +30,13 @@ import GalleryImage from './GalleryImage'; import ImageGridItemContainer from './ImageGridItemContainer'; import ImageGridListContainer from './ImageGridListContainer'; +const components: GridComponents = { + Item: ImageGridItemContainer, + List: ImageGridListContainer, +}; + +const virtuosoStyles: CSSProperties = { height: '100%' }; + const GalleryImageGrid = () => { const { t } = useTranslation(); const rootRef = useRef(null); @@ -115,14 +124,7 @@ const GalleryImageGrid = () => { if (!currentData) { return ( - + ); @@ -130,14 +132,7 @@ const GalleryImageGrid = () => { if (isSuccess && currentData?.ids.length === 0) { return ( - + { <> { if (isError) { return ( - + { {...props} className="list-container" ref={ref} - sx={{ - gridTemplateColumns: `repeat(auto-fill, minmax(${galleryImageMinimumWidth}px, 1fr));`, - }} + gridTemplateColumns={`repeat(auto-fill, minmax(${galleryImageMinimumWidth}px, 1fr))`} data-testid="image-list-container" > {props.children} diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx index 68ee9a049a..786c74cd04 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/DataViewer.tsx @@ -4,6 +4,7 @@ import { InvTooltip } from 'common/components/InvTooltip/InvTooltip'; import { overlayScrollbarsParams } from 'common/components/OverlayScrollbars/constants'; import { isString } from 'lodash-es'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'; +import type { CSSProperties} from 'react'; import { memo, useCallback, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { FaCopy, FaDownload } from 'react-icons/fa'; @@ -42,35 +43,31 @@ const DataViewer = (props: Props) => { return (
{dataString}
- + {withDownload && ( { }; export default memo(DataViewer); + +const overlayScrollbarsStyles: CSSProperties = { + height: '100%', + width: '100%', +}; diff --git a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx index d1bbd2e6c7..f6ad443142 100644 --- a/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/ImageMetadataViewer/ImageMetadataViewer.tsx @@ -37,16 +37,14 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => { return ( {t('common.file')}: @@ -58,13 +56,11 @@ const ImageMetadataViewer = ({ image }: ImageMetadataViewerProps) => { {t('metadata.recallParameters')} diff --git a/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx b/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx index c3db48814f..70514faad0 100644 --- a/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/NextPrevImageButtons.tsx @@ -25,20 +25,12 @@ const NextPrevImageButtons = () => { } = useNextPrevImage(); return ( - + {!isOnFirstImage && ( { )} {!isOnLastImage && ( { /> )} {isOnLastImage && areMoreImagesAvailable && isFetching && ( - + )} diff --git a/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx b/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx index d70d4b689b..ceca745596 100644 --- a/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx +++ b/invokeai/frontend/web/src/features/lora/components/LoRASelect.tsx @@ -69,7 +69,7 @@ const LoRASelect = () => { noOptionsMessage={noOptionsMessage} onChange={onChange} data-testid="add-lora" - sx={{ w: 'full' }} + w="full" /> ); diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx index 4ce311db4f..8746bc4dac 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AddModels.tsx @@ -41,13 +41,7 @@ export default function AddModels() { {t('common.advanced')}
- + {addModelMode === 'simple' && } {addModelMode === 'advanced' && } diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx index 1bb0d58ac0..167977c8e4 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddCheckpoint.tsx @@ -148,7 +148,7 @@ export default function AdvancedAddCheckpoint( {!useCustomConfig ? ( ) : ( diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx index 9def04b11b..cd98f8e11e 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/AdvancedAddModels.tsx @@ -48,13 +48,7 @@ export default function AdvancedAddModels() { - + {advancedAddMode === 'diffusers' && } {advancedAddMode === 'checkpoint' && } diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx index 7b3f09595a..d8c9adc6e7 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/FoundModelsList.tsx @@ -110,25 +110,18 @@ export default function FoundModelsList() { return models.map((model) => { return ( - - + + {model.split('\\').slice(-1)[0]} - + {model} @@ -150,13 +143,11 @@ export default function FoundModelsList() { ) : ( {t('common.installed')} @@ -174,15 +165,13 @@ export default function FoundModelsList() { if (!foundModels || foundModels.length === 0) { return ( {t('modelManager.noModels')} @@ -190,27 +179,15 @@ export default function FoundModelsList() { } return ( - + - + {t('modelManager.modelsFound')}: {foundModels.length} - + {t('common.notInstalled')}: {filteredModels.length} diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx index 0176892a76..d767655e6b 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanAdvancedAddModels.tsx @@ -10,7 +10,6 @@ import type { } from 'common/components/InvSelect/types'; import { InvText } from 'common/components/InvText/wrapper'; import { setAdvancedAddScanModel } from 'features/modelManager/store/modelManagerSlice'; -import { motion } from 'framer-motion'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FaTimes } from 'react-icons/fa'; @@ -79,20 +78,15 @@ export default function ScanAdvancedAddModels() { return ( diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanModels.tsx index 66be9de98a..9886cdaeb4 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/ScanModels.tsx @@ -10,12 +10,10 @@ export default function ScanModels() { diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SearchFolderForm.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SearchFolderForm.tsx index 0b9b9f186f..9781c81808 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SearchFolderForm.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/AddModelsPanel/SearchFolderForm.tsx @@ -59,22 +59,13 @@ function SearchFolderForm() { )} style={{ width: '100%' }} > - + {t('common.folder')} @@ -86,15 +77,13 @@ function SearchFolderForm() { /> ) : ( {searchFolder} diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx index 045321449f..cbfed933e6 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/MergeModelsPanel.tsx @@ -259,13 +259,8 @@ export default function MergeModelsPanel() { ]); return ( - - + + {t('modelManager.modelMergeHeaderHelp1')} {t('modelManager.modelMergeHeaderHelp2')} @@ -273,28 +268,28 @@ export default function MergeModelsPanel() { - + - + - + - + - + {t('modelManager.interpolationType')} @@ -382,13 +368,11 @@ export default function MergeModelsPanel() { diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx index 0dbc65f078..91ad0ec0fe 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel.tsx @@ -34,7 +34,7 @@ export default function ModelManagerPanel() { const model = mainModel ? mainModel : loraModel; return ( - + { return ( {t('modelManager.noModelSelected')} diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx index 18628e6196..f01a19fc17 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/CheckpointModelEdit.tsx @@ -123,13 +123,7 @@ export default function CheckpointModelEdit(props: CheckpointModelEditProps) { {![''].includes(model.base_model) ? ( ) : ( - + {t('modelManager.conversionNotSupported')} )} diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx index d88cbaae5b..b2e012982f 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelList.tsx @@ -272,15 +272,7 @@ const modelsFilter = < const StyledModelContainer = memo((props: PropsWithChildren) => { return ( - + {props.children} ); @@ -301,7 +293,7 @@ const ModelListWrapper = memo((props: ModelListWrapperProps) => { const { title, modelList, selected } = props; return ( - + {title} diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx index 90a4e9f78a..7e23d0f7c6 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerPanel/ModelListItem.tsx @@ -84,23 +84,16 @@ export default function ModelListItem(props: ModelListItemProps) { ]); return ( - + diff --git a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx index cd5c890cc9..494df74d95 100644 --- a/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx +++ b/invokeai/frontend/web/src/features/modelManager/subpanels/ModelManagerSettingsPanel/SyncModels.tsx @@ -8,26 +8,17 @@ export default function SyncModels() { return ( - - - {t('modelManager.syncModels')} - - + + {t('modelManager.syncModels')} + {t('modelManager.syncModelsDesc')} diff --git a/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx b/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx index 8ded58b72d..2a9682c7d2 100644 --- a/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/NodeEditor.tsx @@ -20,14 +20,12 @@ const NodeEditor = () => { return ( {isReady && ( @@ -71,15 +69,13 @@ const NodeEditor = () => { > { onChange={onChange} onMenuClose={onClose} onKeyDown={onKeyDown} - sx={{ - width: 'full', - }} /> diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx index c5db3a84c3..2d2abf1cef 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/edges/InvocationCollapsedEdge.tsx @@ -65,19 +65,15 @@ const InvocationCollapsedEdge = ({ {data?.count && data.count > 1 && ( {data.count} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx index 628c818e88..e8a084f775 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/CurrentImage/CurrentImageNode.tsx @@ -34,12 +34,10 @@ const CurrentImageNode = (props: NodeProps) => { ); @@ -83,38 +81,26 @@ const Wrapper = (props: PropsWithChildren<{ nodeProps: NodeProps }>) => { onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} className={DRAG_HANDLE_CLASSNAME} - sx={{ - position: 'relative', - flexDirection: 'column', - }} + position="relative" + flexDirection="column" > - + {t('nodes.currentImage')} {props.children} {isHovering && ( diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx index 5cd420e3ce..9e55cc194f 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNode.tsx @@ -38,16 +38,14 @@ const InvocationNode = ({ nodeId, isOpen, label, type, selected }: Props) => { <> - + {inputConnectionFieldNames.map((fieldName, i) => ( { > ); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx index 2c4efc746f..024c4122bd 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeFooter.tsx @@ -18,14 +18,12 @@ const InvocationNodeFooter = ({ nodeId }: Props) => { {isCacheEnabled && } {hasImageOutput && } diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx index e099d81360..a576f3e798 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeHeader.tsx @@ -20,15 +20,13 @@ const InvocationNodeHeader = ({ nodeId, isOpen }: Props) => { return ( diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx index 4a8f716fe3..c210642ea3 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeInfoIcon.tsx @@ -25,12 +25,10 @@ const InvocationNodeInfoIcon = ({ nodeId }: Props) => { > ); @@ -66,7 +64,7 @@ const TooltipContent = memo(({ nodeId }: { nodeId: string }) => { if (!data.version) { return ( - + {t('nodes.versionUnknown')} ); @@ -74,7 +72,7 @@ const TooltipContent = memo(({ nodeId }: { nodeId: string }) => { if (!nodeTemplate.version) { return ( - + {t('nodes.version')} {data.version} ({t('nodes.unknownTemplate')}) ); @@ -82,7 +80,7 @@ const TooltipContent = memo(({ nodeId }: { nodeId: string }) => { if (compare(data.version, nodeTemplate.version, '<')) { return ( - + {t('nodes.version')} {data.version} ({t('nodes.updateNode')}) ); @@ -90,7 +88,7 @@ const TooltipContent = memo(({ nodeId }: { nodeId: string }) => { if (compare(data.version, nodeTemplate.version, '>')) { return ( - + {t('nodes.version')} {data.version} ({t('nodes.updateApp')}) ); @@ -104,16 +102,12 @@ const TooltipContent = memo(({ nodeId }: { nodeId: string }) => { }, [data, nodeTemplate, t]); if (!isInvocationNodeData(data)) { - return ( - - {t('nodes.unknownNode')} - - ); + return {t('nodes.unknownNode')}; } return ( - - + + {title} {nodeTemplate?.nodePack && ( @@ -121,7 +115,7 @@ const TooltipContent = memo(({ nodeId }: { nodeId: string }) => { {t('nodes.nodePack')}: {nodeTemplate.nodePack} )} - + {nodeTemplate?.description} {versionComponent} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx index fc4c2c0fad..186428f446 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeStatusIndicator.tsx @@ -1,3 +1,4 @@ +import type { SystemStyleObject } from '@chakra-ui/react'; import { Badge, CircularProgress, Flex, Icon, Image } from '@chakra-ui/react'; import { createMemoizedSelector } from 'app/store/createMemoizedSelector'; import { stateSelector } from 'app/store/store'; @@ -16,7 +17,7 @@ type Props = { }; const iconBoxSize = 3; -const circleStyles = { +const circleStyles: SystemStyleObject = { circle: { transitionProperty: 'none', transitionDuration: '0s', @@ -47,12 +48,10 @@ const InvocationNodeStatusIndicator = ({ nodeId }: Props) => { > @@ -75,16 +74,16 @@ const TooltipLabel = memo(({ nodeExecutionState }: TooltipLabelProps) => { if (status === zNodeStatus.enum.IN_PROGRESS) { if (progressImage) { return ( - + {progress !== null && ( - + {Math.round(progress * 100)}% )} @@ -123,15 +122,7 @@ type StatusIconProps = { const StatusIcon = memo((props: StatusIconProps) => { const { progress, status } = props.nodeExecutionState; if (status === zNodeStatus.enum.PENDING) { - return ( - - ); + return ; } if (status === zNodeStatus.enum.IN_PROGRESS) { return progress === null ? ( @@ -153,26 +144,10 @@ const StatusIcon = memo((props: StatusIconProps) => { ); } if (status === zNodeStatus.enum.COMPLETED) { - return ( - - ); + return ; } if (status === zNodeStatus.enum.FAILED) { - return ( - - ); + return ; } return null; }); diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx index 6c7bffc194..7a3bcbac92 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeUnknownFallback.tsx @@ -29,40 +29,29 @@ const InvocationNodeUnknownFallback = ({ - + {label ? `${label} (${type})` : type} {isOpen && ( diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx index e9ce15ade0..0302ab968c 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/EditableFieldTitle.tsx @@ -1,3 +1,4 @@ +import type { SystemStyleObject } from '@chakra-ui/react'; import { Editable, EditableInput, @@ -78,51 +79,28 @@ const EditableFieldTitle = forwardRef((props: Props, ref) => { > - + @@ -130,6 +108,25 @@ const EditableFieldTitle = forwardRef((props: Props, ref) => { ); }); +const editableInputStyles: SystemStyleObject = { + p: 0, + w: 'full', + fontWeight: 'semibold', + color: 'base.100', + _focusVisible: { + p: 0, + textAlign: 'left', + boxShadow: 'none', + }, +}; +const editablePreviewStyles: SystemStyleObject = { + p: 0, + textAlign: 'left', + _hover: { + fontWeight: 'semibold !important', + }, +}; + export default memo(EditableFieldTitle); const EditableControls = memo(() => { diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx index 5973bcaa17..0afa3b8b1a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldContextMenu.tsx @@ -103,10 +103,7 @@ const FieldContextMenu = ({ nodeId, fieldName, kind, children }: Props) => { const renderMenuFunc = useCallback( () => !menuItems.length ? null : ( - + diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx index b0b6a3f318..d7ccddcf8b 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTitle.tsx @@ -19,17 +19,15 @@ const FieldTitle = forwardRef((props: Props, ref) => { return ( - + {label || fieldTemplateTitle} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx index 89fa50a5c3..90d870fdd1 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/FieldTooltipContent.tsx @@ -43,10 +43,10 @@ const FieldTooltipContent = ({ nodeId, fieldName, kind }: Props) => { }, [field, fieldTemplate, t]); return ( - - {fieldTitle} + + {fieldTitle} {fieldTemplate && ( - + {fieldTemplate.description} )} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx index dd094395d0..e59ab5b836 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldRenderer.tsx @@ -292,13 +292,7 @@ const InputFieldRenderer = ({ nodeId, fieldName }: InputFieldProps) => { return ( - + {t('nodes.unknownFieldType', { type: fieldInstance?.type.name })} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/OutputField.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/OutputField.tsx index df2ae5973f..18a91cbc0e 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/OutputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/OutputField.tsx @@ -97,16 +97,14 @@ type OutputFieldWrapperProps = PropsWithChildren<{ const OutputFieldWrapper = memo( ({ shouldDim, children }: OutputFieldWrapperProps) => ( {children} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx index 9fd27fd712..61c8484e63 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/IPAdapterModelFieldInputComponent.tsx @@ -56,7 +56,6 @@ const IPAdapterModelFieldInputComponent = ( placeholder="Pick one" options={options} onChange={onChange} - sx={{ width: '100%' }} /> diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx index ad5b70987f..cba0a9fb15 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/ImageFieldInputComponent.tsx @@ -78,12 +78,10 @@ const ImageFieldInputComponent = ( return ( { }); return ( - + { }); return ( - + { }); return ( - + diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx index 1916054dfb..7bfe59acdc 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/inputs/VAEModelFieldInputComponent.tsx @@ -48,7 +48,7 @@ const VAEModelFieldInputComponent = (props: Props) => { }); return ( - + ) => { @@ -42,26 +40,21 @@ const NotesNode = (props: NodeProps) => { - + diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeCollapseButton.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeCollapseButton.tsx index ba091e71bd..44a535d328 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeCollapseButton.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeCollapseButton.tsx @@ -24,23 +24,15 @@ const NodeCollapseButton = ({ nodeId, isOpen }: Props) => { className="nodrag" onClick={handleClick} aria-label="Minimize" - sx={{ - minW: 8, - w: 8, - h: 8, - color: 'base.500', - _hover: { - color: 'base.300', - }, - }} + minW={8} + w={8} + h={8} variant="link" icon={ } /> diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeTitle.tsx index 44248bf0b7..652eed8d45 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeTitle.tsx @@ -1,3 +1,4 @@ +import type { SystemStyleObject } from '@chakra-ui/react'; import { Box, Editable, @@ -50,46 +51,28 @@ const NodeTitle = ({ nodeId, title }: Props) => { return ( - + @@ -120,13 +103,19 @@ function EditableControls() { ); } + +const editableInputStyles: SystemStyleObject = { + p: 0, + fontWeight: 'bold', + _focusVisible: { + p: 0, + }, +}; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeWrapper.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeWrapper.tsx index e2bbbbdb83..e81ba17187 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeWrapper.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/common/NodeWrapper.tsx @@ -18,7 +18,7 @@ import { memo, useCallback, useMemo } from 'react'; type NodeWrapperProps = PropsWithChildren & { nodeId: string; selected: boolean; - width?: NonNullable['w']; + width?: ChakraProps['w']; }; const NodeWrapper = (props: NodeWrapperProps) => { @@ -65,45 +65,39 @@ const NodeWrapper = (props: NodeWrapperProps) => { onMouseEnter={handleMouseOver} onMouseLeave={handleMouseOut} className={DRAG_HANDLE_CLASSNAME} - sx={{ - h: 'full', - position: 'relative', - borderRadius: 'base', - w: width ?? NODE_WIDTH, - transitionProperty: 'common', - transitionDuration: '0.1s', - cursor: 'grab', - opacity, - }} + h="full" + position="relative" + borderRadius="base" + w={width ? width : NODE_WIDTH} + transitionProperty="common" + transitionDuration="0.1s" + cursor="grab" + opacity={opacity} > {children} diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/BottomLeftPanel/BottomLeftPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/BottomLeftPanel/BottomLeftPanel.tsx index 732c2bf14c..60ffd1430a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/BottomLeftPanel/BottomLeftPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/BottomLeftPanel/BottomLeftPanel.tsx @@ -5,7 +5,7 @@ import NodeOpacitySlider from './NodeOpacitySlider'; import ViewportControls from './ViewportControls'; const BottomLeftPanel = () => ( - + diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx index 23eca32329..2906d5f140 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/MinimapPanel/MinimapPanel.tsx @@ -1,3 +1,4 @@ +import type { SystemStyleObject } from '@chakra-ui/react'; import { chakra, Flex } from '@chakra-ui/react'; import type { RootState } from 'app/store/store'; import { useAppSelector } from 'app/store/storeHooks'; @@ -6,26 +7,28 @@ import { MiniMap } from 'reactflow'; const ChakraMiniMap = chakra(MiniMap); +const minimapStyles: SystemStyleObject = { + m: '0 !important', + borderRadius: 'base', + backgroundColor: 'base.500 !important', + svg: { + borderRadius: 'inherit', + }, +}; + const MinimapPanel = () => { const shouldShowMinimapPanel = useAppSelector( (state: RootState) => state.nodes.shouldShowMinimapPanel ); return ( - + {shouldShowMinimapPanel && ( diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx index 2e79ea9763..3fcff30958 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/TopPanel.tsx @@ -13,15 +13,13 @@ const TopCenterPanel = () => { return ( diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx index ece2f153df..b446559cf7 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/TopRightPanel.tsx @@ -9,7 +9,7 @@ const TopRightPanel = () => { useFeatureStatus('workflowLibrary').isFeatureEnabled; return ( - + {isWorkflowLibraryEnabled && } diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx index 587b3a93b5..2f55ace94a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopRightPanel/WorkflowEditorSettings.tsx @@ -104,13 +104,7 @@ const WorkflowEditorSettings = ({ children }: Props) => { {t('nodes.workflowSettings')} - + {t('parameters.general')} { }, []); return ( - + { } return ( - + {template?.outputType === 'image_output' ? ( nes.outputs.map((result, i) => ( diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx index 492084a182..49522013bb 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/inspector/InspectorPanel.tsx @@ -19,19 +19,14 @@ const InspectorPanel = () => { return ( - + {t('common.details')} {t('common.outputs')} diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx index 4813062f26..235ae8acbc 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowGeneralTab.tsx @@ -87,16 +87,9 @@ const WorkflowGeneralTab = () => { return ( - + - + @@ -104,7 +97,7 @@ const WorkflowGeneralTab = () => { - + diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx index 49a1fb1d21..b51100306f 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowJSONTab.tsx @@ -9,14 +9,7 @@ const WorkflowJSONTab = () => { const { t } = useTranslation(); return ( - + ); diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx index 2196af81f8..fdfc46ef6f 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLinearTab.tsx @@ -19,24 +19,16 @@ const WorkflowLinearTab = () => { const { t } = useTranslation(); return ( - + {fields.length ? ( fields.map(({ nodeId, fieldName }) => ( diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx index 06dde276ce..096059dc83 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowPanel.tsx @@ -18,19 +18,14 @@ const WorkflowPanel = () => { return ( - + {t('common.linear')} {t('common.details')} diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx index da47ff338a..f256703223 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageSize/AspectRatioSelect.tsx @@ -1,3 +1,4 @@ +import type { SystemStyleObject } from '@chakra-ui/styled-system'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; import type { SingleValue } from 'chakra-react-select'; import { InvControl } from 'common/components/InvControl/InvControl'; @@ -41,7 +42,7 @@ export const AspectRatioSelect = () => { value={value} onChange={onChange} options={ASPECT_RATIO_OPTIONS} - sx={{ minW: 48 }} + sx={selectStyles} /> @@ -49,3 +50,5 @@ export const AspectRatioSelect = () => { ); }; + +const selectStyles: SystemStyleObject = { minW: 48 }; diff --git a/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx b/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx index 184ba821a2..2816925168 100644 --- a/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/ImageToImage/InitialImageDisplay.tsx @@ -52,34 +52,28 @@ const InitialImageDisplay = () => { return ( {t('metadata.initImage')} diff --git a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx b/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx index 43377a6734..149c226dea 100644 --- a/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx +++ b/invokeai/frontend/web/src/features/parameters/components/Upscale/ParamUpscaleSettings.tsx @@ -48,12 +48,7 @@ const ParamUpscalePopover = (props: Props) => { - + { const isPrependEnabled = useFeatureStatus('prependQueue').isFeatureEnabled; return ( {isPrependEnabled && } diff --git a/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx b/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx index f060f99553..34bed38a1c 100644 --- a/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx +++ b/invokeai/frontend/web/src/features/settingsAccordions/ControlSettingsAccordion/ControlSettingsAccordion.tsx @@ -94,7 +94,7 @@ export const ControlSettingsAccordion: React.FC = memo(() => { defaultIsOpen={true} badges={badges} > - + { const { t } = useTranslation(); return ( - - + + {t('models.noRefinerModelsInstalled')} diff --git a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModalItem.tsx b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModalItem.tsx index eebf01637a..06c86cb211 100644 --- a/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModalItem.tsx +++ b/invokeai/frontend/web/src/features/system/components/HotkeysModal/HotkeysModalItem.tsx @@ -11,33 +11,15 @@ export default function HotkeysModalItem(props: HotkeysModalProps) { const { title, hotkey, description } = props; return ( {title} - {description && ( - - {description} - - )} + {description && {description}} - + {hotkey} diff --git a/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx b/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx index c0d7918542..83a96ee9dd 100644 --- a/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx +++ b/invokeai/frontend/web/src/features/system/components/InvokeAILogoComponent.tsx @@ -21,16 +21,14 @@ const InvokeAILogoComponent = ({ showVersion = true }: Props) => { invoke-ai-logo - - + + invoke ai @@ -50,13 +48,10 @@ const InvokeAILogoComponent = ({ showVersion = true }: Props) => { }} > {appVersion.version} diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx index 747fae85b3..97cba57fcf 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsModal.tsx @@ -233,7 +233,7 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => { {t('common.settingsLabel')} - + {t('settings.general')} diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx index 298ed4e483..fa622d94d0 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/StyledFlex.tsx @@ -5,13 +5,11 @@ import { memo } from 'react'; const StyledFlex = (props: PropsWithChildren) => { return ( {props.children} diff --git a/invokeai/frontend/web/src/features/system/components/SiteHeader.tsx b/invokeai/frontend/web/src/features/system/components/SiteHeader.tsx index 339e127051..5c7b5285a4 100644 --- a/invokeai/frontend/web/src/features/system/components/SiteHeader.tsx +++ b/invokeai/frontend/web/src/features/system/components/SiteHeader.tsx @@ -38,12 +38,7 @@ const SiteHeader = () => { const discordLink = 'https://discord.gg/ZmtBAhwWhy'; return ( - + @@ -54,7 +49,7 @@ const SiteHeader = () => { variant="link" aria-label={t('accessibility.menu')} icon={} - sx={{ boxSize: 8 }} + boxSize={8} /> diff --git a/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx b/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx index 5058762a34..9a940ba96d 100644 --- a/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx +++ b/invokeai/frontend/web/src/features/system/components/StatusIndicator.tsx @@ -71,26 +71,18 @@ const StatusIndicator = () => { }} > {t(statusTranslationKey as ResourceKey)} )} - + ); }; diff --git a/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx b/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx index 2a2e6edf94..1c55e6efa5 100644 --- a/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx +++ b/invokeai/frontend/web/src/features/ui/components/FloatingGalleryButton.tsx @@ -40,12 +40,10 @@ const FloatingGalleryButton = ({ aria-label={t('accessibility.showGalleryPanel')} onClick={handleShowGallery} icon={} - sx={{ - p: 0, - px: 3, - h: 48, - borderEndRadius: 0, - }} + p={0} + px={3} + h={48} + borderEndRadius={0} /> diff --git a/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx b/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx index bc91b74a86..857154ea29 100644 --- a/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx +++ b/invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx @@ -210,18 +210,11 @@ const InvokeTabs = () => { defaultIndex={activeTabIndex} index={activeTabIndex} onChange={handleTabChange} - sx={{ - flexGrow: 1, - gap: 4, - }} + flexGrow={1} + gap={4} isLazy > - + {tabs} diff --git a/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx b/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx index 5fc01c3310..66065fa137 100644 --- a/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx +++ b/invokeai/frontend/web/src/features/ui/components/ParametersPanel.tsx @@ -22,44 +22,16 @@ const ParametersPanel = () => { ); return ( - + - - + + - + {isSDXL ? : } diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx index ddb56af44f..100861ed67 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ImageToImageTab.tsx @@ -20,7 +20,7 @@ const ImageToImageTab = () => { const panelStorage = usePanelStorage(); return ( - + { isLazy variant="line" layerStyle="first" - sx={{ w: 'full', h: 'full', p: 4, gap: 4, borderRadius: 'base' }} + w="full" + h="full" + p={4} + gap={4} + borderRadius="base" > {tabs.map((tab) => ( - + {tab.label} ))} - + {tabs.map((tab) => ( - + {tab.content} ))} diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx index ffc64601cc..20f6d2db43 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ResizeHandle.tsx @@ -1,6 +1,7 @@ -import type { FlexProps } from '@chakra-ui/react'; +import type { FlexProps, SystemStyleObject } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react'; -import { memo } from 'react'; +import type { CSSProperties} from 'react'; +import { memo, useMemo } from 'react'; import { PanelResizeHandle } from 'react-resizable-panels'; type ResizeHandleProps = Omit & { @@ -17,84 +18,83 @@ const ResizeHandle = (props: ResizeHandleProps) => { ...rest } = props; - if (direction === 'horizontal') { - return ( - - - - - - ); - } - - return ( - (() => { + if (direction === 'horizontal') { + return { visibility: isCollapsed ? 'hidden' : 'visible', width: isCollapsed ? 0 : 'auto', - }} - > + }; + } + return { + visibility: isCollapsed ? 'hidden' : 'visible', + width: isCollapsed ? 0 : 'auto', + }; + }, [direction, isCollapsed]); + + const resizeHandleWrapperStyles = useMemo(() => { + if (direction === 'horizontal') { + return { + w: collapsedDirection ? 2.5 : 4, + h: 'full', + justifyContent: collapsedDirection + ? collapsedDirection === 'left' + ? 'flex-start' + : 'flex-end' + : 'center', + alignItems: 'center', + div: { + bg: 'base.850', + }, + _hover: { + div: { bg: 'base.700' }, + }, + }; + } + return { + w: 'full', + h: collapsedDirection ? 2.5 : 4, + alignItems: collapsedDirection + ? collapsedDirection === 'top' + ? 'flex-start' + : 'flex-end' + : 'center', + justifyContent: 'center', + div: { + bg: 'base.850', + }, + _hover: { + div: { bg: 'base.700' }, + }, + }; + }, [collapsedDirection, direction]); + const resizeInnerStyles = useMemo(() => { + if (direction === 'horizontal') { + return { + w: 1, + h: 'calc(100% - 1rem)', + borderRadius: 'base', + transitionProperty: 'common', + transitionDuration: 'normal', + }; + } + + return { + h: 1, + w: 'calc(100% - 1rem)', + borderRadius: 'base', + transitionProperty: 'common', + transitionDuration: 'normal', + }; + }, [direction]); + + return ( + - + ); diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx index dc1139d79e..51f1b1f2d5 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/TextToImageTab.tsx @@ -6,20 +6,13 @@ const TextToImageTab = () => { return ( - + diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx index 96d9b27859..8b4622fb2e 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/UnifiedCanvasTab.tsx @@ -29,15 +29,13 @@ const UnifiedCanvasTab = () => { layerStyle="first" ref={setDroppableRef} tabIndex={-1} - sx={{ - flexDirection: 'column', - alignItems: 'center', - gap: 4, - p: 2, - borderRadius: 'base', - w: 'full', - h: 'full', - }} + flexDirection="column" + alignItems="center" + gap={4} + p={2} + borderRadius="base" + w="full" + h="full" >