Files
ComfyUI_frontend/src/platform/workflow/sharing/components/ShareUrlCopyField.vue
Robin Huang e89a0f96cd feat: track app mode entry and shared workflow loading (#9720)
## Summary

- Track entering app mode from template URL (`source: template_url`) and
default view dialog (`source: default_view_dialog`)
- Tag shared workflow loads with `openSource: 'shared'` instead of
defaulting to `'unknown'`
- Rename telemetry event from `app:toggle_linear_mode` to
`app:app_mode_opened`

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9720-feat-track-app-mode-entry-and-shared-workflow-loading-31f6d73d365081af8c6ae3247a50cf3f)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:05:19 -07:00

50 lines
1.3 KiB
Vue

<template>
<div class="flex items-center gap-2">
<Input
readonly
:model-value="url"
:aria-label="$t('shareWorkflow.shareUrlLabel')"
class="flex-1"
@focus="($event.target as HTMLInputElement).select()"
/>
<Button
variant="secondary"
size="lg"
class="font-normal"
@click="handleCopy"
>
{{
copied ? $t('shareWorkflow.linkCopied') : $t('shareWorkflow.copyLink')
}}
<i class="icon-[lucide--link] size-3.5" aria-hidden="true" />
</Button>
</div>
</template>
<script setup lang="ts">
import { refAutoReset } from '@vueuse/core'
import Button from '@/components/ui/button/Button.vue'
import Input from '@/components/ui/input/Input.vue'
import { useAppMode } from '@/composables/useAppMode'
import { useCopyToClipboard } from '@/composables/useCopyToClipboard'
import { useTelemetry } from '@/platform/telemetry'
const { url } = defineProps<{
url: string
}>()
const { copyToClipboard } = useCopyToClipboard()
const { isAppMode } = useAppMode()
const copied = refAutoReset(false, 2000)
async function handleCopy() {
await copyToClipboard(url)
copied.value = true
useTelemetry()?.trackShareFlow({
step: 'link_copied',
source: isAppMode.value ? 'app_mode' : 'graph_mode'
})
}
</script>