Skip to content

perf(loader/ui): optimize inspector refresh during drag selection#1849

Merged
philippe-ynput merged 6 commits into
ui-qt-browserfrom
optimize-inspector-refresh-when-drag-selecting
May 28, 2026
Merged

perf(loader/ui): optimize inspector refresh during drag selection#1849
philippe-ynput merged 6 commits into
ui-qt-browserfrom
optimize-inspector-refresh-when-drag-selecting

Conversation

@philippe-ynput
Copy link
Copy Markdown
Contributor

@philippe-ynput philippe-ynput commented May 20, 2026

Changelog Description

Prevent unnecessary refreshes while mouse is pressed during drag selection in the ReviewInspector. The inspector now computes an expected refresh time to avoid filling the task queue with redundant update requests.

This reduces UI flickering and improves performance when selecting multiple items via drag in the review inspector panel.

Additional info

none

Testing notes:

  1. open browser.
  2. click-drag select stuff.
  3. the inspector should only update when the mouse button is released.

Prevent unnecessary refreshes while mouse is pressed during drag selection
in the ReviewInspector. The inspector now only updates when the selection
is finalized (on mouse release) rather than during the selection process.

This reduces UI flickering and improves performance when selecting
multiple items via drag in the review inspector panel.

Signed-off-by: philippe-ynput <philippe@ynput.io>
@philippe-ynput philippe-ynput requested a review from BigRoy May 20, 2026 15:14
@philippe-ynput philippe-ynput self-assigned this May 20, 2026
@philippe-ynput philippe-ynput added the type: enhancement Improvement of existing functionality or minor addition label May 20, 2026
@ynbot ynbot added the size/XS label May 20, 2026
Signed-off-by: philippe-ynput <philippe@ynput.io>
Introduce a QTimer-based throttling mechanism in ReviewInspector to
dynamically adjust update frequency during drag selection operations.

The implementation measures the base update time during the first selection
and scales the throttle interval proportionally to the number of selected
items. This provides adaptive performance optimization while maintaining
responsiveness during interactive selection operations.

Timer is properly managed with start/stop calls during mouse press/release
events to ensure clean resource handling.

Signed-off-by: philippe-ynput <philippe@ynput.io>
Calculate update interval in milliseconds for more precise timing
Sort thumbnail keys to reduce cache misses
Remove debug print statement

Signed-off-by: philippe-ynput <philippe@ynput.io>
@philippe-ynput philippe-ynput requested a review from Copilot May 26, 2026 13:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Optimizes ReviewInspector refresh behavior during drag selection to reduce UI flicker and improve responsiveness/performance.

Changes:

  • Adds mouse press/release tracking via an event filter on the view viewport.
  • Introduces a QTimer-driven throttling mechanism during drag interactions.
  • Sorts thumbnail keys before loading to reduce cache misses.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
client/ayon_core/tools/loader/ui/review_inspector.py Adds mouse tracking + throttled updates for drag selection; tweaks thumbnail loading order.
client/ayon_core/tools/loader/ui/_review_table.py Removes a stray blank line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/ayon_core/tools/loader/ui/review_inspector.py
Comment thread client/ayon_core/tools/loader/ui/review_inspector.py Outdated
Comment thread client/ayon_core/tools/loader/ui/review_inspector.py
Comment thread client/ayon_core/tools/loader/ui/review_inspector.py
Comment thread client/ayon_core/tools/loader/ui/review_inspector.py
@ynbot ynbot moved this to Review In Progress in PR reviewing May 28, 2026
Ensure inspector refreshes maintain at least 16ms interval
to prevent excessive updates during rapid drag selection

Signed-off-by: philippe-ynput <philippe@ynput.io>
@philippe-ynput philippe-ynput merged commit c63fdf6 into ui-qt-browser May 28, 2026
@philippe-ynput philippe-ynput deleted the optimize-inspector-refresh-when-drag-selecting branch May 28, 2026 13:57
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in PR reviewing May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS type: enhancement Improvement of existing functionality or minor addition

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants