Skip to content

Add a navigation rail experiment with Home and Settings tabs - #4964

Merged
SawyerHood merged 1 commit into
mainfrom
bb/mock-left-nav-experiment-with-home-tab-and-thr_8ga9782vvn
Oct 5, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/mock-left-nav-experiment-with-home-tab-and-thr_8ga9782vvn

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Sidebar navigation lives inside the thread sidebar. Opening Settings, Plugins, or Skills replaces that whole sidebar, so the navigation disappears and a "Back to app" row is the only way out. A plugin cannot fix this: the experimental_sidebarNavigation slot is mounted inside the thread sidebar, so a rail-style navigation plugin unmounts on those screens and has to position itself by measuring the DOM.

What changed

Adds a default-off navigationRail experiment (Settings → Experiments, or bb settings experiment navigationRail true). On wide viewports it draws a host-owned vertical rail on the left edge of the sidebar that stays mounted on every screen.

  • Rail (apps/app/src/components/sidebar/AppNavRail.tsx): Home, the user's visible destinations (Plugins, Skills, plugin panels), More, and Settings pinned at the bottom. It reads the existing sidebar navigation model, so saved order, visibility, accessories, split drags, context menus, and the customize editor carry over.
  • Home: current on thread and compose routes. From anywhere else it returns to the last such route, skipping plugin panels and Settings visited since.
  • One shell (AppLayoutSidebar.tsx, AppSidebar.tsx): in rail mode the thread sidebar stays mounted and hides its body while the Settings, Plugins, or Skills body renders beside the rail, the same pattern the compact drawer already uses.
  • Thread sidebar: New thread moves into the header row, the navigation region is not mounted (it still hosts the customize editor), and Settings leaves the footer.
  • Section sidebars (SectionSidebar.tsx): the "Back to app" row is dropped and the header shows the section title.
  • Appearance settings: the Navigation and Header pickers say they are not used while the experiment is on. Saved providers are kept and apply again when it is turned off.
  • Icons: adds Home to the core icon set.

Not changed: compact viewports keep the drawer, collapsing the sidebar hides the rail with it, and the layout with the experiment off is untouched.

No new plugin API and no SDK source change. The experimental_sidebarNavigation and experimental_sidebarHeader slots keep their contracts; they are not mounted on wide viewports while the experiment is on. docs/api_to_audit.md records that. No server/daemon wire change.

Docs: docs/configuration.md, the bb guide customization template, the bb-cli app-settings reference, and the verify-bb settings recipe.

How you verified

  • New tests: AppNavRail.test.tsx (rail contents, highlight per route, Home returning to the last thread, hidden items under More, Customize from Settings), plus rail-mode cases in AppLayoutSidebar.test.tsx, SidebarNavigationRegion.test.tsx, ResourceSidebars.test.tsx, SidebarNavigationSetting.test.tsx, and SettingsView.experiments.test.tsx.
  • pnpm exec turbo run typecheck lint --filter=@bb/app --filter=@bb/server --filter=@bb/domain --filter=@bb/shared-ui --filter=@bb/desktop passes.
  • pnpm exec turbo run test --filter=@bb/app -- src/components/sidebar src/components/layout src/components/settings src/components/tools src/views/SettingsView src/components/ui/icon.test.tsx passes (59 files), and test/system/experiments.test.ts passes in @bb/server.
  • Both plugin SDK version checks pass.
  • Drove a source dev app in headless Chrome in light and dark: Home, Plugins, Skills, Settings, and a plugin panel each highlight with the right sidebar body; Customize opens from Settings mode; the sidebar collapses with the rail; with the experiment off the layout matches main.
  • Not verified: macOS desktop chrome (the header inset beside the window controls is by calculation) and a plugin accessory badge on a rail icon.

🤖 Generated with Claude Code

AGENT GENERATED

The navigationRail experiment keeps a vertical rail of destinations on the
left edge of the sidebar on wide viewports. The rail stays mounted while the
sidebar beside it swaps between the thread list, Plugins, Skills, and
Settings. Home returns to the last thread, Settings sits at the bottom, and
New thread moves into the sidebar header.

The host draws the rail from the existing sidebar navigation model, so saved
order, visibility, accessories, split drags, and the customize editor carry
over. While the experiment is on, the sidebar navigation and header plugin
slots are not mounted on wide viewports; their saved providers apply again
when it is turned off. Compact viewports keep the drawer.

Co-Authored-By: Claude Code <[email protected]>
@SawyerHood
SawyerHood added this pull request to stack #4970 October 5, 2026 23:33
@SawyerHood
SawyerHood merged commit 3bbe39a into main Oct 5, 2026
34 checks passed
@SawyerHood
SawyerHood deleted the bb/mock-left-nav-experiment-with-home-tab-and-thr_8ga9782vvn branch October 5, 2026 23:34
SawyerHood added a commit that referenced this pull request Oct 5, 2026
## Human comments

## What was wrong

