Repository navigation
Add shared fixed tabs to plugin pages - #1788
Conversation
|
🚨 SLOP COP 🚨 · 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( |
There was a problem hiding this comment.
🚨 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}.
| store.listeners.delete(listener); | ||
| if (store.owner === consumer) | ||
| store.owner = store.consumers.values().next().value ?? null; | ||
| if (store.consumers.size === 0) { |
There was a problem hiding this comment.
🚨 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.
| rpc: DocsRpcClient, | ||
| ): Promise<void> { | ||
| if (notebookStores.get(store.vaultId) !== store) return Promise.resolve(); | ||
| if (store.inFlight) return store.inFlight; |
There was a problem hiding this comment.
🚨 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[]>( |
There was a problem hiding this comment.
🚨 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.
There was a problem hiding this comment.
🚨 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.
a698ae9 to
939e685
Compare
939e685 to
d94d08d
Compare
Summary
navPanel.experimental_fixedTabswith validation, persistence, and host-owned renderingBehavior
Validation
pnpm exec turbo run typecheck --filter=@bb/app --filter=@get-bb/plugin-sdk --filter=bb-plugin-tasks --filter=bb-plugin-simple-notes@bb/appfixed-tab, panel-host, and thread-tab-sync tests@get-bb/plugin-sdkapp harness tests