Skip to content

Commit a7ba44e

Browse files
committed
ignore banner
1 parent 6aaca4b commit a7ba44e

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

pkg/github/issues_ui.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,15 @@ const IssueWriteUIHTML = `<!DOCTYPE html>
348348
<div class="issue-card-header">
349349
<span class="issue-state-icon">●</span>
350350
<div>
351-
<a id="success-issue-link" class="issue-title-link" href="#" target="_blank">
351+
<a id="success-issue-link" class="issue-title-link" href="#" onclick="openLink(this.href); return false;">
352352
<span id="success-issue-title"></span>
353353
<span id="success-issue-number" class="issue-number"></span>
354354
</a>
355355
</div>
356356
</div>
357357
<div id="success-issue-body" class="issue-card-body"></div>
358358
<div class="issue-card-footer">
359-
<a id="success-view-link" href="#" target="_blank">View on GitHub →</a>
359+
<a id="success-view-link" href="#" onclick="openLink(this.href); return false;">View on GitHub →</a>
360360
</div>
361361
</div>
362362
</div>
@@ -441,13 +441,17 @@ const IssueWriteUIHTML = `<!DOCTYPE html>
441441
setLoading(false);
442442
443443
if (!result || !result.content) {
444-
showError('No result received');
444+
// Initial tool load - no content yet, just ignore
445445
return;
446446
}
447447
448448
const textContent = result.content.find(c => c.type === 'text');
449449
if (!textContent || !textContent.text) {
450-
showError('No content in result');
450+
return;
451+
}
452+
453+
// Ignore the initial "Ready to create an issue" message
454+
if (textContent.text.startsWith('Ready to create an issue')) {
451455
return;
452456
}
453457
@@ -585,6 +589,16 @@ const IssueWriteUIHTML = `<!DOCTYPE html>
585589
return div.innerHTML;
586590
}
587591
592+
function openLink(url) {
593+
if (!url || url === '#') return;
594+
// Try window.open first, then fall back to creating a link
595+
const opened = window.open(url, '_blank');
596+
if (!opened) {
597+
// If popup blocked, try navigation
598+
window.location.href = url;
599+
}
600+
}
601+
588602
// Listen for messages from the host
589603
window.addEventListener('message', handleMessage);
590604

0 commit comments

Comments
 (0)