Skip to content

[Bug]: web blocks become unresponsive when switching focus between two of them #3428

Description

@jameswolensky

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

  1. Open two web blocks side by side (e.g. wsh web open https://github.com and wsh web open https://example.com)
  2. Click into web block A, then click into web block B
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions