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
feat(webv2): add loading screen, organize brand mark component usage
joshistoast971950f62d06
diff --git a/invokeai/frontend/webv2/src/assets/SplashImage.webp b/invokeai/frontend/webv2/src/assets/SplashImage.webpnew file mode 100644index 0000000000..02ab32d523Binary files /dev/null and b/invokeai/frontend/webv2/src/assets/SplashImage.webp differdiff --git a/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsx b/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsxindex 821d623ee2..72786247e9 100644--- a/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsx+++ b/invokeai/frontend/webv2/src/workbench/WorkbenchContext.tsx@@ -1,7 +1,17 @@-import { createContext, use, useEffect, useRef, useSyncExternalStore, type Dispatch, type ReactNode } from 'react';+import {+ createContext,+ use,+ useEffect,+ useRef,+ useSyncExternalStore,+ useState,+ type Dispatch,+ type ReactNode,+} from 'react';import type { Project, WorkbenchState } from './types';+import { WorkbenchSplashScreen } from './components/WorkbenchSplashScreen';import {syncedWorkbenchPersistence,type WorkbenchLoadOptions,@@ -91,6 +101,7 @@ export const WorkbenchProvider = ({const store = storeRef.current;const dispatch = store.dispatch;+ const [hasHydrated, setHasHydrated] = useState(store.getSnapshot().hasHydrated);const hasLoadedPersistenceRef = useRef(false);const lastSavedStateKeyRef = useRef(getPersistedStateKey(store.getState()));// Captured once: the options describe how this mount of the editor boots.@@ -139,6 +150,7 @@ export const WorkbenchProvider = ({if (!isCancelled) {store.setHasHydrated(true);+ setHasHydrated(true);}}};@@ -282,7 +294,9 @@ export const WorkbenchProvider = ({return (<WorkbenchStoreContext value={store}>- <WorkbenchDispatchContext value={dispatch}>{children}</WorkbenchDispatchContext>+ <WorkbenchDispatchContext value={dispatch}>+ {hasHydrated ? children : <WorkbenchSplashScreen message="Opening project" />}+ </WorkbenchDispatchContext></WorkbenchStoreContext>);};diff --git a/invokeai/frontend/webv2/src/workbench/auth/components/AuthScreen.tsx b/invokeai/frontend/webv2/src/workbench/auth/components/AuthScreen.tsxindex 19969a77cc..6ff8eaabb8 100644--- a/invokeai/frontend/webv2/src/workbench/auth/components/AuthScreen.tsx+++ b/invokeai/frontend/webv2/src/workbench/auth/components/AuthScreen.tsx@@ -1,6 +1,7 @@import type { ReactNode } from 'react';-import { Alert, Box, Flex, Heading, Stack, Text } from '@chakra-ui/react';+import { Alert, Flex, Heading, Stack, Text } from '@chakra-ui/react';+import { InvokeMark } from '@workbench/components/InvokeMark';/*** Centered scaffold shared by the login and first-run setup screens. These@@ -50,16 +51,3 @@ export const AuthFormAlert = ({ message, tone }: { message: string; tone: 'error<Alert.Title fontSize="xs">{message}</Alert.Title></Alert.Root>);--/** The Invoke logomark, drawn in the theme brand color. Shared with the Home shell. */-export const InvokeMark = ({ size = 36 }: { size?: number }) => (- <Box color="brand.fg">- <svg aria-hidden="true" fill="none" height={size} viewBox="0 0 44 44" width={size}>- <path- d="M29.1951 10.6667H42V2H2V10.6667H14.8049L29.1951 33.3333H42V42H2V33.3333H14.8049"- stroke="currentColor"- strokeWidth="2.8"- />- </svg>- </Box>-);diff --git a/invokeai/frontend/webv2/src/workbench/components/InvokeMark.tsx b/invokeai/frontend/webv2/src/workbench/components/InvokeMark.tsxnew file mode 100644index 0000000000..d77971e5ac--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/components/InvokeMark.tsx@@ -0,0 +1,14 @@+import { Box } from '@chakra-ui/react';++/** The Invoke logomark, drawn in the theme brand color. */+export const InvokeMark = ({ size = 36 }: { size?: number }) => (+ <Box color="brand.fg">+ <svg aria-hidden="true" fill="none" height={size} viewBox="0 0 44 44" width={size}>+ <path+ d="M29.1951 10.6667H42V2H2V10.6667H14.8049L29.1951 33.3333H42V42H2V33.3333H14.8049"+ stroke="currentColor"+ strokeWidth="2.8"+ />+ </svg>+ </Box>+);diff --git a/invokeai/frontend/webv2/src/workbench/components/WorkbenchSplashScreen.tsx b/invokeai/frontend/webv2/src/workbench/components/WorkbenchSplashScreen.tsxnew file mode 100644index 0000000000..2c4f094943--- /dev/null+++ b/invokeai/frontend/webv2/src/workbench/components/WorkbenchSplashScreen.tsx@@ -0,0 +1,43 @@+import splashImageUrl from '@assets/SplashImage.webp';+import { Box, Flex, Heading, HStack, Spinner, Text, VStack } from '@chakra-ui/react';+import { InvokeMark } from '@workbench/components/InvokeMark';++export const WorkbenchSplashScreen = ({ message = 'Loading workspace' }: { message?: string }) => (+ <Flex align="center" aria-busy="true" bg="bg" color="fg" h="100vh" justify="center" role="status" w="100vw">+ <Box+ position="relative"+ borderColor="border.subtle"+ borderRadius="3xl"+ borderWidth="1px"+ maxW="2xl"+ p="6"+ shadow="sm"+ >+ <HStack align="stretch" gap="8">+ <Box+ aspectRatio="1/1"+ p="14"+ bgImage={`url(${splashImageUrl})`}+ rounded="xl"+ style={{ backgroundPosition: 'center', backgroundSize: 'cover' }}+ >+ <InvokeMark size={164} />+ </Box>+ <VStack align="start" flex="1" minH="full" minW="80" textAlign="start" py="2">+ <Heading size="2xl">Invoke AI 7.0</Heading>+ <Text fontSize="md">Image Generation for Creatives</Text>+ <Text fontSize="xs">Artwork by John Smith</Text>+ <Flex alignItems="center" gap="2" mt="auto">+ <Spinner size="xs" />+ <Text fontSize="xs" flex="1">+ {message}+ </Text>+ </Flex>+ <Text fontSize="2xs" mt="auto" fontFamily="mono">+ © {new Date().getFullYear()} Invoke AI | All rights reserved+ </Text>+ </VStack>+ </HStack>+ </Box>+ </Flex>+);diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsxindex a5c9c70f90..95c302061f 100644--- a/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/LaunchpadTopBar.tsx@@ -2,8 +2,8 @@ import type { BackendConnectionStatus } from '@workbench/types';import { Box, Flex, HStack, Text } from '@chakra-ui/react';import { AccountMenu } from '@workbench/auth/components/AccountMenu';-import { InvokeMark } from '@workbench/auth/components/AuthScreen';import { useConnectionStatus } from '@workbench/backend/connectionStore';+import { InvokeMark } from '@workbench/components/InvokeMark';import { SettingsButton } from '@workbench/settings/SettingsDialog';const CONNECTION_LABEL: Record<Exclude<BackendConnectionStatus, 'connected'>, string> = {diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/BrandMark.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/BrandMark.tsxdeleted file mode 100644index 55f6eec880..0000000000--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/BrandMark.tsx+++ /dev/null@@ -1,31 +0,0 @@-import { Link } from '@tanstack/react-router';-import { DEFAULT_THEME_ID, THEMES_BY_ID } from '@theme/themes';-import { useWorkbenchPreferences } from '@workbench/settings/store';--/** Compact Invoke logo used as a link to home screen. */-export const BrandMark = () => {- const { themeId } = useWorkbenchPreferences();- const theme = THEMES_BY_ID[themeId] ?? THEMES_BY_ID[DEFAULT_THEME_ID];-- return (- <Link- to="/"- style={{- alignItems: 'center',- aspectRatio: '1/1',- display: 'flex',- flexShrink: 0,- height: '100%',- justifyContent: 'center',- }}- >- <svg aria-hidden="true" fill="none" height="20" viewBox="0 0 44 44" width="20">- <path- d="M29.1951 10.6667H42V2H2V10.6667H14.8049L29.1951 33.3333H42V42H2V33.3333H14.8049"- stroke={theme.colors.brand.solid}- strokeWidth="2.8"- />- </svg>- </Link>- );-};diff --git a/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx b/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsxindex de810bb157..8c85b999ae 100644--- a/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx+++ b/invokeai/frontend/webv2/src/workbench/shell/topbar/TopBar.tsx@@ -1,12 +1,13 @@-import { Box, Flex, HStack, Separator } from '@chakra-ui/react';+import { Flex, HStack, Separator } from '@chakra-ui/react';+import { Link } from '@tanstack/react-router';import { useCapabilities } from '@workbench/auth/capabilities';import { AccountMenu } from '@workbench/auth/components/AccountMenu';import { ProjectTabs } from '@workbench/projects/components';+import { InvokeMark } from '@/workbench/components/InvokeMark';import { SettingsButton } from '@/workbench/settings';import { BatchCountField } from './BatchCountField';-import { BrandMark } from './BrandMark';import { InvokeControl } from './InvokeControl';import { LayoutPresetMenu } from './LayoutPresetMenu';import { ModelManagerButton } from './ModelManagerButton';@@ -32,9 +33,19 @@ export const TopBar = () => {pe="1.5"w="full">- <Box h="12" w="12">- <BrandMark />- </Box>+ <Link+ to="/"+ style={{+ alignItems: 'center',+ aspectRatio: '1/1',+ display: 'flex',+ flexShrink: 0,+ height: '100%',+ justifyContent: 'center',+ }}+ >+ <InvokeMark size={20} />+ </Link><Separator orientation="vertical" h={5} ms="-2" /><InvokeControl /><BatchCountField />