Skip to content

Secondary panel mounts its active content twice on each thread switch #7802

Closed

Description

@lanjak

Summary

Switch between two threads with the right panel open and Info selected. The active panel content mounts twice during each switch. It should mount once.

Versions and environment

  • Source build at 343b5e8321dbae2bf25b4928321fbef3954611c6.
  • Arch Linux, Node 26.13.1, headless Chromium, 1600 x 1000 viewport.
  • Optimized app from pnpm start:worktree, with a separate scratch database and checkout-specific ports.
  • Default Git plugin enabled. The defect also occurs with an open file. Agent output is not necessary.

Steps to reproduce

  1. Start the source app at the commit above with pnpm start:worktree. Use the app URL it prints.
  2. Add a small Git project and create two threads, A and B. Keep the default Git plugin enabled.
  3. Open the right panel in both threads and select Info.
  4. In the browser console, install this counter:
    window.panelMounts = 0;
    new MutationObserver(records => {
      for (const record of records) {
        for (const node of record.addedNodes) {
          if (!(node instanceof Element)) continue;
          const selector = '[data-testid="thread-secondary-panel-top-chrome"]';
          window.panelMounts += Number(node.matches(selector)) + node.querySelectorAll(selector).length;
        }
      }
    }).observe(document.documentElement, { childList: true, subtree: true });
  5. Click thread B, wait for it to settle, then read window.panelMounts. It is 2.
  6. Set the counter to 0 and click thread A. Do this ten times. Each switch inserts the panel surface twice.

Expected vs actual

Expected: one mount of the active content for each thread switch.

Actual, ten switches:

SUMMARY {"label":"baseline","mode":"info","switches":10,"chromeInsertionsPerSwitch":2,"splitContainerInsertionsPerSwitch":0,"xtermInsertionsPerSwitch":0,"terminalSocketsPerSwitch":0,"shortLivedSocketsPerSwitch":0}

A test with the real plugin visibility hook and the real panel component also records two effect mounts for the new thread:

AssertionError: expected [ 'info:thr_b', 'info:thr_b' ] to deeply equal [ 'info:thr_b' ]

The open-file case fails with the same duplicate mount.

Evidence

What you ruled out

Suggested priority and effort

Medium priority, small fix. Panel content runs its setup twice on each thread switch. No data loss.

AGENT GENERATED

Activity

  1. added theissue type on Nov 19, 2026
  2. added
    ui
    confirmed-repro
    on Nov 19, 2026
  3. bb-slop-cop commented on Nov 19, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

  4. added a commit that references this issue on Nov 20, 2026
    eeb9659
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

    confirmed-reproperfui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions