[Bug]: web blocks become unresponsive when switching focus between two of them
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 86/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- frontend
调研方向
从 frontend/app/block/block.tsx 开始,检查 blockClicked 和 isFocused 附近的焦点 effect,并使用两个 web block 重现该问题。阻止正在失去焦点的 block 重新获取 DOM 焦点或逻辑焦点;当在两个 web block 之间切换时,新选中的 block 保持可交互且稳定,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Current Behavior
With two web blocks open, clicking from one web block into the other makes both webviews unresponsive to input — buttons/links don't click, the URL bar can't be edited, typing does nothing. Only the block header icons (right side) still respond.
waveapp.log shows webview-focus flapping continuously between the two webview ids and null:
webview-focus null
webview-focus 23
webview-focus null
webview-focus 24
...
Focus is granted then revoked within a few ms (some events share the same millisecond), so no input ever lands. Terminal→web focus is fine; only web→web breaks.
Root cause is in frontend/app/block/block.tsx. blockClicked is state and lags one commit, so the focus effect also runs while a block is losing focus (stale blockClicked === true, isFocused === false). It can't tell "just clicked" from "just lost focus", so the de-focusing block re-grabs both DOM and logical focus. With two web blocks both doing this, they fight indefinitely. Single webview settles because there's no competitor.
Expected Behavior
Clicking from one web block to another moves focus once and stays there. Both web blocks remain interactive.
Steps To Reproduce
- Open two
webblocks side by side (e.g.wsh web open https://github.comandwsh web open https://example.com) - Click into web block A, then click into web block B
- Try to click a link/button or edit the URL bar in either — input is dead; header icons still work
Wave Version
v0.14.5
Platform
macOS
OS Version/Distribution
macOS 15 (Darwin 25.5.0), Apple Silicon
Architecture
arm64
Anything else?
Fix incoming — guard the re-focus in block.tsx so a block that is losing focus doesn't re-grab it.
- 主要语言
- Go
- 星标
- 22.4k
- 派生
- 1.1k
- 平均合并
- 3 天 13 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wavetermdev/waveterm 的其他 Issue
-
pwsh: encodeEnvVarsForPowerShell rejects Windows-standard env var names like ProgramFiles(x86), breaking wsh token on every pwsh block可能已有人在做 @vortsghost2025 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
wavetermdev/waveterm#3481 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
wavetermdev/waveterm#3435 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
wavetermdev/waveterm#3432 ·
维护者通常 1 天内回复
-
enhancement triage
难度 2/5 1-3 小时 新手友好度 82/100
wavetermdev/waveterm#3431 ·
维护者通常 1 天内回复
-
Feature request: emit a distinct CSI-u sequence for Ctrl+Enter in terminal blocks可能已有人在做 @Jason-Shen2 于 94 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
wavetermdev/waveterm#3355 · 1 条评论 ·
维护者通常 1 天内回复
查看 wavetermdev/waveterm 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/DebateAI#611 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
terraform-provider
难度 2/5 1-3 小时 新手友好度 73/100
ClickHouse/terraform-provider-clickhousedbops#281 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
open-telemetry/opentelemetry-go-compile-instrumentation#1450 ·
维护者通常 2 天内回复