Skip to content

Open the New thread screen through one core path, with split - #8052

Merged
ymichael merged 7 commits into
mainfrom
bb/8011-tocompose-opennewthread-support-split-true-thr_ugkg2rfyx8
Nov 23, 2026
Merged

ymichael merged 7 commits into
mainfrom
bb/8011-tocompose-opennewthread-support-split-true-thr_ugkg2rfyx8

Conversation

@ymichael

@ymichael ymichael commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Core opened the New thread screen in about a dozen places, each building navigate("/", { state }) by hand. None of them could place the screen in a split. SplitThreadArea then reconciled the layout so the composer replaced whatever pane was focused. Plugins had the same limitation: toCompose had no split (#8011). The thread-list plugin's project, section and Threads + buttons go through toCompose, so they also replaced the pane the user was reading (#2795).

What changed

One opener. openNewThread (apps/app/src/lib/split-layout/openNewThread.ts, with useOpenNewThread for components) is now the only way core opens the New thread screen, as openThread is for threads since #7954. It takes the compose options (projectId, initialPrompt/replaceInitialPrompt, focusPrompt, placement, environmentId, hostId), plus split and replace. It selects the project, builds the route state once, and with split places the pane by the same rules as openPaneContentInSplit:

  • a right split by default
  • focus (and replace history) when a composer pane is already open, then apply the options there
  • replace the focused pane at the pane cap
  • plain navigation on compact viewports or when there is no layout

The placement logic is extracted as placePaneContentInSplit, so both callers share it.

Callers moved onto it:

  • toCompose
  • the superseded sidebar openNewThread, which takes no split
  • the sidebar New thread button and its Open in split
  • the thread.new command
  • New thread in environment
  • Create plugin, Create skill and Fork skill
  • Edit skill/plugin via chat
  • Create custom palette
  • the screen after quick-creating a project

Redirects after deletion, route repair and LegacyProjectComposeRedirect still only build the path. Every caller keeps its current behavior; the thread-list + buttons gain Cmd/Ctrl-click.

SDK. BbNavigate.toCompose gains split?: boolean. It is stable and unprefixed, like toThread's split. Plugin SDK is bumped to 0.6.187, and thread-list now requires >=0.6.187.

#2795. The thread-list plugin's + buttons (project, section, machine, Pinned, Threads, and environment groups) now behave like the sidebar New thread button. A plain click still replaces the focused pane, and Cmd/Ctrl-click opens the New thread screen beside it. The issue left this choice open; the modifier keeps all the New thread buttons consistent. The click's modifier reaches toCompose's split through each handler. The issue's second point, raising MAX_PANES, is not part of this PR.

Small cleanups:

  • Dropped the never-read createDraftKind state from the skill entry points.
  • Dropped the sidebar openNewThread's sectionId state key, which placement (always sent alongside it) already overrides.
  • buildCreateThreadInEnvironmentState and its test are replaced by the openNewThread state test.

Docs:

  • docs/api_to_audit.md: a new paragraph under Thread creation placement lists the core callers.
  • bb-plugin-authoring: frontend-navigation.md gets a New thread screen section; frontend-hooks-and-ui.md, frontend-thread-list.md and the SKILL.md routing line are updated.

No host daemon wire change.

How you verified

  • New tests:
    • openNewThread.test.ts: focuses and replaces history for an existing composer pane, replaces at the pane cap, does not touch panes on compact or without split, and hands RootComposeView the environment, placement and focus state.
    • plugin-navigation-hooks.test.tsx: toCompose({ split: true, ... }) from a plugin panel adds a new-thread pane to the right with the state and project selected; without split the layout is untouched. On main the split case fails because split is ignored.
  • Updated tests:
    • plugin-sidebar-hooks.test.tsx now runs against the real project selection.
    • The thread-list tests expect split: true.
  • pnpm exec turbo run typecheck lint --filter=@bb/app --filter=bb-plugin-thread-list --filter=@get-bb/plugin-sdk
  • Targeted app tests: split-layout, plugin navigation and sidebar hooks, sidebar, AppLayoutSidebar, RootComposeView, ThreadMetadataContent, ThreadActionsMenu, app-route-history, PluginAppOverlays.
  • turbo run test for bb-plugin-thread-list (458), bb-plugin-bb-guide, bb-plugin-plugin-api-docs.
  • Live on pnpm start:worktree in headless Chrome (1440×900), with a thread open in a single pane:
    • A plain click on the QAVault project + replaces the pane with the composer, as before.
    • Cmd-click on the same button keeps the thread in pane-1 and opens the composer in pane-2.
    • An earlier build that always split confirmed that an already-open composer pane is focused and switched to the clicked project, with no third pane.
    • The global New thread button still replaces the focused pane.
  • ProjectList.sectionCreate.test.tsx covers a plain click, Cmd-click and Ctrl-click on a section +.

Fixes #8011
Fixes #2795

AGENT GENERATED

🤖 Generated with Claude Code

ymichael and others added 7 commits November 23, 2026 12:05
toCompose gains split: true, which opens the New thread screen beside the
caller with toThread's split rules (right split, replace at the pane cap,
plain navigation where splits are off; focus and retarget an open composer
pane). openNewThread (split-layout/openNewThread.ts) is now the only way
core opens the screen: toCompose, the superseded sidebar openNewThread, the
sidebar New thread button and its Open in split, the thread.new command,
New thread in environment, Create/Edit via chat entry points, Create custom
palette, and quick-create project. The thread-list plugin's project,
section, machine and Threads plus buttons pass split: true, so they no
longer replace the focused pane.

Plugin SDK 0.6.184.

Fixes #8011
Fixes #2795

Co-Authored-By: Claude Opus 5.5 <[email protected]>
useQuickCreateProject's test mocked root-compose-selection without the
new setter, SkillsView's fork test expected the never-read
createDraftKind state, and frontend-hooks-and-ui.md went to 501 lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Match the sidebar New thread button: a plain click on a project, section,
machine, Pinned, Threads or environment plus replaces the focused pane,
and Cmd/Ctrl-click opens the New thread screen beside it. The click's
modifier now reaches toCompose's split through each handler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pose

openNewThread always passes its navigate options, and toCompose hands
react-router's navigate straight to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nnewthread-support-split-true-thr_ugkg2rfyx8

# Conflicts:
#	packages/domain/src/plugin-sdk-version.ts
#	packages/plugin-sdk/package.json
…nnewthread-support-split-true-thr_ugkg2rfyx8

# Conflicts:
#	apps/app/src/components/tools/SkillsLibrary.tsx
#	apps/app/src/lib/plugin-navigation-hooks.ts
#	apps/app/src/views/ToolsView.tsx
#	plugins/bb-guide/skills/bb-plugin-authoring/references/frontend-hooks-and-ui.md
@ymichael
ymichael merged commit c6d4430 into main Nov 23, 2026
52 checks passed
@ymichael
ymichael deleted the bb/8011-tocompose-opennewthread-support-split-true-thr_ugkg2rfyx8 branch November 23, 2026 21:13
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.

toCompose / openNewThread: support split: true like toThread A project's new-thread button replaces the focused pane instead of opening beside it

1 participant