diff --git a/changelog.d/fixed-tracker-copy-link.md b/changelog.d/fixed-tracker-copy-link.md new file mode 100644 index 0000000000..2679e677fd --- /dev/null +++ b/changelog.d/fixed-tracker-copy-link.md @@ -0,0 +1 @@ +- Tracker Copy link now copies the selected issue or PR's canonical URL, including PRs linked or nested under issues, instead of copying the parent issue link. diff --git a/src/pkg/dashboard/stage_tracker_copy_link_test.go b/src/pkg/dashboard/stage_tracker_copy_link_test.go new file mode 100644 index 0000000000..a879165ddb --- /dev/null +++ b/src/pkg/dashboard/stage_tracker_copy_link_test.go @@ -0,0 +1,83 @@ +package dashboard + +import "testing" + +func TestStageTrackerCopyLinkTargets(t *testing.T) { + html := indexHTML(t) + script := stageTrackerRowActionsPreamble(t, html) + "\n" + jsFunc(t, html, "stageTrackerMenuTargets") + ` +const issue = { repo: 'acme/console', kind: 'issue', number: 7, url: 'https://github.com/acme/console/issues/7', + linked_prs: [ + { number: 42, url: 'https://github.com/acme/console/pull/42', stage: 50 }, + { number: 43, url: 'https://forge.example/other/project/pull/43', stage: 50 } + ] }; +const rootPR = { repo: 'acme/console', kind: 'pr', number: 44, url: 'https://github.com/acme/console/pull/44', + linked_issues: [{ number: 7, url: issue.url }] }; +_stageTracker = { items: [issue, rootPR] }; +const root = { dataset: { hamKey: stageTrackerItemKey(issue) }, parentNode: hamPanel }; +const boundary = (key, single) => ({ dataset: single ? { hamTargetKey: key } : { hamSubKey: key }, querySelector() { return null; } }); +function eventTarget(row, sub) { + return { closest(selector) { + if (selector === '.ham-row[data-ham-key]') return row; + if (selector.includes('[data-ham-sub-key]')) return sub; + return null; + } }; +} +const writes = [], toasts = []; +const navigator = { clipboard: { async writeText(text) { writes.push(text); } } }; +global.showToast = (text, kind) => toasts.push({ text, kind }); +(async () => { + const cases = [ + [eventTarget(root, null), issue.url, 'issue'], + [eventTarget({ dataset: { hamKey: stageTrackerItemKey(rootPR) }, parentNode: hamPanel }, null), rootPR.url, 'pr'], + [eventTarget(root, boundary('acme/console/pr#42', true)), issue.linked_prs[0].url, 'pr'], + [eventTarget(root, boundary('acme/console/pr#42', false)), issue.linked_prs[0].url, 'pr'], + [eventTarget(root, boundary('other/project/pr#43', true)), issue.linked_prs[1].url, 'pr'], + [eventTarget(root, boundary('other/project/pr#43', false)), issue.linked_prs[1].url, 'pr'] + ]; + for (const [target, url, kind] of cases) { + const mapped = stageTrackerMenuTargets(target); + assert.strictEqual(mapped.items.length, 1); + assert.strictEqual(mapped.items[0].kind, kind); + await runRowAction('copy', mapped.items); + assert.strictEqual(toasts.at(-1).kind, 'success', toasts.at(-1).text); + assert.strictEqual(writes.at(-1), url, 'copy follows the exact root, single-linked or nested target'); + } + const explicit = stageTrackerLinkedPRItem(issue, { repo: 'other/project', number: 45, url: '' }); + assert.strictEqual(explicit.repo, 'other/project', 'explicit linked repo is not replaced by the parent repo'); + await runRowAction('copy', [issue, rootPR, stageTrackerItemByKey(_stageTracker, 'other/project/pr#43')]); + assert.strictEqual(writes.at(-1), [issue.url, rootPR.url, issue.linked_prs[1].url].join('\n')); + assert.strictEqual(toasts.at(-1).text, 'Copied 3 links'); + const count = writes.length; + for (const bad of [ + { ...rootPR, url: issue.url }, + { ...rootPR, url: 'https://github.com/acme/console/pull/99' }, + { ...rootPR, url: '' }, + { ...rootPR, url: 'javascript:alert(1)' }, + { ...issue, url: rootPR.url } + ]) { + await runRowAction('copy', [issue, bad]); + assert.strictEqual(writes.length, count, 'never copy a parent, wrong-kind, wrong-number or partial selection'); + assert.strictEqual(toasts.at(-1).kind, 'error'); + } + navigator.clipboard.writeText = async () => { throw new Error('denied'); }; + await runRowAction('copy', issue); + assert.strictEqual(toasts.at(-1).kind, 'error'); + assert.ok(toasts.at(-1).text.includes('denied'), 'clipboard failures use styled app feedback'); +})().catch(err => { console.error(err); process.exit(1); }); +` + runStageTrackerRowActionsScript(t, script) +} + +func TestStageTrackerSingleLinkedPRCopyBoundary(t *testing.T) { + html := indexHTML(t) + script := stageTrackerRowsPreludeJS(t, html) + stageTrackerRowsFixtureJS + ` +const issue = { repo: 'acme/console', kind: 'issue', number: 7, title: 'Issue', url: 'https://github.com/acme/console/issues/7', + stage: 40, linked_prs: [{ number: 42, title: 'PR', url: 'https://forge.example/other/project/pull/42', stage: 50 }] }; +const row = stageTrackerRowHtml(issue, stages, ctx); +assert.ok(row.includes('
  • '), 'the single covering PR cell has its own menu target without changing flex children'); +assert.ok(/data-ham-target-key="other\/project\/pr#42">[\s\S]*?href="https:\/\/forge.example\/other\/project\/pull\/42"/.test(row), 'the target surrounds the actual PR reference'); +assert.ok(row.includes('href="' + issue.url + '"'), 'the parent issue keeps its own link'); +assert.ok(row.includes('aria-label="Actions for acme/console#7"'), 'the issue kebab remains issue-targeted'); +` + runStageTrackerRowActionsScript(t, script) +} diff --git a/src/pkg/dashboard/stage_tracker_row_actions_test.go b/src/pkg/dashboard/stage_tracker_row_actions_test.go index 7f74fb0c52..de286496bf 100644 --- a/src/pkg/dashboard/stage_tracker_row_actions_test.go +++ b/src/pkg/dashboard/stage_tracker_row_actions_test.go @@ -176,6 +176,7 @@ func stageTrackerRowActionsPreamble(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerAdvisoryCloseHint"), jsFunc(t, html, "stageTrackerAdvisoryCloseMessage"), jsFunc(t, html, "stageTrackerNothingToActOn"), + jsFunc(t, html, "stageTrackerCopyLink"), jsFunc(t, html, "runRowAction"), jsFunc(t, html, "makeToastSticky"), stageTrackerDomStubJS, diff --git a/src/pkg/dashboard/stage_tracker_ui_rows_test.go b/src/pkg/dashboard/stage_tracker_ui_rows_test.go index c3383fe467..62c4268af3 100644 --- a/src/pkg/dashboard/stage_tracker_ui_rows_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_rows_test.go @@ -190,7 +190,7 @@ assert.deepStrictEqual(segStates(row), [D, D, D, 'active', T, T, 'todo cap'], 'o assert.ok(tooltip(row).includes('Covering PR: #102'), tooltip(row)); assert.deepStrictEqual(prCol(row).length, 1, 'the covering PR sits in the PR column of the title line'); assert.strictEqual(subs(row).length, 0, 'no sub-rows for a single covering PR'); -const prCell = (html) => (html.slice(0, html.indexOf('aria-label="Pipeline progress"')).match(/
  • ([\s\S]*?)<\/li>/) || [])[1] || ''; +const prCell = (html) => (html.slice(0, html.indexOf('aria-label="Pipeline progress"')).match(/
  • ]*>([\s\S]*?)<\/li>/) || [])[1] || ''; assert.ok(prCell(row).startsWith(STAGE_TRACKER_LINKED_GLYPH + '([\s\S]*?)<\/li>/) || [])[1] || ''; + const cell = (head.match(/
  • ]*>([\s\S]*?)<\/li>/) || [])[1] || ''; assert.ok(cell, 'sub-row header has one PR cell: ' + head); assert.ok(!/v5')]; diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js index 7360d32761..bf158a6544 100644 --- a/src/pkg/dashboard/static-src/js/tracker-actions.js +++ b/src/pkg/dashboard/static-src/js/tracker-actions.js @@ -777,10 +777,10 @@ // The row (or nested PR) an event happened on, as the items a menu acts // on: a selected row with company stands for the whole selection. function stageTrackerMenuTargets(target) { - const sub = target && target.closest ? target.closest('[data-ham-sub-key]') : null; + const sub = target && target.closest ? target.closest('[data-ham-sub-key], [data-ham-target-key]') : null; const row = target && target.closest ? target.closest('.ham-row[data-ham-key]') : null; if (!row && !sub) return null; - const key = sub ? sub.dataset.hamSubKey : row.dataset.hamKey; + const key = sub ? (sub.dataset.hamTargetKey || sub.dataset.hamSubKey) : row.dataset.hamKey; const list = row ? row.parentNode : sub.closest('#activity-monitor-panel'); const keys = _stageTrackerSel.has(key) && _stageTrackerSel.size > 1 && list ? stageTrackerRowKeys(list).filter(k => _stageTrackerSel.has(k)) : [key]; return { items: stageTrackerItemsForKeys(keys), restore: sub ? (sub.querySelector('.ham-kebab') || row) : row }; @@ -2307,6 +2307,14 @@ const refs = (rows || []).map(stageTrackerRefOf).filter(Boolean).join(', '); if (typeof showToast === 'function') showToast(stageTrackerActionLabel(id) + ': nothing to act on' + (refs ? ' — ' + refs + ' is not waiting on that decision' : ''), 'warning'); } + // A copy must identify the selected item, not its parent issue or a + // decision target. Keep the canonical URL (including its forge host). + function stageTrackerCopyLink(item) { + if (!item || (item.kind !== 'issue' && item.kind !== 'pr')) return ''; + const url = String(item.url || ''); + const m = /^https?:\/\/[^/]+\/[^/]+\/[^/]+\/(issues|pull)\/(\d+)(?:[?#].*)?$/.exec(url); + return m && m[1] === (item.kind === 'pr' ? 'pull' : 'issues') && Number(m[2]) === Number(item.number) && Number(item.number) > 0 ? url : ''; + } async function runRowAction(action, row) { let items = Array.isArray(row) ? row.slice() : (row ? [row] : []); const id = action; @@ -2327,10 +2335,11 @@ return { toasts: [], pending: [] }; } if (id === 'copy') { - const text = items.map(it => it.url).filter(Boolean).join('\n'); try { + const links = items.map(stageTrackerCopyLink); + if (links.some(url => !url)) throw new Error('No matching GitHub link for the selected item — refresh the tracker and try again'); if (!navigator.clipboard) throw new Error('clipboard unavailable'); - await navigator.clipboard.writeText(text); + await navigator.clipboard.writeText(links.join('\n')); showToast(items.length > 1 ? 'Copied ' + items.length + ' links' : 'Link copied', 'success'); } catch (e) { showToast('Could not copy: ' + (e && e.message ? e.message : 'clipboard unavailable'), 'error'); } return { toasts: [], pending: [] }; @@ -2513,4 +2522,3 @@ // kind → { name, bytes (ArrayBuffer), buffer (AudioBuffer|null), failed } var _stageTrackerClips = { open: null, merge: null }; var _stageTrackerSettingsReturnFocus = null; - diff --git a/src/pkg/dashboard/static-src/js/tracker-row-layout.js b/src/pkg/dashboard/static-src/js/tracker-row-layout.js index 3d5eec71ed..013b1f996a 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-layout.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-layout.js @@ -6,9 +6,9 @@ // The since column is an empty spacer here (same width as the strip // row's, which carries the time on step): a wrapped title must not float // the age away from the chevrons it describes. - function stageTrackerHeadColsHtml(prRefs, leadHtml, chipsHtml) { + function stageTrackerHeadColsHtml(prRefs, leadHtml, chipsHtml, prTargetKey) { const wide = !(prRefs && prRefs.length); - return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : `
    3. ${prRefs.join('')}
    4. `}
    5. ${chipsHtml || ''}
    `; + return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : `
    3. ${prRefs.join('')}
    4. `}
    5. ${chipsHtml || ''}
    `; } function stageTrackerSinceHtml(item, nowMs) { @@ -59,7 +59,8 @@ // PRs under it (the superseded-by prompt pre-fills the one sibling). function stageTrackerLinkedPRItem(issue, lp) { const open = Array.isArray(issue.linked_prs) ? issue.linked_prs.filter(x => x && x.number !== lp.number && stageTrackerLinkedPROpen(x, issue)) : []; - return { repo: issue.repo, number: lp.number, kind: 'pr', title: lp.title || '', url: lp.url || '', author: lp.author || '', author_kind: lp.author_kind || '', + const canonical = /^https?:\/\/[^/]+\/([^/]+\/[^/]+)\/pull\/\d+(?:[?#].*)?$/.exec(String(lp.url || '')); + return { repo: canonical ? canonical[1] : (lp.repo || issue.repo), number: lp.number, kind: 'pr', title: lp.title || '', url: lp.url || '', author: lp.author || '', author_kind: lp.author_kind || '', stage: lp.stage || 0, stage_since: lp.stage_since || '', stage_slug: lp.stage_slug || '', modifiers: lp.modifiers || [], deferred_modifiers: lp.deferred_modifiers || [], caption: lp.caption || '', reason: lp.reason || '', preparation: lp.preparation || null, human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', head: lp.head || '', base_ref: lp.base_ref || '', decision_needed: lp.decision_needed || null, adoption: lp.adoption || null, takeover: lp.takeover || null, superseded: !!lp.superseded, supersedes: lp.supersedes || null, parent: Number(issue.number) || 0, siblings: open.map(x => Number(x.number) || 0), @@ -475,12 +476,14 @@ const nowMs = Number(ctx.nowMs) || Date.now(); const isIssue = item.kind === 'issue'; const title = item.title || ''; - let prRefs = [], shown = item, range = null, subs = '', subRows = null; + let prRefs = [], shown = item, range = null, subs = '', subRows = null, prTargetKey = ''; if (isIssue) { const linked = stageTrackerLinkedSorted(item, stages); if (linked.length === 1) { // One covering PR: a single entry whose strip the PR's stage drives. const lp = linked[0]; + const pr = stageTrackerLinkedPRItem(item, lp); + prTargetKey = stageTrackerItemKey(pr); const who = (lp.author_kind || 'hive') + (lp.author ? ' · @' + lp.author : ''); const lineage = (lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(lp, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(lp, nowMs) : ''); prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRPillsHtml(stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)), typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null), lp.base_ref)]; @@ -540,7 +543,7 @@ ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(item, stages, ctx) : ''} ${stageTrackerRowToolsHtml(item)}
    - ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : ''))} + ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : ''), prTargetKey)}
      ${stageTrackerStripItems(shown, stages, range, nowMs, ctx)}
    diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 51a950591b..a97841d9d5 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -17616,9 +17616,9 @@

    Where to get help

    // The since column is an empty spacer here (same width as the strip // row's, which carries the time on step): a wrapped title must not float // the age away from the chevrons it describes. - function stageTrackerHeadColsHtml(prRefs, leadHtml, chipsHtml) { + function stageTrackerHeadColsHtml(prRefs, leadHtml, chipsHtml, prTargetKey) { const wide = !(prRefs && prRefs.length); - return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : `
    3. ${prRefs.join('')}
    4. `}
    5. ${chipsHtml || ''}
    `; + return `
    1. ${leadHtml || ''}
    2. ${wide ? '' : `
    3. ${prRefs.join('')}
    4. `}
    5. ${chipsHtml || ''}
    `; } function stageTrackerSinceHtml(item, nowMs) { @@ -17669,7 +17669,8 @@

    Where to get help

    // PRs under it (the superseded-by prompt pre-fills the one sibling). function stageTrackerLinkedPRItem(issue, lp) { const open = Array.isArray(issue.linked_prs) ? issue.linked_prs.filter(x => x && x.number !== lp.number && stageTrackerLinkedPROpen(x, issue)) : []; - return { repo: issue.repo, number: lp.number, kind: 'pr', title: lp.title || '', url: lp.url || '', author: lp.author || '', author_kind: lp.author_kind || '', + const canonical = /^https?:\/\/[^/]+\/([^/]+\/[^/]+)\/pull\/\d+(?:[?#].*)?$/.exec(String(lp.url || '')); + return { repo: canonical ? canonical[1] : (lp.repo || issue.repo), number: lp.number, kind: 'pr', title: lp.title || '', url: lp.url || '', author: lp.author || '', author_kind: lp.author_kind || '', stage: lp.stage || 0, stage_since: lp.stage_since || '', stage_slug: lp.stage_slug || '', modifiers: lp.modifiers || [], deferred_modifiers: lp.deferred_modifiers || [], caption: lp.caption || '', reason: lp.reason || '', preparation: lp.preparation || null, human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', head: lp.head || '', base_ref: lp.base_ref || '', decision_needed: lp.decision_needed || null, adoption: lp.adoption || null, takeover: lp.takeover || null, superseded: !!lp.superseded, supersedes: lp.supersedes || null, parent: Number(issue.number) || 0, siblings: open.map(x => Number(x.number) || 0), @@ -18085,12 +18086,14 @@

    Where to get help

    const nowMs = Number(ctx.nowMs) || Date.now(); const isIssue = item.kind === 'issue'; const title = item.title || ''; - let prRefs = [], shown = item, range = null, subs = '', subRows = null; + let prRefs = [], shown = item, range = null, subs = '', subRows = null, prTargetKey = ''; if (isIssue) { const linked = stageTrackerLinkedSorted(item, stages); if (linked.length === 1) { // One covering PR: a single entry whose strip the PR's stage drives. const lp = linked[0]; + const pr = stageTrackerLinkedPRItem(item, lp); + prTargetKey = stageTrackerItemKey(pr); const who = (lp.author_kind || 'hive') + (lp.author ? ' · @' + lp.author : ''); const lineage = (lp.lineage && typeof stageTrackerLineageChipHtml === 'function' ? stageTrackerLineageChipHtml(lp, nowMs) : '') || (typeof stageTrackerAdoptedFromChipHtml === 'function' ? stageTrackerAdoptedFromChipHtml(lp, nowMs) : ''); prRefs = [STAGE_TRACKER_LINKED_GLYPH + stageTrackerPRPillsHtml(stageTrackerPRRef(lp.number, lp.url, lp.author_kind || '', lp.author, lp.title, (lp.title ? lp.title + '\n' : '') + 'Author: ' + who + ' · ' + stageTrackerLinkedTip(item, lp.number, ctx)), typeof stageTrackerLinkedChipsHtml === 'function' ? stageTrackerLinkedChipsHtml(lp, lineage) : (lineage || null), lp.base_ref)]; @@ -18150,7 +18153,7 @@

    Where to get help

    ${typeof stageTrackerPreparationNodeHtml === 'function' ? stageTrackerPreparationNodeHtml(item, stages, ctx) : ''} ${stageTrackerRowToolsHtml(item)}
    - ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : ''))} + ${stageTrackerHeadColsHtml(prRefs, leadHtml, stageTrackerActedBadgeHtml(item, nowMs) + stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : ''), prTargetKey)}
      ${stageTrackerStripItems(shown, stages, range, nowMs, ctx)}
    @@ -21220,10 +21223,10 @@

    All labels

    // The row (or nested PR) an event happened on, as the items a menu acts // on: a selected row with company stands for the whole selection. function stageTrackerMenuTargets(target) { - const sub = target && target.closest ? target.closest('[data-ham-sub-key]') : null; + const sub = target && target.closest ? target.closest('[data-ham-sub-key], [data-ham-target-key]') : null; const row = target && target.closest ? target.closest('.ham-row[data-ham-key]') : null; if (!row && !sub) return null; - const key = sub ? sub.dataset.hamSubKey : row.dataset.hamKey; + const key = sub ? (sub.dataset.hamTargetKey || sub.dataset.hamSubKey) : row.dataset.hamKey; const list = row ? row.parentNode : sub.closest('#activity-monitor-panel'); const keys = _stageTrackerSel.has(key) && _stageTrackerSel.size > 1 && list ? stageTrackerRowKeys(list).filter(k => _stageTrackerSel.has(k)) : [key]; return { items: stageTrackerItemsForKeys(keys), restore: sub ? (sub.querySelector('.ham-kebab') || row) : row }; @@ -22750,6 +22753,14 @@

    All labels

    const refs = (rows || []).map(stageTrackerRefOf).filter(Boolean).join(', '); if (typeof showToast === 'function') showToast(stageTrackerActionLabel(id) + ': nothing to act on' + (refs ? ' — ' + refs + ' is not waiting on that decision' : ''), 'warning'); } + // A copy must identify the selected item, not its parent issue or a + // decision target. Keep the canonical URL (including its forge host). + function stageTrackerCopyLink(item) { + if (!item || (item.kind !== 'issue' && item.kind !== 'pr')) return ''; + const url = String(item.url || ''); + const m = /^https?:\/\/[^/]+\/[^/]+\/[^/]+\/(issues|pull)\/(\d+)(?:[?#].*)?$/.exec(url); + return m && m[1] === (item.kind === 'pr' ? 'pull' : 'issues') && Number(m[2]) === Number(item.number) && Number(item.number) > 0 ? url : ''; + } async function runRowAction(action, row) { let items = Array.isArray(row) ? row.slice() : (row ? [row] : []); const id = action; @@ -22770,10 +22781,11 @@

    All labels

    return { toasts: [], pending: [] }; } if (id === 'copy') { - const text = items.map(it => it.url).filter(Boolean).join('\n'); try { + const links = items.map(stageTrackerCopyLink); + if (links.some(url => !url)) throw new Error('No matching GitHub link for the selected item — refresh the tracker and try again'); if (!navigator.clipboard) throw new Error('clipboard unavailable'); - await navigator.clipboard.writeText(text); + await navigator.clipboard.writeText(links.join('\n')); showToast(items.length > 1 ? 'Copied ' + items.length + ' links' : 'Link copied', 'success'); } catch (e) { showToast('Could not copy: ' + (e && e.message ? e.message : 'clipboard unavailable'), 'error'); } return { toasts: [], pending: [] }; @@ -22956,7 +22968,6 @@

    All labels

    // kind → { name, bytes (ArrayBuffer), buffer (AudioBuffer|null), failed } var _stageTrackerClips = { open: null, merge: null }; var _stageTrackerSettingsReturnFocus = null; - function stageTrackerPRKey(repo, number) { return (repo || '') + '/pr#' + (Number(number) || 0); } function stageTrackerItemKey(it) { return (it.repo || '') + '/' + (it.kind || '') + '#' + (Number(it.number) || 0); }