diff options
| author | Brendan Allan <[email protected]> | 2026-03-04 16:41:20 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-04 16:41:20 +0800 |
| commit | db3eddc51f97ab58b20d3230a42591738c4d6a7b (patch) | |
| tree | cfd40133201da4f49c5bd7b1732b8ccf904025b5 | |
| parent | 5dcf3301e099f5b86b796462f82627e41b4e0188 (diff) | |
| download | opencode-db3eddc51f97ab58b20d3230a42591738c4d6a7b.tar.gz opencode-db3eddc51f97ab58b20d3230a42591738c4d6a7b.zip | |
ui: rely on task part href instead of onClick handler (#15978)
| -rw-r--r-- | packages/ui/src/components/message-part.tsx | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/packages/ui/src/components/message-part.tsx b/packages/ui/src/components/message-part.tsx index a97b38671..aecdbc8e4 100644 --- a/packages/ui/src/components/message-part.tsx +++ b/packages/ui/src/components/message-part.tsx @@ -1494,27 +1494,6 @@ ToolRegistry.register({ return `${path.slice(0, idx)}/session/${sessionId}` }) - const handleLinkClick = (e: MouseEvent) => { - const sessionId = childSessionId() - const url = href() - if (!sessionId || !url) return - - e.stopPropagation() - - if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return - - const nav = data.navigateToSession - if (!nav || typeof window === "undefined") return - - e.preventDefault() - const before = window.location.pathname + window.location.search + window.location.hash - nav(sessionId) - setTimeout(() => { - const after = window.location.pathname + window.location.search + window.location.hash - if (after === before) window.location.assign(url) - }, 50) - } - const titleContent = () => <TextShimmer text={title()} active={running()} /> const trigger = () => ( @@ -1531,7 +1510,7 @@ ToolRegistry.register({ data-slot="basic-tool-tool-subtitle" class="clickable subagent-link" href={url()} - onClick={handleLinkClick} + onClick={(e) => e.stopPropagation()} > {description()} </a> |