Builds on #4964 (merged), which added the `navigationRail` experiment.
With the rail on, Customize opened the editor in the thread sidebar, a
column away from the icons it edits. When the sidebar was showing
Settings, Plugins, or Skills, it also had to jump to Home first so the
editor had somewhere to render.

## What changed

- **Popover editor** (`AppNavRail.tsx`): Customize opens the existing
reorder-and-visibility editor in a popover anchored to the rail's More
button, on any screen. The rail updates beside it as items are
reordered, shown, or hidden. Done, Escape, or clicking outside closes it
and returns focus to More.
- **Pinned position**: the popover anchors to where More was when it
opened and stays there until it closes. More moves as items are shown or
hidden, so anchoring to the button itself slid the editor under the
pointer on every toggle.
- **Entry points**: the More menu and each rail icon's context menu say
"Customize rail" and "Hide from rail". Host `openCustomize()` calls open
the same popover.
- **No Home jump**: opening Customize no longer navigates.
- **Thread sidebar** (`AppSidebar.tsx`): the navigation region is not
mounted in rail mode, so the `providerSuppressed` path that #4964 added
to `SidebarNavigationRegion` is removed.
- **Editor** (`SidebarNavigationCustomize.tsx`): takes a `surface` prop
so the popover uses the compact frame and the "Customize rail" title.

No plugin API change. `docs/api_to_audit.md` is updated to say the
editor opens in a popover.

## How you verified

- `AppNavRail.test.tsx`: the popover keeps its position when More moves
(fails if the anchor follows the button); opening Customize from
Settings keeps the route, renders the editor outside the rail, toggling
items updates the rail, Done closes it and focuses More; a host
`openCustomize()` call opens the same popover.
- `pnpm exec turbo run typecheck lint --filter=@bb/app` passes.
- `pnpm exec turbo run test --filter=@bb/app -- src/components/sidebar
src/components/layout src/components/settings src/components/tools`
passes (53 files).
- Source dev app in headless Chrome: opened Customize from Settings
mode, showed Search threads, saw it appear in the rail, closed with
Escape, focus returned to More. Toggled three items while measuring:
More moved from 240px to 126px and the popover stayed at 240px.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

---------

Co-authored-by: Claude Code <[email protected]>
SawyerHood added a commit that referenced this pull request Oct 5, 2026
## Human comments

## What was wrong

Stacked on #4968, which builds on the merged #4964. In rail mode the
Settings, Plugins, and Skills sidebars showed their name in the sidebar
header, directly beside the page header showing the same name. The rail
already highlights the active tab, so the sidebar title was a third
signal for the same thing.

## What changed

- **Section sidebars** (`SectionSidebar.tsx`): in rail mode the header
row keeps only the back and forward buttons. The `navRailTitle` prop
becomes a `navRailHosted` flag.
- **Unchanged**: New thread stays in the thread sidebar's header, and
the layout with the experiment off is untouched.

## How you verified

- `ResourceSidebars.test.tsx`: the rail-hosted sidebar renders neither
the back row nor its own title.
- `pnpm exec turbo run typecheck lint --filter=@bb/app` passes.
- `pnpm exec turbo run test --filter=@bb/app -- src/components/sidebar
src/components/layout src/components/settings src/components/tools`
passes (53 files).
- Source dev app in headless Chrome: the Plugins and Settings sidebars
show no title in rail mode.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

Co-authored-by: Claude Code <[email protected]>
SawyerHood added a commit that referenced this pull request Oct 6, 2026
## Human comments

## What was wrong

With the `navigationRail` experiment on, the rail mounted each plugin
panel's `experimental_sidebarAccessory` on top of the panel's icon,
clipped to 2rem (#4964). Accessories are sized for the trailing column
of a sidebar row (4rem by 1.25rem), so a count or short status
overlapped the icon and was cut off.

## What changed

- **Rail** (`AppNavRail.tsx`): the rail is icon-only. It no longer
mounts panel sidebar accessories, so an accessory's queries and
subscriptions do not run there either.
- **Sidebar rows**: unchanged. With the experiment off, and on compact
viewports, accessories behave as before.
- **Docs**: `docs/api_to_audit.md`, the plugin-authoring
`frontend-core-slots.md` reference, and `bb-guide-plugins.md` now say
the rail does not mount accessories.

No plugin API change. With the rail on, an accessory's value is not
shown anywhere on wide viewports, because the rail replaces the rows
that carry it.

## How you verified

- `AppNavRail.test.tsx`: new case registers a panel with an accessory
and asserts the rail neither mounts it nor shows its text. It fails
before the change (the accessory mounted once) and passes after.
- `pnpm exec turbo run test --filter=@bb/app --
src/components/sidebar/AppNavRail.test.tsx
src/components/layout/AppLayoutSidebar.test.tsx` passes (16 tests).
- `pnpm exec turbo run typecheck lint --filter=@bb/app` passes.
- `pnpm exec turbo run test --filter=@bb/server --
test/services/plugins/plugin-authoring-docs.test.ts` passes.
- Not checked visually in the running app.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

Co-authored-by: Claude Code <[email protected]>
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.

1 participant