fix: synchronize loaded MDA channel group#551
Conversation
(cherry picked from commit 75f1a82)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #551 +/- ##
==========================================
+ Coverage 87.42% 87.43% +0.01%
==========================================
Files 115 115
Lines 14081 14093 +12
==========================================
+ Hits 12310 12322 +12
Misses 1771 1771 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| self._group_combo.setStyleSheet( | ||
| "QComboBox { border: 1px solid #c2410c; background: #fff7ed; }" | ||
| ) |
There was a problem hiding this comment.
We are currently trying to purge the whole widgets codebase of all hard-coded styles like this (I know we have them scattered about, but it's an antipattern that is making it harder for us to successfully apply global dark/light themes and styles, which is an active work in progress).
Also: it really would be useful to have screenshots provided with all PRs that make visual changes so I can see what the intention is without having to pull, spin it up, and figure out how to trigger the change)
side note: this would be the sort of information that we should absolutely have in an agents.txt document so that it's not just in our heads and llm agents can actively take it into consideration
|
Hi Talley, that makes sense. I removed the hard-coded stylesheet and kept
this as a tooltip-only warning for now.
I’ll also try to include screenshots for future PRs that change the UI.
That one I should have kept it for later, I am planning to use the stage
explorer to locate positions within a microfluidics device, will submit the
code when ready.
Best,
Gilles
…On Tue, Apr 7, 2026 at 3:15 PM Talley Lambert ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/pymmcore_widgets/useq_widgets/_channels.py
<#551 (comment)>
:
> + self._group_combo.setStyleSheet(
+ "QComboBox { border: 1px solid #c2410c; background: #fff7ed; }"
+ )
We are currently trying to purge the whole widgets codebase of all
hard-coded styles like this (I know we have them scattered about, but it's
an antipattern that is making it harder for us to successfully apply global
dark/light themes and styles, which is an active work in progress).
Also: it really would be useful to have screenshots provided with all PRs
that make visual changes so I can see what the intention is without having
to pull, spin it up, and figure out how to trigger the change)
------------------------------
*side note: this would be the sort of information that we should
absolutely have in an agents.txt document so that it's not just in our
heads and llm agents can actively take it into consideration*
—
Reply to this email directly, view it on GitHub
<#551 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNNA6C47WJ7R27LZSGUIHL4UT5Q5AVCNFSM6AAAAACXPDOUQGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DANRYGMZTQNJTGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
|
||
| # ------------------- Private API ------------------- | ||
|
|
||
| def _set_loaded_group_warning(self, group: str | None) -> None: |
There was a problem hiding this comment.
ok, now that I ran this example I have a better sense for what it's fixing. Thank you!
And I see what the tooltip is doing know. However, I think I want to remove this _set_loaded_group_warning path altogether in favor of a direct python warnings.warn() on line 143. I know that that doesn't immediately surface in the GUI (it will show in the console, which the user may not be monitoring). but in the real, composed pymmcore-gui app, we can globally monitor warnings, and show a notification toast. This way we can avoid having little ad-hoc UI changes in each widget. Will that work for you?
|
Yes, that works for me. I removed the tooltip/UI path and switched this to
a direct `warnings.warn()` when the loaded group is not available.
I agree that letting the composed GUI handle warnings globally is cleaner
than adding ad-hoc UI feedback inside the widget.
Best
Gilles
…On Tue, Apr 7, 2026 at 5:00 PM Talley Lambert ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/pymmcore_widgets/useq_widgets/_channels.py
<#551 (comment)>
:
> super().setValue(_values)
# ------------------- Private API -------------------
+ def _set_loaded_group_warning(self, group: str | None) -> None:
ok, now that I ran this example I have a better sense for what it's
fixing. Thank you!
And I see what the tooltip is doing know. However, I think I want to
remove this _set_loaded_group_warning path altogether in favor of a
direct python warnings.warn() on line 143. I know that that doesn't
immediately surface in the GUI (it will show in the console, which the user
may not be monitoring). but in the real, composed pymmcore-gui app, we can
globally monitor warnings, and show a notification toast. This way we can
avoid having little ad-hoc UI changes in each widget. Will that work for
you?
—
Reply to this email directly, view it on GitHub
<#551 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNNA6DIFZRH4Z2TPVBRCY34UUJX5AVCNFSM6AAAAACXPDOUQGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DANRZGEZDCMBQGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Head branch was pushed to by a user without write access
Summary
When loading MDA channels, synchronize the selected channel group before setting the channel table row values.
This ensures the config/preset column is rebuilt with the correct preset choices before row data are applied. If the loaded sequence references a channel group that is not available in the current Micro-Manager configuration, the widget now emits a Python warning instead of silently showing mismatched presets.
Background
This came from loading saved MDA settings on a TiEclipse configuration where the channel group/preset did not restore correctly at application startup/load time.
Validation