Skip to content

Thread context card and transcript inset lag one frame behind a width change #7496

Closed

Description

@smsunarto

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 main 7794941
  • Linux (Omarchy), Chrome via the dev web app
  • threadContextCard experiment on, card pinned

Steps to reproduce

  1. bb settings experiment threadContextCard true, then pin the context card in a thread with Info content.
  2. 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).
  3. 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

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

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

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

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

    partial-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions