From cb5837d90f03c02c56fd017f9eb714a2164e1753 Mon Sep 17 00:00:00 2001 From: Dawn Date: Mon, 17 Aug 2026 16:50:49 +0200 Subject: [PATCH] fix: no auto-switch to beamline view during Sample alignment Busy in Sample alignment IS the alignment (centring moves) - yanking the view away to the combined beamline tab hid exactly what the user was doing. The motion-watch switch now skips that state; robot exchange and other busy transitions still switch as before. Co-Authored-By: Claude Fable 5 --- src/aare/gui/main_window.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/aare/gui/main_window.py b/src/aare/gui/main_window.py index ea663b8a..115c080c 100644 --- a/src/aare/gui/main_window.py +++ b/src/aare/gui/main_window.py @@ -2773,8 +2773,12 @@ class MainWindow(QMainWindow): # Busy (or the robot station) means something is physically moving: # show the Beamline combined view so the motion can be watched, and # return to the sample camera once it is done. Edge-triggered so a - # manual tab choice survives between transitions. - moving = bool(s.busy) or s.state == BeamlineStateEnum.RobotSampleExchange + # manual tab choice survives between transitions. Sample alignment is + # the exception: its busy moves ARE the alignment, and the user needs + # to keep watching the sample camera, not the beamline view. + moving = ( + bool(s.busy) or s.state == BeamlineStateEnum.RobotSampleExchange + ) and s.state != BeamlineStateEnum.SampleAlignment if moving and not self._watching_motion: self._watching_motion = True self.video_tab.setCurrentWidget(self.beamline_combined_panel)