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
refactor(ui): vendor brand and gradient icons in one module
Josh Corbettef1e94bc1183
diff --git a/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsx b/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsxindex b8353d8df4..a76a3094a1 100644--- a/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/add-models/AddModelsView.tsx@@ -34,9 +34,9 @@ import {} from '@platform/state/accountLifecycle';import { getApiErrorMessage } from '@platform/transport/http';import { Button, Scrollable, Tooltip } from '@platform/ui';-import { HuggingFaceIcon } from '@platform/ui/BrandIcon';+import { HuggingFaceIcon } from '@platform/ui/VendoredIcon';import { DownloadIcon, FileIcon, FolderIcon, FolderSearchIcon, LinkIcon, SearchIcon } from 'lucide-react';-import { useDeferredValue, useMemo, useState } from 'react';+import { useDeferredValue, useMemo, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';import { AccessTokenPopover } from './AccessTokenPopover';diff --git a/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsx b/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsxindex 3d36826919..3509c2c910 100644--- a/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/credentials/ApiKeysSection.tsx@@ -18,7 +18,7 @@ import {} from '@platform/state/accountLifecycle';import { getApiErrorMessage } from '@platform/transport/http';import { Button } from '@platform/ui';-import { HuggingFaceIcon } from '@platform/ui/BrandIcon';+import { HuggingFaceIcon } from '@platform/ui/VendoredIcon';import { HexagonIcon } from 'lucide-react';import { useState } from 'react';import { useTranslation } from 'react-i18next';diff --git a/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsx b/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsxindex 4c9eee6d9f..f8bbd12b16 100644--- a/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsx@@ -18,7 +18,7 @@ import { useScopedAction } from '@platform/react/useScopedAction';import { assertAccountScopeCurrent, type AccountScope } from '@platform/state/accountLifecycle';import { getApiErrorMessage } from '@platform/transport/http';import { Button } from '@platform/ui';-import { AlibabaCloudIcon, ByteDanceIcon, GoogleGeminiIcon } from '@platform/ui/BrandIcon';+import { AlibabaCloudIcon, ByteDanceIcon, GoogleGeminiIcon } from '@platform/ui/VendoredIcon';import { BotIcon, HexagonIcon } from 'lucide-react';import { useCallback, useState } from 'react';import { useTranslation } from 'react-i18next';diff --git a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsx b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsxindex d4db0ccaa1..99fd254e30 100644--- a/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/detail/ModelDetail.tsx@@ -16,7 +16,7 @@ import {import { useNotify } from '@features/models/ui/useModelsNotify';import { areArraysEqual } from '@platform/state/selectors';import { Button, IconButton, MenuContent } from '@platform/ui';-import { HuggingFaceIcon } from '@platform/ui/BrandIcon';+import { HuggingFaceIcon } from '@platform/ui/VendoredIcon';import { ExternalLinkIcon, MoreHorizontalIcon, PencilIcon } from 'lucide-react';import { memo, useCallback, useState } from 'react';import { useTranslation } from 'react-i18next';diff --git a/invokeai/frontend/webv2/src/features/models/ui/shared/ModelActionsMenu.tsx b/invokeai/frontend/webv2/src/features/models/ui/shared/ModelActionsMenu.tsxindex 1fdb25390c..116fce3d8e 100644--- a/invokeai/frontend/webv2/src/features/models/ui/shared/ModelActionsMenu.tsx+++ b/invokeai/frontend/webv2/src/features/models/ui/shared/ModelActionsMenu.tsx@@ -5,8 +5,8 @@ import type { ReactNode } from 'react';import { Icon, Menu } from '@chakra-ui/react';import { isConvertibleToDiffusers } from '@features/models/core/baseIdentity';import { useModelActions } from '@features/models/ui/detail/useModelActions';-import { HuggingFaceIcon } from '@platform/ui/BrandIcon';import { ConfirmDialog } from '@platform/ui/ConfirmDialog';+import { HuggingFaceIcon } from '@platform/ui/VendoredIcon';import { RefreshCcwIcon, Trash2Icon } from 'lucide-react';import { useTranslation } from 'react-i18next';diff --git a/invokeai/frontend/webv2/src/platform/ui/BrandIcon.tsx b/invokeai/frontend/webv2/src/platform/ui/BrandIcon.tsxdeleted file mode 100644index 3f0a44a17f..0000000000--- a/invokeai/frontend/webv2/src/platform/ui/BrandIcon.tsx+++ /dev/null@@ -1,89 +0,0 @@-import type { SVGProps } from 'react';--/**- * Brand marks, vendored mostly from Simple Icons (https://simpleicons.org,- * CC0-1.0); `origin` records any mark that came from somewhere else.- *- * Everything non-brand is a Lucide icon; brands are the only exception, and- * there are a handful of them. Both `react-icons/si` and the `simple-icons`- * package expose their icons through a single ~5 MB barrel module with no- * per-icon entry point, which the dev server transforms in full to hand back- * four paths — so the paths live here instead, as the data they are.- *- * To add or refresh one: copy the 24×24 path from simpleicons.org (or- * `npx -y simple-icons@latest`), keeping the slug and title as the upstream- * name so a later refresh is a straight lookup.- */--interface BrandIconSource {- /** Upstream slug, for refreshing the path later. */- slug: string;- /** Upstream title, used as the accessible name when the icon is not decorative. */- title: string;- /** The 24×24 `path` `d` attribute. */- path: string;- /** Where the path came from, when it is not Simple Icons. */- origin?: string;-}--const createBrandIcon = ({ path, title }: BrandIconSource) => {- const BrandIcon = ({ titleAccess, ...props }: SVGProps<SVGSVGElement> & { titleAccess?: boolean }) => (- <svg- // Decorative by default: every current consumer pairs the mark with- // visible text, and a titled icon there is announced twice. Pass- // `titleAccess` when the icon stands alone.- aria-hidden={titleAccess ? undefined : true}- fill="currentColor"- height="1em"- role={titleAccess ? 'img' : undefined}- viewBox="0 0 24 24"- width="1em"- xmlns="http://www.w3.org/2000/svg"- {...props}- >- {titleAccess ? <title>{title}</title> : null}- <path d={path} />- </svg>- );-- BrandIcon.displayName = `BrandIcon(${title})`;-- return BrandIcon;-};--export const HuggingFaceIcon = createBrandIcon({- path: 'M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624',- slug: 'huggingface',- title: 'Hugging Face',-});--export const AlibabaCloudIcon = createBrandIcon({- path: 'M3.996 4.517h5.291L8.01 6.324 4.153 7.506a1.668 1.668 0 0 0-1.165 1.601v5.786a1.668 1.668 0 0 0 1.165 1.6l3.857 1.183 1.277 1.807H3.996A3.996 3.996 0 0 1 0 15.487V8.513a3.996 3.996 0 0 1 3.996-3.996m16.008 0h-5.291l1.277 1.807 3.857 1.182c.715.227 1.17.889 1.165 1.601v5.786a1.668 1.668 0 0 1-1.165 1.6l-3.857 1.183-1.277 1.807h5.291A3.996 3.996 0 0 0 24 15.487V8.513a3.996 3.996 0 0 0-3.996-3.996m-4.007 8.345H8.002v-1.804h7.995Z',- slug: 'alibabacloud',- title: 'Alibaba Cloud',-});--export const ByteDanceIcon = createBrandIcon({- path: 'M19.8772 1.4685L24 2.5326v18.9426l-4.1228 1.0563V1.4685zm-13.3481 9.428l4.115 1.0641v8.9786l-4.115 1.0642v-11.107zM0 2.572l4.115 1.0642v16.7354L0 21.428V2.572zm17.4553 5.6205v11.107l-4.1228-1.0642V9.2568l4.1228-1.0642z',- slug: 'bytedance',- title: 'ByteDance',-});--export const GoogleGeminiIcon = createBrandIcon({- path: 'M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81',- slug: 'googlegemini',- title: 'Google Gemini',-});--export const GithubIcon = createBrandIcon({- path: 'M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12',- slug: 'github',- title: 'GitHub',-});--export const DiscordIcon = createBrandIcon({- origin: 'Material Icons (Apache-2.0)',- path: 'M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.1.1 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.1 16.1 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.02.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02M8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12m6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12',- slug: 'discord',- title: 'Discord',-});diff --git a/invokeai/frontend/webv2/src/platform/ui/VendoredIcon.tsx b/invokeai/frontend/webv2/src/platform/ui/VendoredIcon.tsxnew file mode 100644index 0000000000..3586cf2bfc--- /dev/null+++ b/invokeai/frontend/webv2/src/platform/ui/VendoredIcon.tsx@@ -0,0 +1,116 @@+import type { SVGProps } from 'react';++/**+ * Vendored icons: marks from Simple Icons (https://simpleicons.org, CC0-1.0)+ * and the odd glyph from another set, each recorded with its `origin`.+ *+ * Everything else is a Lucide icon; these are the exceptions, and there are a+ * handful of them. Both `react-icons` and the `simple-icons` package expose+ * their icons through a single ~5 MB barrel module with no per-icon entry+ * point, which the dev server transforms in full to hand back a few paths —+ * so the paths live here instead, as the data they are.+ *+ * To add or refresh one: copy the path data and viewBox from the source,+ * keeping the slug and title as the upstream name so a later refresh is a+ * straight lookup.+ */++interface VendoredIconSource {+ /** Upstream slug, for refreshing the path later. */+ slug: string;+ /** Upstream title, used as the accessible name when the icon is not decorative. */+ title: string;+ /** The `path` `d` attributes, drawn in order. */+ paths: readonly string[];+ /** The source's viewBox; Simple Icons draw on 24×24. */+ viewBox?: string;+ /** Where the icon came from, when it is not Simple Icons. */+ origin?: string;+}++const createVendoredIcon = ({ paths, title, viewBox = '0 0 24 24' }: VendoredIconSource) => {+ const VendoredIcon = ({ titleAccess, ...props }: SVGProps<SVGSVGElement> & { titleAccess?: boolean }) => (+ <svg+ // Decorative by default: every current consumer pairs the mark with+ // visible text, and a titled icon there is announced twice. Pass+ // `titleAccess` when the icon stands alone.+ aria-hidden={titleAccess ? undefined : true}+ fill="currentColor"+ height="1em"+ role={titleAccess ? 'img' : undefined}+ viewBox={viewBox}+ width="1em"+ xmlns="http://www.w3.org/2000/svg"+ {...props}+ >+ {titleAccess ? <title>{title}</title> : null}+ {paths.map((path) => (+ <path key={path} d={path} />+ ))}+ </svg>+ );++ VendoredIcon.displayName = `VendoredIcon(${title})`;++ return VendoredIcon;+};++export const HuggingFaceIcon = createVendoredIcon({+ paths: [+ 'M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624',+ ],+ slug: 'huggingface',+ title: 'Hugging Face',+});++export const AlibabaCloudIcon = createVendoredIcon({+ paths: [+ 'M3.996 4.517h5.291L8.01 6.324 4.153 7.506a1.668 1.668 0 0 0-1.165 1.601v5.786a1.668 1.668 0 0 0 1.165 1.6l3.857 1.183 1.277 1.807H3.996A3.996 3.996 0 0 1 0 15.487V8.513a3.996 3.996 0 0 1 3.996-3.996m16.008 0h-5.291l1.277 1.807 3.857 1.182c.715.227 1.17.889 1.165 1.601v5.786a1.668 1.668 0 0 1-1.165 1.6l-3.857 1.183-1.277 1.807h5.291A3.996 3.996 0 0 0 24 15.487V8.513a3.996 3.996 0 0 0-3.996-3.996m-4.007 8.345H8.002v-1.804h7.995Z',+ ],+ slug: 'alibabacloud',+ title: 'Alibaba Cloud',+});++export const ByteDanceIcon = createVendoredIcon({+ paths: [+ 'M19.8772 1.4685L24 2.5326v18.9426l-4.1228 1.0563V1.4685zm-13.3481 9.428l4.115 1.0641v8.9786l-4.115 1.0642v-11.107zM0 2.572l4.115 1.0642v16.7354L0 21.428V2.572zm17.4553 5.6205v11.107l-4.1228-1.0642V9.2568l4.1228-1.0642z',+ ],+ slug: 'bytedance',+ title: 'ByteDance',+});++export const GoogleGeminiIcon = createVendoredIcon({+ paths: [+ 'M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81',+ ],+ slug: 'googlegemini',+ title: 'Google Gemini',+});++export const GithubIcon = createVendoredIcon({+ paths: [+ 'M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12',+ ],+ slug: 'github',+ title: 'GitHub',+});++export const DiscordIcon = createVendoredIcon({+ origin: 'Material Icons (Apache-2.0)',+ paths: [+ 'M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.1.1 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.1 16.1 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.02.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02M8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12m6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12',+ ],+ slug: 'discord',+ title: 'Discord',+});++export const GradientIcon = createVendoredIcon({+ origin: 'Carbon (Apache-2.0)',+ paths: [+ 'M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m-4 22v-4h-4v4h-4v-4h-4v-4h4v-4h-4v-4h4V6h4v4h4V6h4v20Z',+ 'M14 10h4v4h-4zm0 8h4v4h-4zm4-4h4v4h-4z',+ ],+ slug: 'gradient',+ title: 'Gradient',+ viewBox: '0 0 32 32',+});diff --git a/invokeai/frontend/webv2/src/workbench/launchpad/HelpMenu.tsx b/invokeai/frontend/webv2/src/workbench/launchpad/HelpMenu.tsxindex c7eb153639..858407eb65 100644--- a/invokeai/frontend/webv2/src/workbench/launchpad/HelpMenu.tsx+++ b/invokeai/frontend/webv2/src/workbench/launchpad/HelpMenu.tsx@@ -2,9 +2,9 @@ import type { ElementType } from 'react';import { chakra, HStack, Icon, Menu, Portal, Text } from '@chakra-ui/react';import { APP_VERSION } from '@platform/runtime/appMetadata';-import { DiscordIcon, GithubIcon } from '@platform/ui/BrandIcon';import { Button } from '@platform/ui/Button';import { MenuContent } from '@platform/ui/Menu';+import { DiscordIcon, GithubIcon } from '@platform/ui/VendoredIcon';import { BookOpenTextIcon, ChevronRightIcon, ClapperboardIcon, CircleQuestionMarkIcon } from 'lucide-react';import { useTranslation } from 'react-i18next';diff --git a/invokeai/frontend/webv2/src/workbench/settings/AboutSettings.tsx b/invokeai/frontend/webv2/src/workbench/settings/AboutSettings.tsxindex 57b59d24f7..bd86f1a3ad 100644--- a/invokeai/frontend/webv2/src/workbench/settings/AboutSettings.tsx+++ b/invokeai/frontend/webv2/src/workbench/settings/AboutSettings.tsx@@ -1,8 +1,8 @@import { HStack, Icon, Link, Spinner, Stack, Text } from '@chakra-ui/react';import { useCapabilities } from '@features/identity';import { useMountEffect } from '@platform/react/useMountEffect';-import { DiscordIcon, GithubIcon } from '@platform/ui/BrandIcon';import { JsonPreview } from '@platform/ui/JsonPreview';+import { DiscordIcon, GithubIcon } from '@platform/ui/VendoredIcon';import { useMemo } from 'react';import { useTranslation } from 'react-i18next';diff --git a/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsx b/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsxindex c53e79886c..b7ec4ec087 100644--- a/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsx+++ b/invokeai/frontend/webv2/src/workbench/widgets/canvas/ToolStrip.tsx@@ -7,8 +7,8 @@ import type {import { Box } from '@chakra-ui/react';import { Toolbar, ToolbarButton } from '@platform/ui/Toolbar';+import { GradientIcon } from '@platform/ui/VendoredIcon';import {- BlendIcon,BrushIcon,CircleIcon,EraserIcon,@@ -25,7 +25,7 @@ import {TriangleIcon,TypeIcon,} from 'lucide-react';-import { useCallback, useEffect, useMemo } from 'react';+import { useCallback, useEffect, useMemo, type ElementType } from 'react';import { useTranslation } from 'react-i18next';import { isCanvasToolEnabled } from './canvasInteractionLock';@@ -37,7 +37,7 @@ type ToolStripEngine = CanvasCoreStoreCapability & { readonly tools: CanvasToolCinterface ToolStripButtonProps {engine: ToolStripEngine;- icon: typeof HandIcon;+ icon: ElementType;isInteractionLocked: boolean;label: string;toolId: ToolId;@@ -231,7 +231,7 @@ const ToolStripRoot = ({<ShapeFamilyButton engine={engine} isInteractionLocked={isInteractionLocked} /><ToolStripButtonengine={engine}- icon={BlendIcon}+ icon={GradientIcon}isInteractionLocked={isInteractionLocked}label={t('widgets.canvas.tools.gradient')}toolId="gradient"diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/previewNavigation.test.ts b/invokeai/frontend/webv2/src/workbench/widgets/preview/previewNavigation.test.tsdeleted file mode 100644index e00ea60bb9..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/previewNavigation.test.ts+++ /dev/null@@ -1,31 +0,0 @@-import { describe, expect, it } from 'vitest';--import {- getPreviewNavigationCursor,- getPreviewNavigationSequence,- getPreviewNavigationTarget,-} from './previewNavigation';--const images = [- { kind: 'image' as const, name: 'same-name' },- { kind: 'video' as const, name: 'same-name' },- { kind: 'image' as const, name: 'older' },-];--describe('saved-image preview navigation', () => {- it('preserves the board order and distinguishes same-name media', () => {- const sequence = getPreviewNavigationSequence({ boardImages: images });- const cursor = getPreviewNavigationCursor(sequence, { isFollowingLive: false, selectedItemKey: 'video:same-name' });- expect(getPreviewNavigationTarget(sequence, cursor, -1)?.item).toEqual(images[0]);- expect(getPreviewNavigationTarget(sequence, cursor, 1)?.item).toEqual(images[2]);- expect(getPreviewNavigationTarget(sequence, 0, -1)).toBeNull();- expect(getPreviewNavigationTarget(sequence, 2, 1)).toBeNull();- });- it('has no board cursor while following a live session or without a saved selection', () => {- const sequence = getPreviewNavigationSequence({ boardImages: images });- expect(getPreviewNavigationCursor(sequence, { isFollowingLive: true, selectedItemKey: 'video:same-name' })).toBe(- -1- );- expect(getPreviewNavigationCursor(sequence, { isFollowingLive: false, selectedItemKey: null })).toBe(-1);- });-});diff --git a/invokeai/frontend/webv2/src/workbench/widgets/preview/previewNavigation.ts b/invokeai/frontend/webv2/src/workbench/widgets/preview/previewNavigation.tsdeleted file mode 100644index c7b195c358..0000000000--- a/invokeai/frontend/webv2/src/workbench/widgets/preview/previewNavigation.ts+++ /dev/null@@ -1,37 +0,0 @@-import type { GalleryItemKey } from '@features/gallery/contracts';--import { toGalleryItemKey } from '@features/gallery/contracts';--interface NavigableItem {- kind: 'image' | 'video';- name: string;-}-export type PreviewNavigationItem<TItem extends NavigableItem> = { kind: 'item'; item: TItem };--/** Saved-image navigation never assigns a live session to a board. */-export const getPreviewNavigationSequence = <TItem extends NavigableItem>({- boardImages,-}: {- boardImages: TItem[];-}): PreviewNavigationItem<TItem>[] => boardImages.map((item) => ({ kind: 'item', item }));--export const getPreviewNavigationCursor = <TItem extends NavigableItem>(- sequence: PreviewNavigationItem<TItem>[],- { isFollowingLive, selectedItemKey }: { isFollowingLive: boolean; selectedItemKey: GalleryItemKey | null }-): number => {- if (isFollowingLive) {- return -1;- }-- if (selectedItemKey === null) {- return -1;- }-- return sequence.findIndex((entry) => entry.kind === 'item' && toGalleryItemKey(entry.item) === selectedItemKey);-};--export const getPreviewNavigationTarget = <TItem extends NavigableItem>(- sequence: PreviewNavigationItem<TItem>[],- cursorIndex: number,- offset: -1 | 1-): PreviewNavigationItem<TItem> | null => (cursorIndex === -1 ? null : (sequence[cursorIndex + offset] ?? null));