Skip to content

Commit 04d8dbe

Browse files
committed
updated A2A copy button and MCP location, and default description matching
1 parent 953ee6a commit 04d8dbe

File tree

2 files changed

+36
-29
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components

2 files changed

+36
-29
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/a2a/a2a.tsx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ function isDefaultDescription(desc: string | null | undefined, workflowName: str
5252
if (!desc) return true
5353
const normalized = desc.toLowerCase().trim()
5454
return (
55-
normalized === '' || normalized === 'new workflow' || normalized === workflowName.toLowerCase()
55+
normalized === '' ||
56+
normalized === 'new workflow' ||
57+
normalized === 'your first workflow - start building here!' ||
58+
normalized === workflowName.toLowerCase()
5659
)
5760
}
5861

@@ -685,9 +688,31 @@ console.log(data);`
685688
{/* Endpoint URL (shown when agent exists) */}
686689
{existingAgent && endpoint && (
687690
<div>
688-
<Label className='mb-[6.5px] block pl-[2px] font-medium text-[13px] text-[var(--text-primary)]'>
689-
URL
690-
</Label>
691+
<div className='mb-[6.5px] flex items-center justify-between'>
692+
<Label className='block pl-[2px] font-medium text-[13px] text-[var(--text-primary)]'>
693+
URL
694+
</Label>
695+
<Tooltip.Root>
696+
<Tooltip.Trigger asChild>
697+
<Button
698+
type='button'
699+
variant='ghost'
700+
onClick={() => {
701+
navigator.clipboard.writeText(endpoint)
702+
setUrlCopied(true)
703+
setTimeout(() => setUrlCopied(false), 2000)
704+
}}
705+
aria-label='Copy URL'
706+
className='!p-1.5 -my-1.5'
707+
>
708+
{urlCopied ? <Check className='h-3 w-3' /> : <Clipboard className='h-3 w-3' />}
709+
</Button>
710+
</Tooltip.Trigger>
711+
<Tooltip.Content>
712+
<span>{urlCopied ? 'Copied' : 'Copy'}</span>
713+
</Tooltip.Content>
714+
</Tooltip.Root>
715+
</div>
691716
<div className='relative flex items-stretch overflow-hidden rounded-[4px] border border-[var(--border-1)]'>
692717
<div className='flex items-center whitespace-nowrap bg-[var(--surface-5)] pr-[6px] pl-[8px] font-medium text-[var(--text-secondary)] text-sm dark:bg-[var(--surface-5)]'>
693718
{baseUrl.replace(/^https?:\/\//, '')}/api/a2a/serve/
@@ -696,30 +721,8 @@ console.log(data);`
696721
<Input
697722
value={existingAgent.id}
698723
readOnly
699-
className='rounded-none border-0 pr-[32px] pl-0 text-[var(--text-tertiary)] shadow-none'
724+
className='rounded-none border-0 pl-0 text-[var(--text-tertiary)] shadow-none'
700725
/>
701-
<Tooltip.Root>
702-
<Tooltip.Trigger asChild>
703-
<button
704-
type='button'
705-
onClick={() => {
706-
navigator.clipboard.writeText(endpoint)
707-
setUrlCopied(true)
708-
setTimeout(() => setUrlCopied(false), 2000)
709-
}}
710-
className='-translate-y-1/2 absolute top-1/2 right-2'
711-
>
712-
{urlCopied ? (
713-
<Check className='h-3 w-3 text-[var(--brand-tertiary-2)]' />
714-
) : (
715-
<Clipboard className='h-3 w-3 text-[var(--text-tertiary)]' />
716-
)}
717-
</button>
718-
</Tooltip.Trigger>
719-
<Tooltip.Content>
720-
<span>{urlCopied ? 'Copied' : 'Copy'}</span>
721-
</Tooltip.Content>
722-
</Tooltip.Root>
723726
</div>
724727
</div>
725728
<p className='mt-[6.5px] text-[11px] text-[var(--text-secondary)]'>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/mcp/mcp.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ export function McpDeploy({
138138

139139
const [toolName, setToolName] = useState(() => sanitizeToolName(workflowName))
140140
const [toolDescription, setToolDescription] = useState(() => {
141+
const normalizedDesc = workflowDescription?.toLowerCase().trim()
141142
const isDefaultDescription =
142143
!workflowDescription ||
143144
workflowDescription === workflowName ||
144-
workflowDescription.toLowerCase() === 'new workflow'
145+
normalizedDesc === 'new workflow' ||
146+
normalizedDesc === 'your first workflow - start building here!'
145147

146148
return isDefaultDescription ? '' : workflowDescription
147149
})
@@ -193,10 +195,12 @@ export function McpDeploy({
193195
setToolName(toolInfo.tool.toolName)
194196

195197
const loadedDescription = toolInfo.tool.toolDescription || ''
198+
const normalizedLoadedDesc = loadedDescription.toLowerCase().trim()
196199
const isDefaultDescription =
197200
!loadedDescription ||
198201
loadedDescription === workflowName ||
199-
loadedDescription.toLowerCase() === 'new workflow'
202+
normalizedLoadedDesc === 'new workflow' ||
203+
normalizedLoadedDesc === 'your first workflow - start building here!'
200204
setToolDescription(isDefaultDescription ? '' : loadedDescription)
201205

202206
const schema = toolInfo.tool.parameterSchema as Record<string, unknown> | undefined

0 commit comments

Comments
 (0)