fix: skip _process_selection_event on non-final lasso drag events#6917
Open
mvanhorn wants to merge 3 commits into
Open
fix: skip _process_selection_event on non-final lasso drag events#6917mvanhorn wants to merge 3 commits into
mvanhorn wants to merge 3 commits into
Conversation
…loviz#6548) PopupMixin.on_msg was calling _process_selection_event on every incoming message, including the many partial geometry events fired during a lasso drag. This caused noticeable lag even when no popup is configured. Gate the call so it only runs when _selection_event is set and marks the interaction as final, avoiding redundant async processing on each drag step.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6917 +/- ##
==========================================
- Coverage 89.33% 87.87% -1.46%
==========================================
Files 344 344
Lines 74566 74566
==========================================
- Hits 66613 65528 -1085
- Misses 7953 9038 +1085 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
The failing core test is unrelated the failing ui test seems to be because of this PR. Since you checked of |
Addresses the UI test failure attributed to this PR by scoping the selection-event guard, per review.
Contributor
Author
|
Pushed 7748093 targeting the failing UI test. I was not able to run the Playwright suite in my environment, so CI is the arbiter here - if it is still red I will keep digging. |
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.
Description
PopupMixin.on_msgcalledawait self._process_selection_event()on every incoming message, including the many partial geometry events fired continuously while a user drags a lasso. This caused noticeable lag on every drag step even when no popup is configured.The fix adds a guard so
_process_selection_eventis only invoked when_selection_eventis set and marked as final - i.e., only once after the drag completes, not on each partial update. This mirrors the early-return that already exists inside_process_selection_eventitself (which returns immediately for non-final events), but avoids the overhead of the async call entirely for the many partial drag messages.Existing behaviour for popup users is preserved: final events still trigger the full processing path. No functional change for non-popup users.
Fixes #6548
AI Disclosure
Tool & Model: Claude Code + Sonnet 4.6
Usage: Identified the guard condition to add in
PopupMixin.on_msg; verified with existing unit tests.Checklist