mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 18:11:04 +08:00
Limit the Context Menu items showed to the ones that would change the entries if applied. For example, if an entry has no descendants, we don't need to show "Collapse function" item since it would not do anything. To achieve this, before the Context Menu is open, call FindPossibleContextMenuActions that checks which actions are possible, and only show those in the Context Menu. In next CLs I will add some cache for storing descendants and repeating descendants that are calculated in findPossibleActions function since we are likely recalculating those again when the action is actually selected and applied. However, even without cache this change does not cause a noticeable delay in opening the Context Menu. Bug: 1469887 Change-Id: Idda2420db768996f75e60a13a385da1f729ab85d Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5163632 Reviewed-by: Andres Olivares <andoli@chromium.org> Commit-Queue: Alina Varkki <alinavarkki@chromium.org>