fix(web): keep human panel focus local to the gesturing client - #570
Merged
Conversation
A human tab switch is a report, not a command: the server now mirrors active_panel silently for source-less focus POSTs and broadcasts a panel_focus frame only for agent-attributed switches, so one operator's clicks can no longer rearrange every other window of the same workspace or bounce back as a delayed echo that evicts tiles mid-gesture. The gesturing client applies its own focus locally through a new dock-sync focus-handler seam instead of riding the echo, and a tile close runs its dockview removal inside the echo guard so the survivor auto-activation is never reported as a human gesture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With two windows of the same workspace open (or one window and a delayed echo), panel workspaces mutated themselves: a human tab switch was broadcast back over SSE and every client applied it with evicting 'replace' placement. Reproduced consequences:
panel-commands.jsalready documented the intended contract — a user-initiated switch is reported "so the server mirrors the active panel (and does not echo a focus event back)" — and the collaborative-panels design states human gestures never rebroadcast. The server violated both.Change
panel_focusframe only forsource: "agent"switches; a source-less (human) POST updates theactive_panelmirror silently. Membership-adding visibility frames still broadcast (shared state).setTileFocusHandlerseam — a human dock-tab focus applies locally (rail accent, active-tab state via panel-manager'sactivateTab) instead of riding the now-removed echo; the mirror POST is unchanged.retireTile.Tests
source: "agent"as the MCP path does.test_panels_browser.py+test_panels_collab_browser.pybrowser runs.