fix(addie): open external links in new tab from SI modal chat#4396
Draft
bokelley wants to merge 1 commit into
Draft
fix(addie): open external links in new tab from SI modal chat#4396bokelley wants to merge 1 commit into
bokelley wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4395
The main Addie chat
renderMessage()already rendered links withtarget="_blank" rel="noopener noreferrer"via a custommarked.Renderer. The Sponsored Intelligence (Brand Agent) modal had two call sites that used baremarked.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 threemarked.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:
href !== null &&guard on the marked v17+ object-shim; renderer allocation hoisted before streaming loop)renderMessageADDIE_DATA logic untouched; no behavioral regression riskNits noted but out of scope:
mailto:and root-relative/paths gettarget="_blank"(pre-existing, lower priority; file follow-up if needed)renderMessagestill usesmarked.setOptionsrather than passing options inline (functional, minor inconsistency)Session: https://claude.ai/code/session_01AQYeAjhF7D8eExajxUcFcD
Generated by Claude Code