Skip to content

Add shared fixed tabs to plugin pages - #1788

Merged
ymichael merged 17 commits into
mainfrom
bb/plugin-page-fixed-tabs
Aug 18, 2026
Merged

ymichael merged 17 commits into
mainfrom
bb/plugin-page-fixed-tabs

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Summary

  • add navPanel.experimental_fixedTabs with validation, persistence, and host-owned rendering
  • route thread, new-thread, and plugin-page fixed views through the shared secondary-panel tab path
  • migrate the Tasks and Docs navigation sidebars to host-owned fixed tabs

Behavior

  • fixed tabs are ordered, non-closable, and scoped to their plugin page
  • only the active fixed-tab component mounts, and it unmounts while the panel is closed
  • closing the final closable content tab falls back to a remaining fixed tab
  • the first fixed tab opens on first use, while a later user close remains closed across navigation
  • plugin-page fixed tabs remain local and never enter thread tab synchronization

Validation

  • pnpm exec turbo run typecheck --filter=@bb/app --filter=@get-bb/plugin-sdk --filter=bb-plugin-tasks --filter=bb-plugin-simple-notes
  • focused @bb/app fixed-tab, panel-host, and thread-tab-sync tests
  • @get-bb/plugin-sdk app harness tests
  • Tasks app and shell tests
  • Docs app tests
  • Tasks and Docs production builds

AGENT GENERATED: by GPT-5

@bb-slop-cop

bb-slop-cop Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · review

I am SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, and user behavior.

const activeFixedPanel =
resolveActiveFixedPanel({ activeTab, canUseGitUi }) ?? "thread-info";
const isDiffPanelActive = activeFixedPanel === "git-diff";
const activeFixedTab = resolvedFixedTabs.find(

@bb-slop-cop bb-slop-cop Bot Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — A saved Diff tab no longer falls back to Thread Info.

When Git support becomes unavailable, the fixed-tab list omits Diff. This lookup returns no tab, and the panel shows an unavailable message.

Restore the prior Diff-to-Info fallback. Add a test for an active Diff tab with canUseGitUi={false}.

Comment thread plugins/docs/app.tsx
store.listeners.delete(listener);
if (store.owner === consumer)
store.owner = store.consumers.values().next().value ?? null;
if (store.consumers.size === 0) {

@bb-slop-cop bb-slop-cop Bot Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — Strict Mode can leave Docs on its loading screen.

The first effect cleanup deletes this store. The second Strict Mode setup still holds the deleted object.

refreshNotebookStore then rejects each refresh because the map no longer contains that object.

Delay final disposal and cancel it when a consumer returns. Add a Strict Mode test for the page and navigation tab.

Comment thread plugins/docs/app.tsx Outdated
rpc: DocsRpcClient,
): Promise<void> {
if (notebookStores.get(store.vaultId) !== store) return Promise.resolve();
if (store.inFlight) return store.inFlight;

@bb-slop-cop bb-slop-cop Bot Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — A refresh during an active request can leave stale notes.

This return merges every new refresh into the current request. It does not record a required follow-up request.

A mutation or vault-changed event can therefore commit an older list until another event occurs.

Record a pending refresh and start one after the current request completes. Add a race test.

pluginId,
});
const panelState = useFixedPanelTabsState(panelStateId, null);
const fixedViewTabs = useMemo<readonly PluginPageFixedPanelTab[]>(

@bb-slop-cop bb-slop-cop Bot Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 slopcop/review — Plugin load can erase a saved closed-panel state.

A cold route mounts this host before the matching registration exists. This code treats that state as an authoritative empty tab list.

Reconciliation removes the saved fixed tab. The later registration then looks new and reopens the panel.

Do not reconcile until panel exists. Add a delayed-registration test with a saved closed tab.

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Plain English summary: This change gives plugin pages the standard BB right panel. Tasks and Docs move their navigation into that panel.

I found four blocking runtime issues:

  • P1: React Strict Mode can delete the Docs notebook store and leave Docs on its loading screen.
  • P2: A cold plugin load can erase a saved closed-panel state and reopen the panel.
  • P2: A saved Diff tab can show an unavailable panel instead of Thread Info.
  • P2: A Docs refresh during an active request can leave the note list stale.

I found no security issue. The normal tab reconciliation and persistence work has no general performance concern.

The host-owned fixed-tab model is a good central design. It should also own registration readiness and surface capabilities.

Docs and Tasks now contain separate shared-store logic for their split views. A small shared plugin-resource helper could reduce this duplicate logic.

The pull request gained two commits during this review. One commit fixed the contract mirror failure from the reviewed SHA.

Three new CI test jobs passed. The other new CI jobs are still active.

The Docs and Tasks focused suites passed 389 tests. The development launcher did not finish dependency installation, so no browser session ran.

The worker stopped all processes that it started.

@ymichael
ymichael force-pushed the bb/plugin-page-fixed-tabs branch 3 times, most recently from a698ae9 to 939e685 Compare August 18, 2026 19:00
@ymichael
ymichael force-pushed the bb/plugin-page-fixed-tabs branch from 939e685 to d94d08d Compare August 18, 2026 19:06
@ymichael
ymichael merged commit df35a1a into main Aug 18, 2026
10 checks passed
@ymichael
ymichael deleted the bb/plugin-page-fixed-tabs branch August 18, 2026 19:16
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.

2 participants