Repository navigation
Description
Summary
With the thread context card experiment on and the card pinned, opening or closing the right panel makes the chat jump for one frame. When the panel change moves the chat across one of the card's layout bands (gutter, 312px shift, banner), the first frame at the new width still paints the old layout: the card and the transcript's 312px inset arrive one frame later. I expected the card and inset to change in the same frame as the width.
Versions and environment
- bb 0.49.0 (desktop), and from source at
main7794941 - Linux (Omarchy), Chrome via the dev web app
threadContextCardexperiment on, card pinned
Steps to reproduce
bb settings experiment threadContextCard true, then pin the context card in a thread with Info content.- Make the window 1440px or 1600px wide, so opening the right panel moves the chat from the shift band (1072–1383px) to the banner band (<1072px).
- Open and close the right panel and watch the chat column.
Does not reproduce at 2560px, where the chat stays in the gutter band on both sides.
Expected vs actual
== Show right panel @ 1440px: 1 mismatched of 5 resize frames
110ms overlay=747 expected=banner card=hidden pad=0px MISMATCH
== Hide right panel @ 1440px: 1 mismatched of 11 resize frames
163ms overlay=1087 expected=shift card=none pad=0px MISMATCH
== Show right panel @ 1600px: 1 mismatched of 11 resize frames
== Hide right panel @ 1600px: 1 mismatched of 14 resize frames
== Show right panel @ 2560px: 0 mismatched of 14 resize frames
== Hide right panel @ 2560px: 0 mismatched of 14 resize frames
Each frame's overlay is the [data-scroll-overlay] width, expected is what resolveThreadContextCardLayout returns for it, and card/pad are what that frame painted. On hide at 1440px the chat is already 1087px wide (shift) but paints with no card and no inset; the next frame adds both and the transcript jumps 312px.
Expected: zero mismatched frames at every width.
Evidence
ThreadContextCard measures the overlay in a ResizeObserver and calls setLayout. ResizeObserver callbacks run after layout and before paint, but React renders a state update set there in a later task, so the frame that changed the width paints first. resolveThreadContextCardLayout gives the bands.
I measured with an injected script that creates a ResizeObserver on the overlay after bb's (so it runs after bb's callback, before paint) and records the overlay width, the card's mounted/hidden state, and the transcript's inline padding-inline-end on each resize frame, while clicking the panel toggle at each window width.
What you ruled out
- Not Show the thread context banner when the card does not fit #6875 or Hide the thread context card when it has nothing to show #6618: those added the banner and empty-card hiding; this is the timing of the layout switch.
- Not the panel's 220ms width transition: the mismatch happens only on the frame that crosses a band, and only once per crossing.
- Still happens on
mainat 7794941.
Suggested priority and effort
Low. Cosmetic, one frame per band crossing, only with the experiment on. Effort low: apply the layout with flushSync when the band changes. I have a PR ready.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 13, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotui.partial-repro.