Skip to content

Crossing the compact breakpoint remounts the open thread, dropping composer focus and selection #6289

Closed

Description

@JackALaing

Summary

With one thread open, resizing across the compact breakpoint unmounts and remounts the entire thread view: timeline, composer editor, scroll keeper and plugin slots. The composer loses focus, its selection collapses to the end, and the timeline scroller is recreated. Expected: the thread view stays mounted and only the surrounding chrome changes.

I am filing this as a bug because the remount loses editor state the user did not ask to discard. The fix does not change what is rendered. It has one incidental plugin-visible consequence, described under Proposed fix.

Versions and environment

  • main at 3a2c49a; the same code ships in 0.47.1.
  • Any client that can cross the compact breakpoint: a desktop window resized narrow, split-screen or tablet rotation.

Steps to reproduce

  1. Open one thread with no split. Type text in the composer, select part of it, and scroll the timeline up.
  2. Narrow the window below the compact breakpoint (for example 1200 → 660 px wide), then widen it again.

Expected vs actual

Expected: the same composer editor, focus and selection; the same timeline scroller.
Actual:   both are recreated at each crossing; focus is lost and the selection collapses to the end.

Evidence

  • When the viewport is compact, SplitThreadAreaContent renders StandalonePaneContent:
    if (layout === null || currentContent === null) return null;
    if (!splitWorkspaceActive) {
    return (
    <StandalonePaneContent
    content={currentContent}
    paneId={layout.focusedPaneId}
    onRequestClose={
    currentContent.kind === "new-thread"
    ? null
    : () => closePane(layout.focusedPaneId)
    }
    onNavigateInPane={navigateInPane}
    />
    );
  • On desktop, the same single thread renders through WorkspacePaneContent:
    const firstPane = panes[0];
    if (panes.length === 1 && firstPane !== undefined) {
    return (
    <>
    {commandHandlers}
    <WorkspacePaneContent
    content={firstPane.content}
  • The two branches are different element types at the same position, so React remounts the subtree.
  • An earlier headless Chromium run of the web app, using a local build with the same component change on an older base, found for a 1200 ↔ 660 px crossing: median input-to-first-frame 171 ms → 92–93 ms (n = 12 per direction), DOM mutations per crossing 1916 → 899. In that run the ProseMirror editor and timeline scroller nodes, the draft, focus and selection survived repeated crossings. A within-desktop 1200 ↔ 900 px resize was unchanged. These figures are not from current main, Electron, iOS or a physical device.

Proposed fix

https://github.com/JackALaing/bb/tree/fix/compact-single-pane-stable (one commit, 55f702b, on main at 3a2c49a)

  • When the layout holds one pane and the route shows a thread, render WorkspacePaneContent on both sides of the breakpoint. On compact it renders the routed thread, so route navigation shows the next thread immediately. Split command handlers are registered only while the split workspace is active.
  • Splits still collapse to the focused pane on compact and restore on desktop. A compact new-thread composer keeps StandalonePaneContent.
  • Incidental plugin-visible consequence: on compact, the single thread pane's PaneContext.paneId / data-split-pane-id becomes the layout's pane id (for example pane-1) instead of "main", matching desktop.
  • Tests in SplitThreadArea.test.tsx (79 pass; 4 new ones fail against main's SplitThreadArea.tsx): mount identity with draft, focus, selection and scroll; identical pane chrome on both sides; plugin composer scope across crossings and route navigation; split collapse/restore; opening a thread from the compact composer. These tests use a fixture thread pane in jsdom, not the full ThreadDetailView with ProseMirror. No browser or device check was run on this exact commit.

What you ruled out

  • Within-desktop resizes do not remount.
  • Splits are not affected: they already collapse to the focused pane on compact and restore on desktop, and the fix keeps that behavior.

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not.
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED and links the thread or report.

AGENT GENERATED

Activity

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

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Medium · Area: ui. All were missing and have been applied.
    • Report: https://get-bb.github.io/reports/issues/6289.html
    • Verdict: REPRODUCED · Root-cause confidence: high · Label: confirmed-repro.
    • Root cause: Compact mode replaces the single-thread component tree with a different pane/surface path, recreating the editor and timeline scroll owner.
    • Evidence: The authored container regression fails in both directions in two clean trusted-main checkouts at 3a2c49a26: node identity, focus, selection and scroll are lost; persisted draft text survives. All 70 existing owner-suite tests pass. Full ProseMirror cursor position and device behavior remain unverified.
    • No fix PR: Choosing stable compact pane identity and reconciling page/pane semantics requires a product/compatibility decision, outside the simple-fix gate.

    AGENT GENERATED

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-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions