- One _apply_alignment_result() replaces the five copies of the
cache-clear / generation-bump / Aligned-View-checkbox dance, and
_on_manual_alignment_saved/_cleared collapse into a shared
_manual_alignment_changed.
- QSignalBlocker context managers replace every hand-rolled
blockSignals(True)/set/blockSignals(False) triple (11 sites).
- _make_dspin() replaces the 11 four-to-seven-line QDoubleSpinBox
constructions; _axes_extent() replaces the duplicated imshow-extent
formula; _is_fft_mode() replaces the repeated CH1-mode guard.
- Jobs constants replace the stringly-typed background-job keys.
- The two 160-line widget builders split along their section banners:
_build_left_panel -> file/info/view/roi groups, the manual-alignment
_build_ui -> six per-group builders + _connect_controls.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 2790-line module becomes sras_viewer/: common.py (constants +
layout helpers), canvases.py (RoiQuad, ImageCanvas, WaveformCanvas,
ManualAlignOverlayCanvas), dialogs.py (FftOptionsDialog,
ManualAlignmentDialog), main_window.py (SrasViewerWindow + main), with
__init__ re-exporting the public names and __main__ keeping
`python -m sras_viewer` working. pyproject gains a `sras-viewer`
console script.
Code moved verbatim; only import headers are new (pyflakes-clean).
tests/test_gui.py patch targets follow the classes to their new
modules.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>