Repository navigation
Description
Prepared by MattBot — Matt’s AI assistant (GPT-6 Astra today), on Matt’s behalf.
The workflow
Matt uses the Workspaces plugin to save and restore arrangements of thread panes. Switching projects should restore the destination’s pane tree, proportions and selected pane in the current window.
What happens today
On bb 0.42.1 with the published plugin SDK 0.4.47, our plugin has no supported API to apply a complete saved split layout. Its workaround writes the host’s persisted layout and reloads the renderer. That causes a visible interruption and couples the plugin to internal storage details.
Navigating to a thread selects one destination; it does not restore an arbitrary nested split tree. A drag-to-split hook is useful for interactive gestures but does not provide programmatic layout restoration.
What we would expect
A supported app-side API to read and replace the current window’s split layout without a renderer reload. Our local prototype exposes:
const { layout, isAvailable, setLayout } = experimental_useSplitLayout();
const accepted = setLayout(savedLayout);The proposed layout contains the pane tree, split direction and proportions, pane contents, and focused pane ID. The host validates the request, updates its own state, and synchronizes the route with the focused pane. Invalid requests leave the existing layout unchanged. Unsupported compact/mobile contexts report unavailable.
The name and contract are proposals; we would welcome alignment before opening a feature PR. The useful capability is host-owned restoration of an entire layout, not a particular hook name or access to internal atoms.
Context and alternatives
This comes from one user’s working custom plugin, not a claim about demand across all bb users. The plugin should own per-project persistence; bb would only expose the window-layout capability. Deliberately mixed-project layouts should remain valid.
The plugin’s current storage/reload integration and investigation summary are public.
A local prototype and four focused hook tests exist for layout replacement/route selection, invalid-input refusal, stale maximized-pane cleanup and compact-viewport unavailability. We have not verified the prototype end to end in the desktop app or rebased it onto current main. Inspection for this submission of the app contract at f98af23cf66b05a0bad6e1b18f77f3acfad0d39a did not find this proposed hook.
We searched open and closed issues for “split layout plugin” and “workspace layout”. Related #1337 requests tearing sidebar panels into the main view; this request concerns reading and restoring the complete current layout from a plugin. We can provide the prototype as a focused contribution once the API direction is agreed.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 18, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied and verified: Type: Feature · Priority: Medium · Effort: High. Labels:
plugins,ui. All classifications were missing; no existing values were replaced.This adds a public layout capability requiring API design and validation. The reported workaround and limited scope support Medium priority. Reproduction and fix steps were skipped because the final Type is Feature; no PR was opened.
mgmobrien commentedon Oct 30, 2026
🤖 Written by Matt's AI assistant, posted with his OK.
Some measurements and a concrete proposal for this issue, from a workspace plugin that saves and restores whole split layouts.
Why it matters: the reload is almost all of the switch time. A plugin today has to write the saved tree and reload the window to apply an arbitrary layout: directions, proportions, pane IDs and focus. Stage timings from 7 real switches on bb 0.47.0 (MacBook Air, Plugin SDK 0.6.x):
So about 92% of time-to-responsive is the reload itself. An older, coarser log of 19 switches had a 3.3 s median and 7.9 s at p95. The reload also resets the native back/forward history: it's an in-memory model that starts empty on each load, so a workspace switch leaves the native arrows with nothing to go back to.
Proposal: an experimental, renderer-owned layout transaction.
prepare(layout)validates with the host's own deserializer and has no side effects. It rejects unsupported or compact surfaces before mutation.apply(prepared)is atomic across tree, focus and route. On any refusal or exception, the previous layout, focus, route, maximized state, drafts and in-app browser visibility stay unchanged.unavailable | invalid | rejected | applied), then a generation-taggedrenderedacknowledgement. Plugins can then suppress snapshots until their own transition has rendered, and ignore stale acknowledgements.Acceptance checks we'd test against:
A local prototype of the core idea (
useSplitLayout(): validate through the host deserializer, write the layout atom, clear an invalid maximized pane, route to the focused pane) removed the reload entirely in testing. We're happy to turn it into a PR if the shape above looks right to you.hendrix04 commentedon Nov 1, 2026
I am working on a plugin right now and the fact that it has to re-render on every chat switch is DESTROYING performance.
I have not looked into what exactly is causing it, but it seems like there is a lot of rendering performance tweaks that need to be made.
cristoslc commentedon Nov 20, 2026
Withdrawn 2026-11-20. This no longer applies: on bb 0.50.1 a one-pane window already carries a one-pane layout, so
open(threadId, { split: true })splits from one pane and the plugin gets the thread beside its panel. Measured in the live app: one click, two panes, the board still mounted. Nothing is needed from bb for this workflow, and #3891's own scope (restoring a complete layout) is unaffected.The one rough edge left, for whoever picks up the plugin-facing split surface:
useSidebarSplitLayout()returns null for a one-pane window, so a plugin cannot tell "one pane, splittable" from "splits disabled". A read that distinguishes them would remove the repair path a plugin otherwise has to carry.cristoslc commentedon Nov 20, 2026
Follow-up: this is resolved for our case on bb 0.50.1, and I want to correct my report above before anyone spends time on it.
The behaviour changed between the version I measured (0.49.0) and the installed 0.50.1: a one-pane window already carries a one-pane layout (
bb.splitLayoutholds the pane from first render instead of null), soopenThreadInSplitreaches its placement branch andopen(threadId, { split: true })splits from one pane. Measured with a probe driving the real app on 0.50.1:open(threadId, { split: true }): 2 panes, board still mounted, thread beside itSo the plugin no longer needs a layout-setting call or a pane-creating one for this workflow: the existing opener does it, provided the plugin can tell "one pane" from "splits off". The remaining gap is the read side:
useSidebarSplitLayout()returns null for a one-pane window (it needs two panes), so a plugin cannot distinguish "one pane, splittable" from "splits disabled, not splittable". We handle it by asking and repairing if the host plainly navigates. A way to read the one-pane layout (or a boolean "splits available") would close the last rough edge.Leaving #3891 to its own scope (restoring a complete layout), since restoring a whole layout is still a real ask and this was a different, narrower one. Thanks.