Skip to content

Avoid rerendering existing plugin overlays - #2983

Merged
ymichael merged 1 commit into
mainfrom
bb/assess-pull-request-importance-thr_38v4xchcew
Sep 3, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/assess-pull-request-importance-thr_38v4xchcew

Conversation

@ymichael

@ymichael ymichael commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

PluginAppOverlays subscribed to the full slot snapshot and rendered every overlay directly from its list. Each slot-store notification therefore rendered every existing overlay again even when its stable slot object had not changed, causing sequential registrations to do triangular render work. This addresses the low-priority finding from the app-overlay review.

What changed

Extracted each overlay mount into a memoized component that receives the stable overlay slot object. Adding or removing another plugin overlay still updates the host list, while unchanged overlay subtrees skip the parent-driven render. A plugin re-registration still supplies a new slot object and generation key, preserving the existing replacement behavior. Added a focused render-count regression test. This is app-local React behavior with no server/daemon wire change, so HOST_DAEMON_PROTOCOL_VERSION is unchanged.

How you verified

  • Added a regression test that registers a second overlay and verifies the first overlay renders only once.
  • pnpm exec turbo run test --filter=@bb/app -- --run src/components/plugin/PluginAppOverlays.test.tsx — 3 tests passed.
  • pnpm exec turbo run typecheck --filter=@bb/app — passed.
  • pnpm exec turbo run lint --filter=@bb/app — passed with zero errors.
  • git diff --check — passed.

AGENT GENERATED

@ymichael
ymichael merged commit 89675d8 into main Sep 3, 2026
15 checks passed
@ymichael
ymichael deleted the bb/assess-pull-request-importance-thr_38v4xchcew branch September 3, 2026 02:46
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