Skip to content

Theme Change subscriptions#1245

Open
wyzula-jan wants to merge 2 commits into
mainfrom
fix/theme-subs
Open

Theme Change subscriptions#1245
wyzula-jan wants to merge 2 commits into
mainfrom
fix/theme-subs

Conversation

@wyzula-jan

Copy link
Copy Markdown
Contributor

Description

Some widgets were explicitely connecting to theme updates, however bec widget base class is normally taking care of it. This resolves in another layer of double subscriptions on theme updates.

Since there is no motivation to not follow the theme updates, bool kwarg theme_update is completely removed.

Related Issues

related to #1244 but fixes different issue.

Copilot AI review requested due to automatic review settings July 15, 2026 14:54
@wyzula-jan wyzula-jan self-assigned this Jul 15, 2026
@wyzula-jan
wyzula-jan requested a review from a team July 15, 2026 15:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes explicit widget theme-change subscriptions that were redundantly added on top of BECWidget’s theme handling, eliminating a layer of double subscriptions. It also removes the theme_update kwarg entirely and standardizes theme subscription behavior across all BECWidget subclasses.

Changes:

  • Removed the theme_update kwarg from BECWidget and all call sites/signatures.
  • Centralized theme-change subscription by having BECWidget always connect to application theme changes.
  • Removed per-widget manual theme-change connections that previously caused duplicate subscriptions.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit_tests/test_busy_loader.py Updates test widget constructor to match removed theme_update kwarg.
bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/services/scan_history_browser/scan_history_browser.py Removes theme_update plumbing and stops forwarding it to subcomponents.
bec_widgets/widgets/services/scan_history_browser/components/scan_history_view.py Removes theme_update argument and relies on BECWidget default behavior.
bec_widgets/widgets/services/scan_history_browser/components/scan_history_metadata_viewer.py Removes theme_update argument and docstring reference.
bec_widgets/widgets/services/scan_history_browser/components/scan_history_device_viewer.py Removes theme_update argument and relies on base behavior.
bec_widgets/widgets/services/device_browser/device_item/device_signal_display.py Removes theme_update argument and simplifies base init call.
bec_widgets/widgets/services/device_browser/device_item/device_config_form.py Removes extra manual theme-signal connection to avoid double subscription.
bec_widgets/widgets/services/bec_atlas_admin_view/experiment_selection/experiment_mat_card.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/services/beamline_states/beamline_state_pill.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/services/beamline_states/beamline_state_manager.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/progress/bec_progressbar/bec_progressbar.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/plots/waveform/waveform.py Removes redundant manual theme-change connection (now handled by base).
bec_widgets/widgets/plots/plot_base.py Removes redundant manual theme-change connection and relies on BECWidget.
bec_widgets/widgets/plots/heatmap/heatmap.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/editors/monaco/monaco_widget.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/control/device_manager/components/ophyd_validation/ophyd_validation.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/control/device_input/device_combobox/device_combobox.py Drops explicit theme_update=True in base init call.
bec_widgets/widgets/containers/main_window/main_window.py Removes redundant manual theme-change connection.
bec_widgets/utils/palette_viewer.py Drops explicit theme_update=True in base init call.
bec_widgets/utils/help_inspector/help_inspector.py Drops explicit theme_update=True in base init call.
bec_widgets/utils/forms_from_types/forms.py Renames internal helper to clarify it only wires pretty-display styling to theme updates.
bec_widgets/utils/busy_loader.py Updates demo widget constructor to match removed theme_update kwarg.
bec_widgets/utils/bec_widget.py Removes theme_update kwarg and makes theme subscription unconditional in BECWidget.

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

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark comparison

Threshold: 20% (lower is better).
Result: 0 regression(s), 0 improvement(s) beyond threshold.

No benchmark regression exceeded the configured threshold.

No benchmark improvement exceeded the configured threshold.

All benchmark results
Benchmark Baseline Current Change Status
BEC IPython client with companion app 2.20399 s 2.10257 s -4.60% ok
BEC IPython client without companion app 2.18623 s 2.12271 s -2.91% ok
Import bec_widgets 0.0131978 s 0.0135197 s +2.44% ok
tests/unit_tests/benchmarks/test_dock_area_benchmark.py::test_add_waveform_to_dock_area 0.158608 s 0.156952 s -1.04% ok

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants