diff --git a/invokeai/frontend/web/src/features/controlLayers/components/CanvasLayersPanelContent.tsx b/invokeai/frontend/web/src/features/controlLayers/components/CanvasLayersPanelContent.tsx index 20e27c75601..90c13d87c14 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/CanvasLayersPanelContent.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/CanvasLayersPanelContent.tsx @@ -1,6 +1,6 @@ import { Divider, Flex } from '@invoke-ai/ui-library'; import { useAppSelector } from 'app/store/storeHooks'; -import { useFocusRegion } from 'common/hooks/focus'; +import { useFocusRegion, useIsRegionFocused } from 'common/hooks/focus'; import { CanvasAddEntityButtons } from 'features/controlLayers/components/CanvasAddEntityButtons'; import { CanvasEntityList } from 'features/controlLayers/components/CanvasEntityList/CanvasEntityList'; import { EntityListSelectedEntityActionBar } from 'features/controlLayers/components/CanvasEntityList/EntityListSelectedEntityActionBar'; @@ -11,11 +11,24 @@ export const CanvasLayersPanelContent = memo(() => { const hasEntities = useAppSelector(selectHasEntities); const layersPanelFocusRef = useRef(null); useFocusRegion('layers', layersPanelFocusRef); + const isRegionFocused = useIsRegionFocused('layers'); return ( - + - + {!hasEntities && } {hasEntities && } diff --git a/invokeai/frontend/web/src/features/controlLayers/components/CanvasMainPanelContent.tsx b/invokeai/frontend/web/src/features/controlLayers/components/CanvasMainPanelContent.tsx index b66c0d8367c..efa3f9df718 100644 --- a/invokeai/frontend/web/src/features/controlLayers/components/CanvasMainPanelContent.tsx +++ b/invokeai/frontend/web/src/features/controlLayers/components/CanvasMainPanelContent.tsx @@ -1,6 +1,6 @@ import { ContextMenu, Flex, IconButton, Menu, MenuButton, MenuList } from '@invoke-ai/ui-library'; import { useAppSelector } from 'app/store/storeHooks'; -import { useFocusRegion } from 'common/hooks/focus'; +import { useFocusRegion, useIsRegionFocused } from 'common/hooks/focus'; import { CanvasAlertsPreserveMask } from 'features/controlLayers/components/CanvasAlerts/CanvasAlertsPreserveMask'; import { CanvasAlertsSelectedEntityStatus } from 'features/controlLayers/components/CanvasAlerts/CanvasAlertsSelectedEntityStatus'; import { CanvasAlertsSendingToGallery } from 'features/controlLayers/components/CanvasAlerts/CanvasAlertsSendingTo'; @@ -42,6 +42,7 @@ export const CanvasMainPanelContent = memo(() => { }, []); useFocusRegion('canvas', ref); + const isRegionFocused = useIsRegionFocused('canvas'); return ( { gap={2} alignItems="center" justifyContent="center" + borderWidth={1} + p={2} + borderColor={isRegionFocused ? 'blue.300' : 'transparent'} + transition="border-color 0.1s" > diff --git a/invokeai/frontend/web/src/features/gallery/components/GalleryPanelContent.tsx b/invokeai/frontend/web/src/features/gallery/components/GalleryPanelContent.tsx index 66a03606446..1263fec4ea0 100644 --- a/invokeai/frontend/web/src/features/gallery/components/GalleryPanelContent.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/GalleryPanelContent.tsx @@ -1,6 +1,6 @@ import { Box, Button, Collapse, Divider, Flex, IconButton, useDisclosure } from '@invoke-ai/ui-library'; import { useAppDispatch, useAppSelector } from 'app/store/storeHooks'; -import { useFocusRegion } from 'common/hooks/focus'; +import { useFocusRegion, useIsRegionFocused } from 'common/hooks/focus'; import { GalleryHeader } from 'features/gallery/components/GalleryHeader'; import { selectBoardSearchText } from 'features/gallery/store/gallerySelectors'; import { boardSearchTextChanged } from 'features/gallery/store/gallerySlice'; @@ -28,6 +28,7 @@ const GalleryPanelContent = () => { const imperativePanelGroupRef = useRef(null); const galleryPanelFocusRef = useRef(null); useFocusRegion('gallery', galleryPanelFocusRef); + const isRegionFocused = useIsRegionFocused('gallery'); const boardsListPanelOptions = useMemo( () => ({ @@ -50,7 +51,20 @@ const GalleryPanelContent = () => { }, [boardSearchText.length, boardSearchDisclosure, boardsListPanel, dispatch]); return ( - +