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

Abierto Apto para principiantes
#3,428 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
86/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
typescript
Área
frontend

Línea de trabajo

Comienza en frontend/app/block/block.tsx e inspecciona el efecto de foco alrededor de blockClicked e isFocused, reproduciendo el problema con dos bloques web. Evita que un bloque que está perdiendo el foco vuelva a apoderarse del foco del DOM o del foco lógico; el trabajo estará terminado cuando cambiar entre dos bloques web deje el bloque recién seleccionado interactivo y estable.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
22.3k
Forks
1.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wavetermdev/waveterm

Todos los issues de wavetermdev/waveterm

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.