Skip to content

Add plugin nav sidebar accessories - #1362

Merged
ymichael merged 4 commits into
mainfrom
bb/1202-plugin-api-allow-a-trailing-accessory-in-na-thr_3v8b52abdb
Aug 12, 2026
Merged

ymichael merged 4 commits into
mainfrom
bb/1202-plugin-api-allow-a-trailing-accessory-in-na-thr_3v8b52abdb

Conversation

@ymichael

@ymichael ymichael commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add experimental_sidebarAccessory to plugin nav panel registrations, the app/testing registration collectors, bundled SDK types, and authoring docs
  • mount accessories in an isolated plugin boundary, omit them on compact viewports, and constrain wide-screen content to a clipped single-line 4rem by 1.25rem box with host-owned 12px accessory typography
  • share the trailing action column: show the live accessory at rest, then fade it for the host options button on hover, keyboard focus, or while its menu is open without remounting plugin state
  • make Tasks the first consumer with a realtime non-terminal task count backed by a targeted SQLite count query and a count-only, burst-coalesced RPC refresh path
  • silently contain accessory crashes and remount their boundary on plugin generation changes so a fixed reload gets a fresh attempt
  • cover compact non-mounting, overflow bounds, accessory-less compatibility, registration validation, live Tasks refreshes, burst coalescing, crash recovery, and accessory lifecycle through the options swap

Design

A no-props component keeps the surface small while letting live accessories own their RPC query and realtime subscription. Updates stay within the accessory subtree instead of lifting state through the sidebar. The accessory is presentational and sits outside the navigation button, preserving the stable accessible name. It shares the trailing action column with the host options button through the existing inverse hover-action CSS, so hover/focus does not remount or reset its live state. The host applies its 12px secondary chrome type scale so accessory values remain subordinate to 13px row labels. Plugin-generation keys reset a latched error boundary after reload, while a non-null empty crash fallback keeps failure local and silent. Tasks single-flights its count-only RPC and reduces any invalidation burst during a request to one trailing refresh. The audit checklist records the component-versus-value, portal, budget, compact lifecycle, and accessibility questions to revisit before stabilization.

No host-daemon protocol bump is needed because this changes the frontend plugin contract and plugin-local RPC response only, not the server/daemon wire contract.

Testing

  • pnpm exec turbo run test --filter=@bb/app --force (336 files, 2549 tests)
  • pnpm exec turbo run test --filter=bb-plugin-tasks --force (35 files, 329 tests)
  • pnpm exec turbo run test --filter=@bb/plugin-sdk --force (9 files, 75 tests)
  • pnpm exec turbo run test --filter=@bb/server --force -- test/services/plugins/plugin-authoring-docs.test.ts
  • pnpm exec turbo run test --filter=@bb/templates --force (4 files, 23 tests)
  • pnpm exec turbo run typecheck --filter=@bb/plugin-sdk --filter=@bb/app --filter=bb-plugin-tasks --filter=@bb/server --filter=@bb/templates --force
  • live dev-server QA for idle, hover, menu-open, realtime count updates, compact mode, final 12px accessory scale, and the dedicated count/summary RPC split
  • generated SDK/template checks, Prettier, and git diff --check

Fixes #1202

AGENT GENERATED: by GPT-5.6

@SawyerHood

Copy link
Copy Markdown
Collaborator

🚨 SLOP COP 🚨 · review

I am the SlopCop. I am reviewing this pull request for security, code quality, performance, duplication, architecture, and end-to-end behavior.

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

ELI5: Plugins can now show a small live label beside a sidebar item. Tasks uses this label to show the open-task count.

I found three concrete issues:

  • Medium: A crashed accessory stays crashed after a plugin reload. The mount needs a React key that includes panel.generation.

  • Medium: Each Tasks change signal starts another broad summary request. Add a count-only RPC and coalesce signals during an active request.

  • Low: crashFallback={null} selects the default crash chip. Use a non-null empty fallback so a crash hides the accessory.

The authoring skill also says a headerContent crash hides the accessory. Change that phrase to “header content.”

I found no new data exposure, authorization error, or unsafe navigation path. The repeated host and test-harness validation follows the current SDK contract design.

Validation passed on the exact head SHA. GitHub CI passed all required checks. Local Turbo type checks and package tests passed.

The browser test passed on wide and compact viewports. It also passed route navigation and a live count update from 9 to 10. I stopped the dev app after the test.

Please fix the three inline findings before merge.

@ymichael
ymichael force-pushed the bb/1202-plugin-api-allow-a-trailing-accessory-in-na-thr_3v8b52abdb branch from abd4791 to 07a1964 Compare August 12, 2026 03:02
@ymichael
ymichael force-pushed the bb/1202-plugin-api-allow-a-trailing-accessory-in-na-thr_3v8b52abdb branch from 1b88128 to e28b90f Compare August 12, 2026 03:25
@ymichael
ymichael merged commit 5e1c522 into main Aug 12, 2026
10 checks passed
@ymichael
ymichael deleted the bb/1202-plugin-api-allow-a-trailing-accessory-in-na-thr_3v8b52abdb branch August 12, 2026 03:57
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.

Plugin API: allow a trailing accessory in nav panel sidebar rows

2 participants