Skip to content

Keep the thread panel host mounted across thread navigation - #2277

Closed
vburojevic wants to merge 1 commit into
get-bb:mainfrom
vburojevic:perf/mobile-gaps-nav-remount
Closed

Keep the thread panel host mounted across thread navigation#2277
vburojevic wants to merge 1 commit into
get-bb:mainfrom
vburojevic:perf/mobile-gaps-nav-remount

Conversation

@vburojevic

Copy link
Copy Markdown
Contributor

What was wrong

Thread-to-thread navigation remounted the SecondaryPanelLayout PanelGroup (group key defaulted to resetKey = thread id): the realized secondary panel (diff, metadata, browser deck) was destroyed and rebuilt per navigate on desktop-inline layouts, and panel sizes reset every time.

What changed

Pass the documented panelGroupKey escape hatch (same pattern as PluginPanelRightPanelHost) so the physical host survives navigation while content identity resets via resetKey. The hasPanelExpandedRef mount-collapse guard now re-arms per thread since the Panel instance survives.

Scope, stated plainly

Desktop-inline improvement. On compact viewports the drawer already rendered outside the keyed group; the timeline/composer remount on any viewport is owned by PageShell's own key={threadId} (unchanged here). Drafts and scroll anchors live under that key, so nothing leaks between threads.

How verified

Regression test (panel subtree DOM identity preserved across threadId change) fails without the fix, passes with it; typecheck + oxlint clean; adversarially reviewed before submission.

🤖 Generated with Claude Code

Thread-to-thread navigation remounted the SecondaryPanelLayout
PanelGroup because the group key defaulted to resetKey (the thread id).
On desktop-inline layouts that destroyed and rebuilt the realized
secondary panel (diff views, metadata, browser deck) in one synchronous
commit per navigate, and reset the user's panel sizes every time.

Pass the documented panelGroupKey escape hatch (already used by
PluginPanelRightPanelHost) so the physical host survives navigation
while content identity still resets via resetKey.

Scope, stated plainly: this is a desktop-inline improvement. On compact
viewports the drawer already rendered outside the keyed group, and the
timeline/composer remount cost on any viewport is owned by PageShell's
own key={threadId} inside EmbeddedThreadChat — unchanged here.

Per-thread state stays correct: drafts and scroll anchors live under
that PageShell key, split layouts are keyed by thread id, and the
hasPanelExpandedRef mount-collapse guard now re-arms per thread since
the Panel instance survives navigation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SawyerHood added a commit that referenced this pull request Aug 22, 2026
…ttach edge (#2300)

Lands five mobile-performance PRs by Vedran Burojevic plus one follow-up fix.

* #2277 Keep the thread panel host mounted across thread navigation
* #2278 Gate the default focus refetch on lost realtime coverage
* #2279 Apply urgent realtime thread changes without flushing the debounce buffer
* #2280 Cache max scroll offset outside the timeline scroll hot path
* #2281 Make the published plugin composer host stable across keystrokes

Follow-up fix: a detached timeline viewport that a content shrink clamps onto
the new, smaller maximum stayed detached, because the clamp's scroll event
outruns the ResizeObserver refresh and is classified against the stale cache.
The ResizeObserver path now detects that case and re-attaches. Regression test
fails on the #2280 head and passes here.

Verified: typecheck pass; oxlint 0 errors; @bb/app 422 files / 3,288 tests pass.

Merge commits are disabled on this repository, so this squash carries the work
of all five branches; co-author trailers preserve authorship.

Co-Authored-By: Vedran Burojevic <vedran.burojevic@gmail.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@SawyerHood

Copy link
Copy Markdown
Collaborator

Shipped in #2300 (squash commit 836e216).

This branch's changes are on main verbatim — I reviewed all five of your mobile-performance PRs (#2277#2281) for regressions, merged them onto one integration branch, and landed the batch together after a full verification pass (typecheck, oxlint, and the whole @bb/app suite: 422 files / 3,288 tests green).

Closing as superseded rather than merged only because merge commits are disabled on this repo: a squash creates a new commit, so GitHub cannot mark this PR merged even though its changes are in main. Your authorship is preserved as a Co-Authored-By trailer on the squash commit.

Review notes: no regression found. The hasPanelExpandedRef re-arm keys on splitPanelStateId (= thread.id), and the child layout effect ordering ahead of the group's setLayout checks out.

Thanks — nice work on this batch.

AGENT GENERATED

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants