mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 01:51:21 +08:00
fix(ui): open Exa search result links via openUrl in VS Code webview
ExaOutput links used target="_blank" with only stopPropagation, which doesn't work in VS Code webviews. Apply the same openUrl pattern already used by WebfetchMeta so links route through vscode.env.openExternal.
This commit is contained in:
@@ -669,6 +669,15 @@ function isContextGroupTool(part: PartType): part is ToolPart {
|
||||
|
||||
function ExaOutput(props: { output?: string }) {
|
||||
const links = createMemo(() => urls(props.output))
|
||||
const data = useData()
|
||||
|
||||
const open = (url: string, event: MouseEvent) => {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
const handler = data.openUrl
|
||||
if (handler) return handler(url)
|
||||
window.open(url, "_blank", "noopener,noreferrer")
|
||||
}
|
||||
|
||||
return (
|
||||
<Show when={links().length > 0}>
|
||||
@@ -676,13 +685,7 @@ function ExaOutput(props: { output?: string }) {
|
||||
<div data-slot="exa-tool-links">
|
||||
<For each={links()}>
|
||||
{(url) => (
|
||||
<a
|
||||
data-slot="exa-tool-link"
|
||||
href={url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
>
|
||||
<a data-slot="exa-tool-link" href={url} target="_blank" rel="noopener noreferrer" onClick={[open, url]}>
|
||||
{url}
|
||||
</a>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user