Skip to content

Fix misplaced plugin SDK harness doc comments and record unprefixed sidebar row hooks - #7208

Merged
ymichael merged 1 commit into
mainfrom
bb/sdk-harness-doc-comments-sidebar-hook-audit
Nov 6, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/sdk-harness-doc-comments-sidebar-hook-audit

Conversation

@ymichael

@ymichael ymichael commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Two doc comments in the plugin SDK testing harness sat one field too early. In RenderedSlotBehaviorDrivers, the comment for emitRealtime ("Push a realtime event…") was on experimental_invalidateRpc. In FakePluginInspectionState, the comment for realtimeSignals ("Every bb.realtime.publish…") was on experimental_onRpcInvalidation. Plugin authors saw the wrong description for four harness members.

Separately, useSidebarThreadDraft, useSidebarThreadDraftIds, useSidebarThreadRowStatus, useSidebarThreadRowStatuses and useSidebarThreadShortcut shipped as public @get-bb/plugin-sdk/app exports without the experimental_ prefix (#4025), and docs/api_to_audit.md had no entry for them. About ten marketplace plugins use them, and Michael decided to keep the names.

What changed

  • packages/plugin-sdk/src/testing/app.tsx: the realtime comment now sits on emitRealtime. experimental_invalidateRpc has its own comment: it invalidates the plugin's useRpc reads tagged with any of tags (null invalidates all of them) inside act, with pluginId defaulting to the rendered plugin.
  • packages/plugin-sdk/src/testing/fake-plugin-host.ts: the realtime comment now sits on realtimeSignals. experimental_onRpcInvalidation and experimental_rpcInvalidations have comments of their own: the first calls a listener on every invalidate or invalidateAll call, and the second records the tags of each invalidation, with null for invalidateAll.
  • docs/api_to_audit.md: a new entry for the five hooks, placed after the experimental_useSidebarThreads entry. It records that they skipped the prefix and must not be renamed without runtime aliases, and it describes each hook's behavior. It names the core callers: the bundled Thread list plugin's ThreadRow and group rollups, and the core primitives that plugin-sidebar-hooks.ts wraps. It lists five audit items to settle before the hooks count as stable.
  • Plugin SDK version bumped from 0.6.132 to 0.6.133 with scripts/bump-plugin-sdk.mjs --patch. The testing declarations are published, so the comment changes ship to npm.

There are no wire, CLI or runtime behavior changes.

How you verified

  • pnpm exec turbo run typecheck --filter=@get-bb/plugin-sdk passes.
  • node .github/workflows/check-plugin-sdk-version.mjs passes. It reports the guarded surface as unchanged, because the testing files are not in its list. The bump is still needed for the npm publish guard.
  • I checked each new comment and each audit-entry claim against the implementation: invalidateTags/pluginTagScope in testing/app.tsx, the rpc.experimental_invalidate* fakes, apps/app/src/lib/plugin-sidebar-hooks.ts, plugins/thread-list/app/rows/ThreadRow.tsx and plugins/thread-list/app/list/*.

CI runs the remaining suites.

🤖 Generated with Claude Code

AGENT GENERATED

…idebar row hooks

The RenderedSlotBehaviorDrivers and FakePluginInspectionState doc comments
sat on the field after the one they describe. Each comment now sits on its
field, and experimental_invalidateRpc, experimental_onRpcInvalidation and
experimental_rpcInvalidations get comments of their own.

useSidebarThreadDraft, useSidebarThreadDraftIds, useSidebarThreadRowStatus,
useSidebarThreadRowStatuses and useSidebarThreadShortcut shipped unprefixed
in #4025 and marketplace plugins depend on the names, so they get an
api_to_audit entry with behavior, core callers and stabilization criteria.

Bumps @get-bb/plugin-sdk to 0.6.133.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 8e4208e into main Nov 6, 2026
94 of 95 checks passed
@ymichael
ymichael deleted the bb/sdk-harness-doc-comments-sidebar-hook-audit branch November 6, 2026 23:46
ymichael added a commit that referenced this pull request Nov 7, 2026
…#7215)

## Human comments

## What was wrong

`ThreadActionsMenu.test.tsx` › "coalesces rows that mount a moment apart
into one change" failed on a Windows CI run of #7208 and passed on
rerun. The thread-id subscription debounce in
`thread-action-registry.tsx` flushes after 32 ms with no new rows (100
ms max wait). The test mounted two rows, slept 20 ms on a real timer,
then added a third. On a slow runner the sleep can last longer than 32
ms, so the first two ids flush on their own and the test sees an extra
change.

## What changed

Only the test changed. The `thread action data input` describe block now
uses `vi.useFakeTimers()`. Vitest 4 fakes `setTimeout` and
`performance.now()` by default, so this controls both the quiet window
and the max wait. Real sleeps and `waitFor` polling were replaced with
`act(() => vi.advanceTimersByTimeAsync(ms))`. The other three tests in
the block used the same real-timer `settle` (150 ms), so they were
converted too. Their assertions are unchanged; each `waitFor` is now a
`settle()` followed by the same `expect`. No other test in the file
relies on real-time delays.

## How you verified

- `pnpm exec turbo run test --filter=@bb/app --
src/components/thread/ThreadActionsMenu.test.tsx`: 64 passed, 1 skipped.
- Ran the file 5 more times: 2 runs in a row, then 3 at the same time to
add load. All passed.
- Mutation check: with `THREAD_IDS_QUIET_MS` lowered to 10, the
coalescing test fails, so it still checks the debounce.
- `turbo run typecheck --filter=@bb/app`, oxlint and prettier: all
clean.

> AGENT GENERATED

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

Co-authored-by: Claude Opus 5.5 <[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