Repository navigation
perf(popup-menu): stop aim-guard updates re-rendering every row - #584
Draft
kianbazza wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kianbazza
force-pushed
the
ui-642-stop-aim-guard-updates-re-rendering-every-row
branch
from
October 10, 2026 23:33
3ed4813 to
c2f1595
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The aim guard context held four pieces of React state next to its refs. Every row consumes the context but only reads the refs, so each guard activate and clear re-rendered every row. The state now lives in its own context, read only by
SubmenuTrigger.The refs context never changes while the provider is mounted. The
logAimGuardEventsdebug flag is read through a ref, so toggling it doesn't re-render rows either.Evidence
row-renders.test.tsx› "keeps sibling rows still while the aim guard activates and clears": four items around a submenu, each wrapped in a<Profiler>. The pointer leaves the submenu trigger toward the submenu (guard activates), then moves inside the submenu (guard clears).AssertionError: Sibling 1: expected 6 to be 4After: passes
The existing aim guard tests (lifecycle, debug logging, continuous aim monitoring, safe triangle visualization) pass unchanged.
Merge Danger
Door: two-way
Blast Radius: small
Internal context only. Rows and
Popupalready read the guard through refs, so their behaviour is unchanged.SubmenuTriggerreads the same state values from a different context.Closes UI-642