feat/bl-status-browser#1181
Conversation
Benchmark comparisonThreshold: 20% (lower is better). No benchmark regression exceeded the configured threshold. No benchmark improvement exceeded the configured threshold. All benchmark results
|
26fb4d9 to
9047d69
Compare
f6951b9 to
084e871
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new Beamline State Manager UI to browse/manage BEC beamline states, backed by a reusable Pydantic-to-Qt form generator, and includes several UI/theming and widget-IO fixes plus new tests.
Changes:
- Introduces
BeamlineStateManager/BeamlineStatePillwidgets (dialogs, filtering, update/revert/remove flows) and registers them for Designer/CLI. - Adds
PydanticWidgetFormto generate Qt forms from Pydantic models (including Device/Signal combobox integration and optional-value handling). - Improves theming/helpers (colors + notifications), updates device/signal combobox behavior, and expands unit/e2e test coverage.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit_tests/test_widget_io.py | Adds unit coverage for WidgetIO support of Device/Signal comboboxes. |
| tests/unit_tests/test_notifications.py | Adds tests for theme-change propagation, light-mode traceback styling, and defensive event filters. |
| tests/unit_tests/test_name_utils.py | Adds tests for new sanitize_identifier() helper. |
| tests/unit_tests/test_main_widnow.py | Removes a status-tip event test tied to the removed event() override. |
| tests/unit_tests/test_generated_form_form.py | Adds comprehensive unit coverage for PydanticWidgetForm behavior and widget selection. |
| tests/unit_tests/test_dock_area.py | Ensures BeamlineStateManager docks correctly and is exposed via toolbar actions. |
| tests/unit_tests/test_device_signal_input.py | Adds coverage for disabled group headers and updated validity styling behavior. |
| tests/unit_tests/test_device_input_widgets.py | Updates expectations for disabled combobox validity styling (stylesheet cleared). |
| tests/unit_tests/test_color_utils.py | Adds tests for new color/theme helpers (get_theme_name, theme_color, rgba). |
| tests/unit_tests/test_beamline_state_pill.py | Adds extensive unit coverage for beamline state pills/manager/dialog flows. |
| tests/end-2-end/test_beamline_state_manager_e2e.py | Adds an e2e test validating real BEC beamline-state integration. |
| bec_widgets/widgets/services/beamline_states/register_beamline_state_pill.py | Designer registration entrypoint for BeamlineStatePill. |
| bec_widgets/widgets/services/beamline_states/register_beamline_state_manager.py | Designer registration entrypoint for BeamlineStateManager. |
| bec_widgets/widgets/services/beamline_states/dialogs.py | Implements add-state dialog and status/device filter dialogs. |
| bec_widgets/widgets/services/beamline_states/beamline_state_pill.pyproject | Declares Designer plugin project for pill widget module. |
| bec_widgets/widgets/services/beamline_states/beamline_state_pill.py | Implements BeamlineStatePill + BeamlineStateManager widgets, model/delegate/view. |
| bec_widgets/widgets/services/beamline_states/beamline_state_pill_plugin.py | Designer plugin wrapper for BeamlineStatePill. |
| bec_widgets/widgets/services/beamline_states/beamline_state_manager.pyproject | Declares Designer plugin project for manager widget module. |
| bec_widgets/widgets/services/beamline_states/beamline_state_manager_plugin.py | Designer plugin wrapper for BeamlineStateManager. |
| bec_widgets/widgets/services/beamline_states/init.py | Package init (kept empty). |
| bec_widgets/widgets/control/device_input/signal_combobox/signal_combobox.py | Fixes validity styling, safer enabled-item checks, and group-header disabling. |
| bec_widgets/widgets/control/device_input/device_combobox/device_combobox.py | Fixes validity styling so disabled/valid clears local stylesheet. |
| bec_widgets/widgets/containers/main_window/main_window.py | Removes status-tip swallowing event() override. |
| bec_widgets/widgets/containers/main_window/addons/notification_center/notification_banner.py | Improves theme integration, light-mode styling, and event-filter robustness. |
| bec_widgets/widgets/containers/dock_area/dock_area.py | Adds BeamlineStateManager to dock-area utilities toolbar. |
| bec_widgets/utils/widget_io.py | Adds specialized handlers for Device/Signal comboboxes. |
| bec_widgets/utils/name_utils.py | Adds sanitize_identifier() utility for normalizing user-provided names. |
| bec_widgets/utils/forms_from_types/pydantic_widget_form.py | Adds PydanticWidgetForm + OptionalValueWidget for Pydantic-driven Qt forms. |
| bec_widgets/utils/colors.py | Adds theme_color/rgba helpers; refactors colormap formatting helpers. |
| bec_widgets/cli/designer_plugins.py | Registers new beamline-state widgets in Designer plugin mappings and icons. |
| bec_widgets/cli/client.py | Exposes new widgets via the RPC/CLI client surface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
084e871 to
985f0a6
Compare
fe4e40f to
14c2b66
Compare
069a2d3 to
463183d
Compare
3897451 to
8ad9d86
Compare
… used settings widgets if state is not dirty
8ad9d86 to
808d434
Compare
351c00e to
dd96596
Compare
Description
This PR adds a Beamline State Manager widget for browsing and managing BEC beamline states from the GUI.
The widget displays all configured BEC beamline states as status pills with semantic styling for
VALID,WARNING,INVALID, and unknown states. Pills can be expanded to inspect and edit the underlying Pydantic config, update parameters, revert unsaved changes, or remove a state. New states can be added from the manager toolbar using generated forms based on the beamline-state config models.A reusable
PydanticWidgetFormutility was introduced to generate Qt forms from Pydantic models using field types and metadata. This keeps the beamline-state UI generic and avoids hard-coding individual config fields such as limits or tolerance.The PR also includes supporting cleanup and fixes discovered while integrating the widget in the dock area and companion app: shared color/theme helpers, improved notification light-mode styling, safer notification event filters, incremental model updates for the beamline-state list, and device/signal combobox fixes.
Type of Change
BeamlineStateManagerandBeamlineStatePillwidgets.PydanticWidgetFormutility withDeviceComboBoxandSignalComboBoxsupport throughWidgetIO.QEventinputs from PySide.How to test
BeamlineStateManagerfrom the utilities toolbar.samx, move the device in/out of range, and verify the pill updates immediately.Potential side effects
BeamlineStateManageruses Qt model/view with persistent pill editors. This is the right structure for filtering and incremental updates, but row widget lifetime is managed by Qt, so future changes should avoid full model resets unless all pills should be recreated.PydanticWidgetFormis generic and may be reused beyond beamline states, but currently only covers the widget types needed here.QEventinputs defensively; valid Qt events are unchanged.Additional Comments
Should be tested at least with
becbranch `fix/field-types-in-bl-states