Skip to content

fix(addie): open external links in new tab from SI modal chat#4396

Draft
bokelley wants to merge 1 commit into
mainfrom
claude/issue-4395-si-modal-links-new-tab
Draft

fix(addie): open external links in new tab from SI modal chat#4396
bokelley wants to merge 1 commit into
mainfrom
claude/issue-4395-si-modal-links-new-tab

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Closes #4395

The main Addie chat renderMessage() already rendered links with target="_blank" rel="noopener noreferrer" via a custom marked.Renderer. The Sponsored Intelligence (Brand Agent) modal had two call sites that used bare marked.parse() with no custom renderer — links from SI modal responses navigated the current tab, simultaneously wiping the brand agent conversation and the parent Addie chat.

This PR extracts the renderer setup into a shared createAdcpMarkdownRenderer() factory and wires it into all three marked.parse() call sites.

Non-breaking justification: adds target="_blank" behavior to SI modal links; existing consumers unaffected. No schema or protocol changes.

Pre-PR review:

  • code-reviewer: approved — one nit fixed (added href !== null && guard on the marked v17+ object-shim; renderer allocation hoisted before streaming loop)
  • internal-tools-strategist: approved — shared factory is the right approach; renderMessage ADDIE_DATA logic untouched; no behavioral regression risk

Nits noted but out of scope:

  • mailto: and root-relative / paths get target="_blank" (pre-existing, lower priority; file follow-up if needed)
  • renderMessage still uses marked.setOptions rather than passing options inline (functional, minor inconsistency)

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See #3121
for context.

Session: https://claude.ai/code/session_01AQYeAjhF7D8eExajxUcFcD


Generated by Claude Code

Extract createAdcpMarkdownRenderer() shared factory used by all three
marked.parse() call sites. The main Addie chat already had target="_blank";
the SI modal non-streaming and streaming paths were using bare marked.parse()
and navigated the current tab on link click, wiping both the SI session and
the parent Addie chat. Also adds null guard on the marked v17+ object-shim
branch and hoists the renderer before the SSE streaming loop.

https://claude.ai/code/session_01AQYeAjhF7D8eExajxUcFcD
@bokelley bokelley added the claude-triaged Issue has been triaged by the Claude Code triage routine. Remove to re-triage. label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-triaged Issue has been triaged by the Claude Code triage routine. Remove to re-triage.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External links should open in a new tab

2 participants