Skip to content

Commit 5be1e03

Browse files
Feature/user workflow tags (#8698)
* Feature: Add Tag System for user made Workflows * feat(ui): display tags on workflow library tiles Show workflow tags at the bottom of each tile in the workflow browser, making it easier to identify workflow categories at a glance. --------- Co-authored-by: Lincoln Stein <[email protected]>
1 parent 8731414 commit 5be1e03

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,7 @@
19851985
"allLoaded": "All Workflows Loaded",
19861986
"searchPlaceholder": "Search by name, description or tags",
19871987
"filterByTags": "Filter by Tags",
1988+
"tags": "Tags",
19881989
"yourWorkflows": "Your Workflows",
19891990
"recentlyOpened": "Recently Opened",
19901991
"noRecentWorkflows": "No Recent Workflows",

invokeai/frontend/web/src/features/nodes/components/sidePanel/workflow/WorkflowLibrary/WorkflowListItem.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ export const WorkflowListItem = memo(({ workflow }: { workflow: WorkflowRecordLi
3939
return workflowId === workflow.workflow_id;
4040
}, [workflowId, workflow.workflow_id]);
4141

42+
const tags = useMemo(() => {
43+
if (!workflow.tags) {
44+
return [];
45+
}
46+
return workflow.tags
47+
.split(',')
48+
.map((tag) => tag.trim())
49+
.filter((tag) => tag.length > 0);
50+
}, [workflow.tags]);
51+
4252
const handleClickLoad = useCallback(() => {
4353
loadWorkflowWithDialog({
4454
type: 'library',
@@ -109,6 +119,16 @@ export const WorkflowListItem = memo(({ workflow }: { workflow: WorkflowRecordLi
109119
<Text variant="subtext" fontSize="xs" noOfLines={3}>
110120
{workflow.description}
111121
</Text>
122+
{tags.length > 0 && (
123+
<Text fontSize="xs" noOfLines={1}>
124+
<Text as="span" color="base.400">
125+
{t('workflows.tags')}:{' '}
126+
</Text>
127+
<Text as="span" color="base.400">
128+
{tags.join(', ')}
129+
</Text>
130+
</Text>
131+
)}
112132
</Flex>
113133
<Flex className={WORKFLOW_ACTION_BUTTONS_CN} alignItems="center" display="none" h={8}>
114134
{workflow.opened_at && (

0 commit comments

Comments
 (0)