Skip to content

[BUG] Title-bar commands act on the wrong provider instance when sidebar and editor tab coexist #1529

Description

@easonLiangWorldedtech

Tracking series: vps2 durable per-view state — easonLiangWorldedtech#41 (fix unit F0).
Fix: draft PR #1528 (this issue is the issue of record for that PR, created at PR-open time).

Summary

With the Zoo Code sidebar and an "Open in editor" tab open at the same time, the title-bar commands (+ / Settings / History / Marketplace / popout / focus input) do not reliably act on the instance the user clicked. The commands are wired to a single surface-blind "visible" provider, and the panel bookkeeping mutates shared slots.

Repro

  1. Open the Zoo Code sidebar; start a task.
  2. Open a second Zoo Code view via "Open in editor" (or the popout command). A new ClineProvider + WebviewPanel is created.
  3. Click the title-bar buttons (Settings / History / Marketplace / +) on the sidebar and on the editor tab title bars.

Symptoms (verified at upstream/main 0d937c0)

  • Mutual panel wipe: setPanel writes null into the other panel slot on every resolve (and the sidebar's onDidDispose never clears its slot) — the sidebar/tab slot references drift out of sync as the two views coexist.
  • No tab reuse: every "Open in editor" creates a fresh provider + panel even when a live tracked tab already exists.
  • Surface-blind targeting: the five title-bar commands are contributed to both view/title and editor/title, yet all of them resolve the target via the insertion-order "last visible" provider — so a click on the tab's title bar can execute against the sidebar instance (or vice versa), posting settings/history/marketplace/plus actions to the wrong webview.
  • focusPanel: resolves tab-first from the same drifted slots (self-corrects once the wipe is fixed).

Impact

User actions land in the wrong view instance: a Settings click on the tab can open settings on the sidebar, a + on the tab can evict the sidebar's task, and focus commands target the wrong surface. State written by those actions is attributed to the wrong view.

Fix (PR #1528)

  • no-wipe setPanel (each slot owns its assignment);
  • sidebar title-bar handlers target the click-origin provider;
  • four new *InTab command ids rewire the editor/title menu; tab handlers resolve the owning instance via the new ClineProvider.getInstanceForView(panel);
  • openClineInNewTab reuses the live tracked tab panel;
  • focusInput post condition narrowed to sidebarPanel && !tabPanel.
    Known limitation documented in the PR: zoo-code.newTask (command palette) stays on the visible-provider path (focus-sidebar fallback).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions