Skip to content

Commit 7798c37

Browse files
psychedelicioushipsterusername
authored andcommitted
feat(ui): handling for internal nodes
1 parent 49a8ba3 commit 7798c37

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

invokeai/frontend/web/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@
939939
"zoomOutNodes": "Zoom Out",
940940
"betaDesc": "This invocation is in beta. Until it is stable, it may have breaking changes during app updates. We plan to support this invocation long-term.",
941941
"prototypeDesc": "This invocation is a prototype. It may have breaking changes during app updates and may be removed at any time.",
942+
"internalDesc": "This invocation is used internally by Invoke. It may have breaking changes during app updates and may be removed at any time.",
942943
"imageAccessError": "Unable to find image {{image_name}}, resetting to default",
943944
"boardAccessError": "Unable to find board {{board_id}}, resetting to default",
944945
"modelAccessError": "Unable to find model {{key}}, resetting to default",

invokeai/frontend/web/src/features/nodes/components/flow/AddNodeCmdk/AddNodeCmdk.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { computed } from 'nanostores';
4040
import type { ChangeEvent } from 'react';
4141
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
4242
import { useTranslation } from 'react-i18next';
43-
import { PiFlaskBold, PiHammerBold } from 'react-icons/pi';
43+
import { PiCircuitryBold, PiFlaskBold, PiHammerBold } from 'react-icons/pi';
4444
import type { EdgeChange, NodeChange } from 'reactflow';
4545
import type { S } from 'services/api/types';
4646

@@ -413,6 +413,7 @@ const NodeCommandList = memo(({ searchTerm, onSelect }: { searchTerm: string; on
413413
<Flex alignItems="center" gap={2}>
414414
{item.classification === 'beta' && <Icon boxSize={4} color="invokeYellow.300" as={PiHammerBold} />}
415415
{item.classification === 'prototype' && <Icon boxSize={4} color="invokeRed.300" as={PiFlaskBold} />}
416+
{item.classification === 'internal' && <Icon boxSize={4} color="invokePurple.300" as={PiCircuitryBold} />}
416417
<Text fontWeight="semibold">{item.label}</Text>
417418
<Spacer />
418419
<Text variant="subtext" fontWeight="semibold">

invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/InvocationNodeClassificationIcon.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useNodeClassification } from 'features/nodes/hooks/useNodeClassificatio
33
import type { Classification } from 'features/nodes/types/common';
44
import { memo } from 'react';
55
import { useTranslation } from 'react-i18next';
6-
import { PiFlaskBold, PiHammerBold } from 'react-icons/pi';
6+
import { PiCircuitryBold, PiFlaskBold, PiHammerBold } from 'react-icons/pi';
77

88
interface Props {
99
nodeId: string;
@@ -22,7 +22,7 @@ const InvocationNodeClassificationIcon = ({ nodeId }: Props) => {
2222
placement="top"
2323
shouldWrapChildren
2424
>
25-
<Icon as={getIcon(classification)} display="block" boxSize={4} color="base.400" />
25+
<ClassificationIcon classification={classification} />
2626
</Tooltip>
2727
);
2828
};
@@ -40,19 +40,27 @@ const ClassificationTooltipContent = memo(({ classification }: { classification:
4040
return t('nodes.prototypeDesc');
4141
}
4242

43+
if (classification === 'internal') {
44+
return t('nodes.prototypeDesc');
45+
}
46+
4347
return null;
4448
});
4549

4650
ClassificationTooltipContent.displayName = 'ClassificationTooltipContent';
4751

48-
const getIcon = (classification: Classification) => {
52+
const ClassificationIcon = ({ classification }: { classification: Classification }) => {
4953
if (classification === 'beta') {
50-
return PiHammerBold;
54+
return <Icon as={PiHammerBold} display="block" boxSize={4} color="invokeYellow.300" />;
5155
}
5256

5357
if (classification === 'prototype') {
54-
return PiFlaskBold;
58+
return <Icon as={PiFlaskBold} display="block" boxSize={4} color="invokeRed.300" />;
5559
}
5660

57-
return undefined;
61+
if (classification === 'internal') {
62+
return <Icon as={PiCircuitryBold} display="block" boxSize={4} color="invokePurple.300" />;
63+
}
64+
65+
return null;
5866
};

invokeai/frontend/web/src/features/nodes/types/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const zColorField = z.object({
2222
});
2323
export type ColorField = z.infer<typeof zColorField>;
2424

25-
export const zClassification = z.enum(['stable', 'beta', 'prototype', 'deprecated']);
25+
export const zClassification = z.enum(['stable', 'beta', 'prototype', 'deprecated', 'internal']);
2626
export type Classification = z.infer<typeof zClassification>;
2727

2828
export const zSchedulerField = z.enum([

0 commit comments

Comments
 (0)