Skip to content

[desktop] fix: 修复超链接中键点击硬控 GUI (#3505)#3564

Merged
esengine merged 1 commit into
esengine:main-v2from
Li-Charles-One:fix/hyperlink-auxclick
Jun 8, 2026
Merged

[desktop] fix: 修复超链接中键点击硬控 GUI (#3505)#3564
esengine merged 1 commit into
esengine:main-v2from
Li-Charles-One:fix/hyperlink-auxclick

Conversation

@Li-Charles-One

Copy link
Copy Markdown
Contributor

修复内容

修复 AI 回复中的超链接被鼠标中键点击时,会导致整个 webview 被导航走(界面硬控)的问题。

根因

\Markdown.tsx\ 中的 <a>\ 组件只处理了 \onClick\ 事件,但鼠标中键触发的是 \�uxclick\ 事件,未被拦截,导致浏览器默认行为执行(在 webview 中直接导航)。

修复方案

  • 添加 \onAuxClick\ 处理,拦截中键点击并通过 \openExternal()\ 在系统浏览器打开
  • 添加 \onMouseDown\ 阻止中键默认行为(兼容某些边缘情况)

测试


  • pm run typecheck\ 通过

  • pm run check:css\ 通过

Fixes #3505

Add onAuxClick and onMouseDown handlers to <a> in Markdown component
to intercept middle-click events and open links via openExternal()
instead of allowing default browser navigation behavior.
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 8, 2026

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified typecheck; onAuxClick + middle-click preventDefault is the correct fix for the webview freeze (#3505).

@esengine esengine merged commit 91eac0a into esengine:main-v2 Jun 8, 2026
10 checks passed
@Li-Charles-One Li-Charles-One deleted the fix/hyperlink-auxclick branch June 8, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 如果AI的回复中带有超链接地址,则界面会被硬控(GUI)

2 participants