Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

feat(web): add issue copy submenu (#451)

I'm Groot 🌳7cbaa78672b5
diff --git a/apps/web/messages/ar/issue.json b/apps/web/messages/ar/issue.json
index 49bccc88..0a95ec51 100644
--- a/apps/web/messages/ar/issue.json
+++ b/apps/web/messages/ar/issue.json
@@ -50,6 +50,12 @@
"dueDate": "تاريخ الاستحقاق",
"clearDueDate": "مسح تاريخ الاستحقاق",
"labels": "الوسوم",
+ "copyId": "نسخ المعرّف",
+ "copyShortLink": "نسخ الرابط المختصر",
+ "copyFullUrl": "نسخ الرابط الكامل",
+ "copyTitle": "نسخ العنوان",
+ "copyDescription": "نسخ الوصف",
+ "copyBranch": "نسخ اسم الفرع",
"copyPrompt": "نسخ التوجيه",
"restore": "استعادة",
"archive": "أرشفة",
@@ -57,6 +63,7 @@
"noDelegate": "بلا مفوَّض",
"noInitiative": "بلا مبادرة",
"noCycle": "بلا دورة",
+ "copyFailed": "تعذّر النسخ إلى الحافظة",
"promptCopied": "تم نسخ التوجيه إلى الحافظة"
},
"commands": {
diff --git a/apps/web/messages/en/issue.json b/apps/web/messages/en/issue.json
index 2265077d..4ef0043c 100644
--- a/apps/web/messages/en/issue.json
+++ b/apps/web/messages/en/issue.json
@@ -50,6 +50,12 @@
"dueDate": "Due date",
"clearDueDate": "Clear due date",
"labels": "Labels",
+ "copyId": "Copy ID",
+ "copyShortLink": "Copy short link",
+ "copyFullUrl": "Copy full URL",
+ "copyTitle": "Copy title",
+ "copyDescription": "Copy description",
+ "copyBranch": "Copy branch name",
"copyPrompt": "Copy Prompt",
"restore": "Restore",
"archive": "Archive",
@@ -57,6 +63,7 @@
"noDelegate": "No delegate",
"noInitiative": "No initiative",
"noCycle": "No cycle",
+ "copyFailed": "Could not copy to clipboard",
"promptCopied": "Prompt copied to clipboard"
},
"commands": {
diff --git a/apps/web/messages/es-ES/issue.json b/apps/web/messages/es-ES/issue.json
index 7057fc6d..88667215 100644
--- a/apps/web/messages/es-ES/issue.json
+++ b/apps/web/messages/es-ES/issue.json
@@ -50,6 +50,12 @@
"dueDate": "Fecha de vencimiento",
"clearDueDate": "Vaciar la fecha de vencimiento",
"labels": "Etiquetas",
+ "copyId": "Copiar ID",
+ "copyShortLink": "Copiar enlace corto",
+ "copyFullUrl": "Copiar URL completa",
+ "copyTitle": "Copiar título",
+ "copyDescription": "Copiar descripción",
+ "copyBranch": "Copiar nombre de rama",
"copyPrompt": "Copiar la consigna",
"restore": "Restaurar",
"archive": "Archivar",
@@ -57,6 +63,7 @@
"noDelegate": "Sin delegado",
"noInitiative": "Sin iniciitiva",
"noCycle": "Sin ciclo",
+ "copyFailed": "No se pudo copiar al portapapeles",
"promptCopied": "La consigna se ha copiado al portapapeles"
},
"commands": {
diff --git a/apps/web/messages/fr/issue.json b/apps/web/messages/fr/issue.json
index 246406de..11395d5f 100644
--- a/apps/web/messages/fr/issue.json
+++ b/apps/web/messages/fr/issue.json
@@ -50,6 +50,12 @@
"dueDate": "Échéance",
"clearDueDate": "Effacer l'échéance",
"labels": "Étiquettes",
+ "copyId": "Copier l’identifiant",
+ "copyShortLink": "Copier le lien court",
+ "copyFullUrl": "Copier l’URL complète",
+ "copyTitle": "Copier le titre",
+ "copyDescription": "Copier la description",
+ "copyBranch": "Copier le nom de branche",
"copyPrompt": "Copier le prompt",
"restore": "Restaurer",
"archive": "Archiver",
@@ -57,6 +63,7 @@
"noDelegate": "Aucun délégué",
"noInitiative": "Aucune initiative",
"noCycle": "Aucun cycle",
+ "copyFailed": "Impossible de copier dans le presse-papiers",
"promptCopied": "Prompt copié dans le presse-papiers"
},
"commands": {
diff --git a/apps/web/messages/id/issue.json b/apps/web/messages/id/issue.json
index 6a670d4d..a838c5b4 100644
--- a/apps/web/messages/id/issue.json
+++ b/apps/web/messages/id/issue.json
@@ -50,6 +50,12 @@
"dueDate": "Tenggat waktu",
"clearDueDate": "Hapus tenggat waktu",
"labels": "Label",
+ "copyId": "Salin ID",
+ "copyShortLink": "Salin tautan pendek",
+ "copyFullUrl": "Salin URL lengkap",
+ "copyTitle": "Salin judul",
+ "copyDescription": "Salin deskripsi",
+ "copyBranch": "Salin nama branch",
"copyPrompt": "Salin prompt",
"restore": "Pulihkan",
"archive": "Arsipkan",
@@ -57,6 +63,7 @@
"noDelegate": "Tanpa delegasi",
"noInitiative": "Tanpa inisiatif",
"noCycle": "Tanpa cycle",
+ "copyFailed": "Gagal menyalin ke papan klip",
"promptCopied": "Prompt disalin ke papan klip"
},
"commands": {
diff --git a/apps/web/messages/pt-BR/issue.json b/apps/web/messages/pt-BR/issue.json
index 5b4c0cd5..ce4f9a39 100644
--- a/apps/web/messages/pt-BR/issue.json
+++ b/apps/web/messages/pt-BR/issue.json
@@ -50,6 +50,12 @@
"dueDate": "Data de vencimento",
"clearDueDate": "Limpar data de vencimento",
"labels": "Etiquetas",
+ "copyId": "Copiar ID",
+ "copyShortLink": "Copiar link curto",
+ "copyFullUrl": "Copiar URL completa",
+ "copyTitle": "Copiar título",
+ "copyDescription": "Copiar descrição",
+ "copyBranch": "Copiar nome da branch",
"copyPrompt": "Copiar prompt",
"restore": "Restaurar",
"archive": "Arquivar",
@@ -57,6 +63,7 @@
"noDelegate": "Sem delegado",
"noInitiative": "Sem iniciativa",
"noCycle": "Sem ciclo",
+ "copyFailed": "Não foi possível copiar",
"promptCopied": "Prompt copiado para a área de transferência"
},
"commands": {
diff --git a/apps/web/messages/ru/issue.json b/apps/web/messages/ru/issue.json
index e158f7d5..9f3250ae 100644
--- a/apps/web/messages/ru/issue.json
+++ b/apps/web/messages/ru/issue.json
@@ -50,6 +50,12 @@
"dueDate": "Дедлайн",
"clearDueDate": "Убрать дедлайн",
"labels": "Метки",
+ "copyId": "Скопировать ID",
+ "copyShortLink": "Скопировать короткую ссылку",
+ "copyFullUrl": "Скопировать полную ссылку",
+ "copyTitle": "Скопировать название",
+ "copyDescription": "Скопировать описание",
+ "copyBranch": "Скопировать имя ветки",
"copyPrompt": "Скопировать промпт",
"restore": "Восстановить",
"archive": "Архивировать",
@@ -57,6 +63,7 @@
"noDelegate": "Без делегата",
"noInitiative": "Без инициативы",
"noCycle": "Без цикла",
+ "copyFailed": "Не удалось скопировать",
"promptCopied": "Промпт скопирован"
},
"commands": {
diff --git a/apps/web/messages/uk/issue.json b/apps/web/messages/uk/issue.json
index 1dc197ec..329f20cf 100644
--- a/apps/web/messages/uk/issue.json
+++ b/apps/web/messages/uk/issue.json
@@ -50,6 +50,12 @@
"dueDate": "Дедлайн",
"clearDueDate": "Прибрати дедлайн",
"labels": "Мітки",
+ "copyId": "Скопіювати ID",
+ "copyShortLink": "Скопіювати коротке посилання",
+ "copyFullUrl": "Скопіювати повне посилання",
+ "copyTitle": "Скопіювати назву",
+ "copyDescription": "Скопіювати опис",
+ "copyBranch": "Скопіювати назву гілки",
"copyPrompt": "Скопіювати промпт",
"restore": "Відновити",
"archive": "Архівувати",
@@ -57,6 +63,7 @@
"noDelegate": "Без делегата",
"noInitiative": "Без ініціативи",
"noCycle": "Без циклу",
+ "copyFailed": "Не вдалося скопіювати",
"promptCopied": "Промпт скопійовано"
},
"commands": {
diff --git a/apps/web/messages/zh-CN/issue.json b/apps/web/messages/zh-CN/issue.json
index 22d0086d..8114660d 100644
--- a/apps/web/messages/zh-CN/issue.json
+++ b/apps/web/messages/zh-CN/issue.json
@@ -50,6 +50,12 @@
"dueDate": "截止日期",
"clearDueDate": "清除截止日期",
"labels": "标签",
+ "copyId": "复制 ID",
+ "copyShortLink": "复制短链接",
+ "copyFullUrl": "复制完整网址",
+ "copyTitle": "复制标题",
+ "copyDescription": "复制描述",
+ "copyBranch": "复制分支名称",
"copyPrompt": "复制提示词",
"restore": "恢复",
"archive": "归档",
@@ -57,6 +63,7 @@
"noDelegate": "无执行代理",
"noInitiative": "无计划",
"noCycle": "无周期",
+ "copyFailed": "无法复制到剪贴板",
"promptCopied": "提示词已复制到剪贴板"
},
"commands": {
diff --git a/apps/web/src/features/issue/components/actions/IssueContextMenu.tsx b/apps/web/src/features/issue/components/actions/IssueContextMenu.tsx
index f170f955..0c71adc1 100644
--- a/apps/web/src/features/issue/components/actions/IssueContextMenu.tsx
+++ b/apps/web/src/features/issue/components/actions/IssueContextMenu.tsx
@@ -20,7 +20,7 @@ import {
} from 'lucide-react';
import type { ActionDef } from '@/lib/api/endpoints/actions';
import type { ProjectDetail } from '@/lib/api/endpoints/projects';
-import type { Issue, IssuePatch } from '@/lib/api/endpoints/issues';
+import { getIssue, type Issue, type IssuePatch } from '@/lib/api/endpoints/issues';
import { actionIcon } from '@/utils/actionIcons';
import { useActionsQuery } from '@/services/actions.service';
import { useRestoreIssue, useUpdateIssue } from '@/services/issues.service';
@@ -32,7 +32,7 @@ import { usePriorityLabel } from '@/hooks/usePriorityLabel';
import { ShellCtx } from '@/context/shellContext';
import { useArchiveAction } from '../../hooks/useArchiveAction';
import { ApplyActionDialog, DeleteIssueDialog, matchedActions } from './IssueActions';
-import { buildIssuePrompt } from '../../utils/issuePrompt';
+import { buildIssueBranchName, buildIssuePrompt } from '../../utils/issuePrompt';
import { delegatableAgents } from '../../utils/delegates';
import { useSession } from '@/lib/auth-client';
import { toDateStr } from '@/utils/dates';
@@ -41,6 +41,7 @@ import { PRIORITY_FIELDS } from '@/components/common/fields/priorityFields';
import { StateIcon } from '../shared/IssueIcons';
import { dueDatePresets } from '../../utils/dueDatePresets';
import { useDueDatePresetLabel } from '../../hooks/useDueDatePresetLabel';
+import { issuePath } from '@/utils/paths';
import {
ContextMenu,
ContextMenuContent,
@@ -58,12 +59,6 @@ function SelectedCheck({ selected }: { selected: boolean }) {
return selected ? <Check className="ml-auto size-4" /> : null;
}
-// Wraps a issue card/row (any single element) so a right-click opens a context
-// menu that changes its status, priority, assignee, initiative, cycle, labels or
-// due date, or deletes it. Shared by every project view (Kanban, Table, Calendar, Timeline).
-// onDeleted lets a host that is showing this one issue (the detail panel/page)
-// leave after deletion; the project views leave it unset — the card just
-// disappears when the project cache updates.
export default function IssueContextMenu({
project,
issue,
@@ -92,6 +87,7 @@ export default function IssueContextMenu({
const priorityLabel = usePriorityLabel();
const presetLabel = useDueDatePresetLabel();
const [open, setOpen] = useState(false);
+ const [copyIssue, setCopyIssue] = useState<Issue | null>(null);
const [confirmingDelete, setConfirmingDelete] = useState(false);
const [confirmingAction, setConfirmingAction] = useState<ActionDef | null>(null);
// Initiatives are not in the board scaffold, so they are fetched here — only
@@ -117,11 +113,28 @@ export default function IssueContextMenu({
patch({ labelIds: next });
}
- async function copyPrompt() {
- await navigator.clipboard.writeText(buildIssuePrompt(issue, project, session?.user));
- toast.success(t('promptCopied'));
+ async function copyText(value: string) {
+ try {
+ await navigator.clipboard.writeText(value);
+ toast.success(tCommon('copied'));
+ } catch {
+ toast.error(t('copyFailed'));
+ }
}
+ function openCopySubmenu(next: boolean) {
+ if (!next) return;
+ setCopyIssue(null);
+ // Fetch while the submenu opens so the clipboard write stays in the selection gesture.
+ void getIssue(issue.id)
+ .then(setCopyIssue)
+ .catch(() => toast.error(t('copyFailed')));
+ }
+
+ const copyShortLink = () => copyText(`${window.location.origin}/${issue.identifier}`);
+ const copyFullUrl = () =>
+ copyText(`${window.location.origin}${issuePath(project.project.ref, issue.sequenceNumber)}`);
+
const currentColumn = project.columns.find((c) => c.id === issue.columnId);
const currentPriority =
PRIORITY_FIELDS.find((p) => p.value === (issue.priority ?? '')) ?? PRIORITY_FIELDS[0];
@@ -368,12 +381,40 @@ export default function IssueContextMenu({
{canEdit && <ContextMenuSeparator />}
- {/* Copy the issue as a Markdown prompt for an AI coding agent. Available
- to everyone — it only reads the issue, so no permission gate. */}
- <ContextMenuItem onSelect={copyPrompt}>
- <ClipboardCopy />
- {t('copyPrompt')}
- </ContextMenuItem>
+ <ContextMenuSub onOpenChange={openCopySubmenu}>
+ <ContextMenuSubTrigger>
+ <ClipboardCopy />
+ {tCommon('copy')}
+ </ContextMenuSubTrigger>
+ <ContextMenuSubContent className="w-52">
+ <ContextMenuItem onSelect={() => copyText(issue.identifier)}>
+ {t('copyId')}
+ </ContextMenuItem>
+ <ContextMenuItem onSelect={copyShortLink}>{t('copyShortLink')}</ContextMenuItem>
+ <ContextMenuItem onSelect={copyFullUrl}>{t('copyFullUrl')}</ContextMenuItem>
+ <ContextMenuItem onSelect={() => copyText(issue.title)}>
+ {t('copyTitle')}
+ </ContextMenuItem>
+ <ContextMenuItem
+ disabled={!copyIssue}
+ onSelect={() => copyText(copyIssue!.description)}
+ >
+ {t('copyDescription')}
+ </ContextMenuItem>
+ <ContextMenuItem
+ onSelect={() => copyText(buildIssueBranchName(issue, session?.user))}
+ >
+ {t('copyBranch')}
+ </ContextMenuItem>
+ <ContextMenuSeparator />
+ <ContextMenuItem
+ disabled={!copyIssue}
+ onSelect={() => copyText(buildIssuePrompt(copyIssue!, project, session?.user))}
+ >
+ {t('copyPrompt')}
+ </ContextMenuItem>
+ </ContextMenuSubContent>
+ </ContextMenuSub>
{canEdit && <ContextMenuSeparator />}