Skip to content

Commit 5414fb9

Browse files
BillLeoutsakosvl346Bill Leoutsakos
andauthored
refactor(ui): reuse EMCN icons for simple product glyphs (#8016)
* refactor(ui): reuse EMCN icons for simple product glyphs * docs(emcn): add CircleStop usage example --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
1 parent 6aabeb3 commit 5414fb9

11 files changed

Lines changed: 46 additions & 95 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ export type {
44
NestedAgentGroup,
55
} from '@/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group-view'
66
export { isAgentGroupResolved } from '@/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group-view'
7-
export { CircleStop } from '@/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/tool-call-item'

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/tool-call-item.tsx‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,6 @@ import { BrandIcon } from '@/blocks/brand-icon'
2626
import { useCustomBlockOverlayVersion } from '@/blocks/custom/client-overlay'
2727
import { getBlockByToolName } from '@/blocks/registry'
2828

29-
export function CircleStop({ className }: { className?: string }) {
30-
return (
31-
<svg
32-
width='16'
33-
height='16'
34-
viewBox='0 0 16 16'
35-
fill='none'
36-
xmlns='http://www.w3.org/2000/svg'
37-
className={className}
38-
>
39-
<circle cx='8' cy='8' r='6.5' stroke='currentColor' strokeWidth='1.25' />
40-
<rect x='6' y='6' width='4' height='4' rx='0.5' fill='currentColor' />
41-
</svg>
42-
)
43-
}
44-
4529
export interface ToolCallItemProps {
4630
toolName: string
4731
displayTitle: string

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type { AgentGroupItem, NestedAgentGroup } from './agent-group'
2-
export { AgentGroup, CircleStop, isAgentGroupResolved } from './agent-group'
2+
export { AgentGroup, isAgentGroupResolved } from './agent-group'
33
export { ChatContent } from './chat-content'
44
export { MessageSources } from './message-sources'
55
export { Options } from './options'

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx‎

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
import { lazy, Suspense, useCallback, useEffect, useMemo, useState } from 'react'
44
import { cn, Expandable, ExpandableContent, SecretReveal, Tooltip, toast } from '@sim/emcn'
5-
import { ArrowRight, Check, ChevronDown, SquareArrowUpRight, TerminalWindow } from '@sim/emcn/icons'
5+
import {
6+
ArrowRight,
7+
Check,
8+
ChevronDown,
9+
Lock,
10+
SquareArrowUpRight,
11+
TerminalWindow,
12+
} from '@sim/emcn/icons'
613
import { isRecordLike } from '@sim/utils/object'
714
import { useParams } from 'next/navigation'
815
import { useSession } from '@/lib/auth/auth-client'
@@ -1986,24 +1993,6 @@ function getCredentialProviderDisplayName(provider: string): string {
19861993
)
19871994
}
19881995

1989-
const LockIcon = (props: { className?: string }) => (
1990-
<svg
1991-
className={props.className}
1992-
viewBox='0 0 16 16'
1993-
fill='none'
1994-
xmlns='http://www.w3.org/2000/svg'
1995-
>
1996-
<rect x='2' y='5' width='12' height='8' rx='1.5' stroke='currentColor' strokeWidth='1.3' />
1997-
<path
1998-
d='M5 5V3.5a3 3 0 1 1 6 0V5'
1999-
stroke='currentColor'
2000-
strokeWidth='1.3'
2001-
strokeLinecap='round'
2002-
/>
2003-
<circle cx='8' cy='9.5' r='1.25' fill='currentColor' />
2004-
</svg>
2005-
)
2006-
20071996
/**
20081997
* Inline "paste a secret" widget rendered for
20091998
* `<credential>{"type":"secret_input","name":"OPENAI_API_KEY"}</credential>`.
@@ -2484,7 +2473,7 @@ function CredentialLinkDisplay({
24842473
// The connect link value comes from the streamed model output, so only
24852474
// render it as a clickable link when it resolves to a real http(s) URL.
24862475
if (!data.value || !isSafeHttpUrl(data.value)) return null
2487-
const Icon = getCredentialIcon(data.provider) ?? LockIcon
2476+
const Icon = getCredentialIcon(data.provider) ?? Lock
24882477
const label = reconnectCredentialId
24892478
? `Reconnect ${reconnectCredential?.displayName ?? integrationName}`
24902479
: hasExistingCredential
@@ -2550,7 +2539,7 @@ function PersonalCredentialLinkDisplay({
25502539
onConnected,
25512540
})
25522541
if (!provider || (provider.toLowerCase() === 'gitlab' && !canEdit)) return null
2553-
const Icon = getCredentialIcon(provider) ?? LockIcon
2542+
const Icon = getCredentialIcon(provider) ?? Lock
25542543
const connected = connection.status === 'connected'
25552544
const label = connected
25562545
? `Connected ${name}`

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content-overlay.test.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ vi.mock('./components', () => ({
3131
</div>
3232
),
3333
ChatContent: () => null,
34-
CircleStop: () => null,
3534
Options: () => null,
3635
PendingTagIndicator: () => null,
3736
}))

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
useState,
1212
} from 'react'
1313
import { cn } from '@sim/emcn'
14+
import { CircleStop } from '@sim/emcn/icons'
1415
import { PrepareFileEdit, Read as ReadTool } from '@/lib/copilot/generated/tool-catalog-v1'
1516
import { isToolHiddenInUi } from '@/lib/copilot/tools/client/hidden-tools'
1617
import { resolveToolDisplay } from '@/lib/copilot/tools/client/store-utils'
@@ -40,14 +41,7 @@ import type {
4041
import { SUBAGENT_LABELS } from '@/app/workspace/[workspaceId]/home/types'
4142
import { useCustomBlockOverlayVersion } from '@/blocks/custom/client-overlay'
4243
import type { AgentGroupItem } from './components'
43-
import {
44-
AgentGroup,
45-
ChatContent,
46-
CircleStop,
47-
MessageSources,
48-
Options,
49-
PendingTagIndicator,
50-
} from './components'
44+
import { AgentGroup, ChatContent, MessageSources, Options, PendingTagIndicator } from './components'
5145
import { deriveMessagePhase, isToolDone, type MessagePhase } from './utils'
5246

5347
const FILE_SUBAGENT_ID = 'file'

‎apps/sim/app/workspace/[workspaceId]/upgrade/components/comparison-table/comparison-table.tsx‎

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client'
22
import { chipVariants, cn } from '@sim/emcn'
3+
import { Check } from '@sim/emcn/icons'
34
import { SlackIcon } from '@/components/icons'
45
import { BillingPeriodToggle } from '@/app/workspace/[workspaceId]/upgrade/components/billing-period-toggle/billing-period-toggle'
56
import {
@@ -54,38 +55,14 @@ export interface ComparisonTableProps {
5455
ctas: Partial<Record<PlanName, ComparisonPlanCta>>
5556
}
5657

57-
/**
58-
* Inline check icon — matches the card-level `CheckIcon` shape.
59-
*/
60-
function CheckIcon() {
61-
return (
62-
<svg
63-
width='14'
64-
height='14'
65-
viewBox='0 0 14 14'
66-
fill='none'
67-
aria-hidden='true'
68-
className='size-[14px] shrink-0'
69-
>
70-
<path
71-
d='M2.5 7L5.5 10L11.5 4'
72-
stroke='currentColor'
73-
strokeWidth='1.5'
74-
strokeLinecap='round'
75-
strokeLinejoin='round'
76-
/>
77-
</svg>
78-
)
79-
}
80-
8158
/**
8259
* Renders a single cell value: `true` → check icon, `false` → em-dash, string → text.
8360
*/
8461
function Cell({ value }: { value: CellValue }) {
8562
if (value === true) {
8663
return (
8764
<span className='flex justify-center text-[var(--text-primary)]'>
88-
<CheckIcon />
65+
<Check className='size-[14px] shrink-0' />
8966
</span>
9067
)
9168
}

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
PopoverSection,
1313
usePopoverContext,
1414
} from '@sim/emcn'
15+
import { ChevronLeft } from '@sim/emcn/icons'
1516
import {
1617
getEffectiveBlockOutputType,
1718
getOutputPathsFromSchema,
@@ -862,14 +863,7 @@ const TagDropdownBackButton: React.FC<{ setSelectedIndex: (index: number) => voi
862863
}}
863864
onMouseEnter={handleMouseEnter}
864865
>
865-
<svg
866-
className={cn('shrink-0', size === 'sm' ? 'size-3' : 'h-3.5 w-3.5')}
867-
fill='none'
868-
viewBox='0 0 24 24'
869-
stroke='currentColor'
870-
>
871-
<path strokeLinecap='round' strokeLinejoin='round' strokeWidth={2} d='M15 19l-7-7 7-7' />
872-
</svg>
866+
<ChevronLeft className={cn('shrink-0', size === 'sm' ? 'size-3' : 'size-3.5')} />
873867
<span className='shrink-0'>Back</span>
874868
</PopoverItem>
875869
)

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/variables-input/variables-input.tsx‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
Textarea,
1212
Tooltip,
1313
} from '@sim/emcn'
14-
import { ArrowLeftRight, Plus, Trash } from '@sim/emcn/icons'
14+
import { ArrowLeftRight, FileText, Plus, Trash } from '@sim/emcn/icons'
1515
import { generateId } from '@sim/utils/id'
1616
import { useParams } from 'next/navigation'
1717
import { formatDisplayText } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/formatted-text'
@@ -336,19 +336,7 @@ export function VariablesInput({
336336
if (isPreview && (!assignments || assignments.length === 0)) {
337337
return (
338338
<div className='flex flex-col items-center justify-center rounded-md border border-border/40 bg-muted/20 py-8 text-center'>
339-
<svg
340-
className='mb-3 size-10 text-muted-foreground/40'
341-
fill='none'
342-
viewBox='0 0 24 24'
343-
stroke='currentColor'
344-
>
345-
<path
346-
strokeLinecap='round'
347-
strokeLinejoin='round'
348-
strokeWidth={1.5}
349-
d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'
350-
/>
351-
</svg>
339+
<FileText className='mb-3 size-10 text-muted-foreground/40' />
352340
<p className='mb-1 text-foreground text-sm'>No variable assignments defined</p>
353341
<p className='text-muted-foreground text-xs'>
354342
Add variables in the Variables panel to get started
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { SVGProps } from 'react'
2+
3+
/**
4+
* Circled stop icon for stopped activity.
5+
* @param props - SVG properties including className and accessibility attributes.
6+
* @example
7+
* import { CircleStop } from '@sim/emcn/icons'
8+
*
9+
* <CircleStop className='size-[16px] text-[var(--text-icon)]' />
10+
*/
11+
export function CircleStop(props: SVGProps<SVGSVGElement>) {
12+
return (
13+
<svg
14+
width='16'
15+
height='16'
16+
viewBox='0 0 16 16'
17+
fill='none'
18+
xmlns='http://www.w3.org/2000/svg'
19+
aria-hidden='true'
20+
{...props}
21+
>
22+
<circle cx='8' cy='8' r='6.5' stroke='currentColor' strokeWidth='1.25' />
23+
<rect x='6' y='6' width='4' height='4' rx='0.5' fill='currentColor' />
24+
</svg>
25+
)
26+
}

0 commit comments

Comments
 (0)