Repository navigation
perf(context-menu): register global pointer listeners only while open - #4635
Merged
Y-PLONI merged 3 commits intoNov 9, 2026
Merged
Conversation
palmoni5
marked this pull request as ready for review
November 8, 2026 23:11
Y-PLONI
force-pushed
the
palmoni5/context-menu-open-only-global-route-20261108
branch
from
November 9, 2026 13:56
c89cdd0 to
fcea9df
Compare
Y-PLONI
force-pushed
the
palmoni5/context-menu-open-only-global-route-20261108
branch
from
November 9, 2026 18:43
fcea9df to
f17bcf0
Compare
Y-PLONI
deleted the
palmoni5/context-menu-open-only-global-route-20261108
branch
November 9, 2026 18:43
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.
Problem
Every focusable
AppSubmenuButtonregistered a global pointer route when built, even when its submenu was closed. Large popup menus containing many submenu rows therefore executed O(N) per-pointer listener dispatch and checks across the application.Change
Track the global pointer route only while the particular focusable submenu is open. Remove it on close, focus-policy switch and widget disposal; retain it when a replacement controller takes over an open submenu. Focus-preserving context submenus continue to register no route.
Regression coverage
Update the existing lifecycle test and add a 40-submenu test asserting zero routes while closed, one while the selected submenu is open, and no residual routes after close/disposal. Existing pointer exit behavior and focus tests remain in the package.
תיקון הרגרסיות ואימות
החלפת controller משמרת את מעקב העכבר של התפריט הפתוח, כי ה־anchor נשמר ומתחבר לבקר החדש. שינוי
preserveFocusמסיר את המעקב, כי החלפת מעטפת ה־FocusScope יוצרת anchor חדש וסגור. נוספו 14 תרחישי בדיקה למחזור החיים, כולל החלפת בקר, שני כיווני שינוי המדיניות, טיימר סגירה ממתין, dispose וריקון ילדים. שלושה תרחישים נכשלו לפני התיקון ועברו אחריו.לאחר rebase על
dev@6379362d9b5d9f4cdf0218b37a72af024bc7c4c1: ניתוח נקי; 78 בדיקות החבילה שב־git ו־117 בדיקות שילוב תפריטים עברו. שני תרחישי שחזור מקומיים נוספים עברו. בדיקות השילוב השתמשו בדילוג זמני על בניית מנוע נייטיבי שאינו קשור לתפריטים; קובצי pubspec וה־lockfile הוחזרו ללא שינוי. סקירת קוד עצמאית נוספת של Luna הסתיימה ללא ממצאים חוסמים. CI עדיין בתור בעת האימות; לא המתנו לו.בדיקת חפיפות מלאה: #4269 ו־#4525 נוגעים בקובצי חבילה אחרים, ללא חפיפה ב־
submenu_button.dart.