Skip to content

Plugin navigation panels remount across the compact breakpoint and lose form state #7277

Closed

Description

@Willhong

Summary

A single full-page plugin navigation panel still remounts when the viewport crosses the compact breakpoint. Its input and panel DOM nodes are replaced, losing focus and text selection; a plugin form using component-local state also loses its unsaved value. The single-thread fix in #6289 does not cover plugin-panel routes.

Versions and environment

  • bb 0.49.0, macOS arm64, Chromium web client.
  • Current upstream main: 55135d1e5045d6c5d3c24f5a4d5556ed3e11cb00.
  • Live browser observations were made on a local build at f115f9b7fb9d3e1be86b0a55d9320056d312cd05. The affected implementation and existing test file are identical to current upstream main. The regression tests and typecheck were rerun on current main plus the proposed fix.

Steps to reproduce

  1. Open one full-page plugin navigation panel with a text input, without a split. Type a value and select characters 2 through 6.
  2. Resize from 768px wide to 767px, then back to 768px.
  3. Observe focus/selection and retain references to the input and [data-testid="plugin-panel-body"] nodes before and after each crossing.

The regression fixture registers a plugin nav panel whose input stores its value with React useState. It tests both compact and desktop initial layouts and four repeated crossings.

Expected vs actual

Expected: same input/panel nodes, unsaved value, focus, selection and scroll.
Actual:   nodes are recreated at both crossings; focus and selection are lost.

In the live plugin, its own window-memory cache restored the search text, but focus changed from true to false and the selection changed from [2,6] to [11,11]. Within one side of the breakpoint, node identity and selection were preserved. In the nonpersistent regression fixture, the recreated input's value becomes empty.

Evidence

  • keepsSinglePane excludes plugin-panel, so compact takes StandalonePaneContent while desktop takes WorkspacePaneContent:
    panes.length === 1 && firstPane !== undefined ? firstPane : null;
    const keepsSinglePane =
    singlePane !== null &&
    (currentContent.kind === "thread" || currentContent.kind === "new-thread");
    if (!splitWorkspaceActive && !keepsSinglePane) {
    return (
    <StandalonePaneContent
    content={currentContent}
    paneId={layout.focusedPaneId}
    onRequestClose={
    currentContent.kind === "thread" ||
    currentContent.kind === "new-thread"
    ? null
    : () => closePane(layout.focusedPaneId)
    }
    onNavigateInPane={navigateInPane}
    />
    );
    }
    const commandHandlers = splitWorkspaceActive ? (
  • The two new regression cases fail against the unmodified component with an input identity mismatch and value="" instead of value="unsaved plugin form".
  • Keeping the single plugin panel in WorkspacePaneContent on both sides makes both cases pass. Related split-area and plugin-header suites: 91 tests pass. App typecheck also passes.
  • Investigation: BB thread thr_qua2wx7mtu; local observations in followup/hc174-boundary.json and regression logs under p1-repair/. No native Electron or iOS device verification is claimed.

What was ruled out

AGENT GENERATED

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions