fix/remove-custom-progressbar#1178
Conversation
cee4514 to
dd7e029
Compare
Benchmark comparisonThreshold: 20% (lower is better). 2 benchmark(s) regressed beyond the configured threshold.
No benchmark improvement exceeded the configured threshold. All benchmark results
|
980e0dc to
3b4ec66
Compare
…h native QProgressBar
b0faeb5 to
b6b768e
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
cea2f10 to
35ce5a4
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the scan/device progress UI to remove custom-painted progress rendering and centralize progress-message tracking in a shared backend, improving robustness for widgets embedded in the BECMainWindow.
Changes:
- Replaces the custom-painted
BECProgressBarimplementation with a nativeQProgressBar-backed widget, while preserving state coloring and label formatting. - Introduces
BECProgressTracker(progress_backend.py) to unify scan/device progress subscription, task lifecycle, and snapshot emission across widgets. - Updates ScanProgressBar, Ring progress bar, and related unit tests to use the new tracker and the native progress bar behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
bec_widgets/widgets/progress/progress_backend.py |
New shared progress tracking backend (source selection, task timing, snapshots, subscriptions). |
bec_widgets/widgets/progress/scan_progressbar/scan_progressbar.py |
Migrates ScanProgressBar to use BECProgressTracker and forwards UI updates from snapshots. |
bec_widgets/widgets/progress/bec_progressbar/bec_progressbar.py |
Replaces custom painting/animation with a native QProgressBar implementation + dynamic stylesheet handling. |
bec_widgets/widgets/progress/ring_progress_bar/ring.py |
Switches scan/device progress wiring to BECProgressTracker and updates cleanup/disconnect behavior. |
bec_widgets/widgets/containers/main_window/main_window.py |
Adjusts status-bar scan progress sizing and configures dynamic stylesheet behavior for compact/full variants. |
tests/unit_tests/test_bec_progressbar.py |
Updates tests to assert native QProgressBar behavior, formatting, and dynamic stylesheet logic. |
tests/unit_tests/test_scan_progress_bar.py |
Updates ScanProgressBar tests to reflect tracker-based lifecycle and new status mappings. |
tests/unit_tests/test_ring_progress_bar_ring.py |
Updates ring progress tests to expect tracker-based dispatcher connections and cleanup behavior. |
tests/unit_tests/test_device_initialization_progress_bar.py |
Adjusts assertions to read native QProgressBar text formatting. |
tests/unit_tests/test_main_widnow.py |
Adds coverage for compact scan progress sizing in the main window status bar. |
bec_widgets/cli/client.py |
Updates CLI proxy docstring to match the new native progress bar implementation. |
Comments suppressed due to low confidence (1)
bec_widgets/widgets/progress/scan_progressbar/scan_progressbar.py:27
- Docstring uses inconsistent capitalization for widget names. Use the actual class names/casing (BECProgressBar, QProgressBar) to avoid confusion and make it searchable.
"""
Widget to display a progress bar that is hooked up to the scan progress of a scan.
If you want to manually set the progress, it is recommended to use the BECProgressbar or QProgressbar directly.
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
35ce5a4 to
181f530
Compare
b91c676 to
439da68
Compare
…empting to add QLayout "" to ScanGroupBox "", which already has a layout`
439da68 to
53cf334
Compare
Description
Since this widget is present in
MainWindow, it should be rock solid. This PR replaces the custompaintEvent-based progress bar with a nativeQProgressBar.It also unifies progress handling for
ScanProgressBarandRingProgressBarthrough a shared progress backend. The scan progress widget now consumes the new progress messages emitted by BEC directly, instead of decoding scan queue state and report instructions on the widget side.One non-trivial part remains in the native progress bar styling: the dynamic stylesheet logic. This is needed to compensate for the way
QProgressBar::chunkhandles border radius, especially at low progress values, so the rounded progress fill keeps a visually correct curvature without falling back to custom painting.