fix(frontend) : copie presse-papiers fonctionnelle en HTTP via fallback execCommand
Auto Tag Develop / tag (push) Successful in 7s

navigator.clipboard n'est disponible qu'en secure context (HTTPS/localhost),
ce qui cassait la copie en prod HTTP. Ajout d'un utilitaire copyToClipboard
avec fallback textarea + execCommand, appliqué au viewer Markdown, au token
API du profil et au nom de branche Git.
This commit is contained in:
Matthieu
2026-06-01 22:52:07 +02:00
parent 85897708ec
commit e1bf9ecb22
4 changed files with 47 additions and 8 deletions
+2 -1
View File
@@ -229,6 +229,7 @@
import type { Task } from '~/services/dto/task'
import type { GiteaBranch, GiteaPullRequest } from '~/services/dto/gitea'
import { useGiteaService } from '~/services/gitea'
import { copyToClipboard } from '~/utils/clipboard'
const { t } = useI18n()
const props = defineProps<{
@@ -374,7 +375,7 @@ async function handleCreate() {
async function handleCopy() {
try {
const result = await getBranchName(props.task.id, branchForm.type)
await navigator.clipboard.writeText(result.name)
await copyToClipboard(result.name)
const { success } = useToast()
success(t('gitea.branch.copied'))
} catch {