Skip to content

fix: skip _process_selection_event on non-final lasso drag events#6917

Open
mvanhorn wants to merge 3 commits into
holoviz:mainfrom
mvanhorn:fix/6548-laggy-lasso-selection
Open

fix: skip _process_selection_event on non-final lasso drag events#6917
mvanhorn wants to merge 3 commits into
holoviz:mainfrom
mvanhorn:fix/6548-laggy-lasso-selection

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Description

PopupMixin.on_msg called await 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_event is only invoked when _selection_event is 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_event itself (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.

  • I have tested all AI-generated content in my PR.
  • I take responsibility for all AI-generated content in my PR.

Checklist

  • Pull request title follows the conventional format
  • Tests added and are passing
  • Added documentation

…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

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.87%. Comparing base (a2465cf) to head (0825e71).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
holoviews/plotting/bokeh/callbacks.py 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hoxbro

hoxbro commented Jun 13, 2026

Copy link
Copy Markdown
Member

The failing core test is unrelated the failing ui test seems to be because of this PR.

Since you checked of Tests added and are passing did these pass locally for you?

hoxbro and others added 2 commits June 16, 2026 07:25
Addresses the UI test failure attributed to this PR by scoping the
selection-event guard, per review.
@mvanhorn

Copy link
Copy Markdown
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.

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.

Laggy lasso-selection

2 participants