Repository navigation
Labels
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportperfuiApp shell, sidebar, composer, rendering
Description
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
- Start the source app at the commit above with
pnpm start:worktree. Use the app URL it prints. - Add a small Git project and create two threads, A and B. Keep the default Git plugin enabled.
- Open the right panel in both threads and select Info.
- 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 });
- Click thread B, wait for it to settle, then read
window.panelMounts. It is 2. - 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
- Observed: a MutationObserver counts insertions of the top chrome that each panel surface has. A component test counts mounts of the active content. Both show two mounts at the commit above.
- Cause: plugin tabs report visibility from a layout effect. A new thread context has no report yet, so isReady is false. The panel first mounts a flat surface, then changes to SidebarSplitContainer when the reports arrive. React replaces the first subtree.
- The readiness gate came from Unify plugin tabs across threads and navigation pages #6013 (1e80ca7). It keeps saved split layouts from reconciling against an incomplete plugin tab list.
What you ruled out
- A fresh scratch database reproduces the defect.
- Info reproduces it without a terminal and without Keep side-panel terminals alive across panel and thread switches without streaming to hidden ones #7801.
- Not Terminal reconnects and replays its history every time you return to its side-panel tab #7724: that issue is about terminal reconnect and history replay on panel tab changes. This issue is about duplicate mounts of all panel content on thread changes. With Keep side-panel terminals alive across panel and thread switches without streaming to hidden ones #7801 applied, the duplicate mount opens one extra short-lived terminal socket per thread switch.
- Switching between threads takes 2-9s #4396 is about general thread-switch latency. This issue is one deterministic part of a switch and does not claim to explain all of Switching between threads takes 2-9s #4396.
Suggested priority and effort
Medium priority, small fix. Panel content runs its setup twice on each thread switch. No data loss.
AGENT GENERATED
Metadata
Metadata
Assignees
Labels
confirmed-reproBug reproduced again from a clean trusted checkout; see linked reportperfuiApp shell, sidebar, composer, rendering
Activity
bb-slop-cop commentedon Nov 19, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotui,perf.confirmed-repro.Mount secondary panel content once on a thread switch (get-bb#7803)