Skip to content

Fix three GUI runtime errors surfaced while browsing#8

Merged
jacobson30-bot merged 1 commit into
mainfrom
fix-gui-runtime-errors
Jun 5, 2026
Merged

Fix three GUI runtime errors surfaced while browsing#8
jacobson30-bot merged 1 commit into
mainfrom
fix-gui-runtime-errors

Conversation

@jacobson30-bot
Copy link
Copy Markdown
Contributor

Three independent issues seen in the terminal while clicking around the app.

1. FFT reconstruct mode combo — AttributeError

currentIndexChanged emits the combo's int index, which was connected straight to _update_reconstruct_status(res=…). Changing the mode then ran int.imag_residual_normAttributeError. Fixed by dropping the index via a lambda. (fft_viewer_reconstruct_mixin.py)

2. stm_background ROI preview — render_scan_image failed

A step with fit_region='active_roi' crashed every thumbnail/preview render: apply_processing_state runs without a roi_set, the mask helper warned "ROI fit mask ignored" and returned None, but the kernel still got active_roi + mask=None and raised. Now degrades to a whole-image fit when the mask can't be resolved — matching the warning. (state.py) + regression test.

3. missing font family "Courier" warning (~95 ms alias lookup)

Many mono labels used QFont("Courier", n); "Courier" is only an alias on macOS/Windows. Added typography.mono_font() backed by the real platform fixed-width family (QFontDatabase FixedFont, mirroring the existing ui_font) and routed every mono label through it; dropped now-unused QFont/Path imports.

Tests: active_roi-without-roi_set degrade (real kernel, passes locally) and a reconstruct-mode toggle exercising the combo signal (runs in CI's offscreen Qt).

🤖 Generated with Claude Code

1. FFT reconstruct mode combo crash. currentIndexChanged emits the int index,
   which was wired straight to _update_reconstruct_status(res=...) — so changing
   the mode called int.imag_residual_norm and raised AttributeError. Drop the
   index via a lambda.

2. stm_background ROI preview crash. A step with fit_region='active_roi' fit to
   an ROI crashed every thumbnail/preview render (render_scan_image failed):
   apply_processing_state had no roi_set, _resolve_mask_roi_param warned "ROI
   fit mask ignored" and returned None, but the kernel still received
   active_roi + mask=None and raised. Degrade to a whole-image fit when the mask
   can't be resolved, matching the warning.

3. "missing font family 'Courier'" warning + ~95 ms alias lookup. Many labels
   used QFont("Courier", n); "Courier" is only an alias on macOS/Windows. Add
   typography.mono_font() backed by the real platform fixed-width family
   (QFontDatabase FixedFont, like the existing ui_font) and route every mono
   label through it. Drop now-unused QFont/Path imports.

Tests: active_roi-without-roi_set degrade (real kernel) and a reconstruct-mode
toggle that exercises the combo signal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jacobson30-bot jacobson30-bot merged commit c74dc9e into main Jun 5, 2026
3 checks passed
@jacobson30-bot jacobson30-bot deleted the fix-gui-runtime-errors branch June 5, 2026 05:46
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.

1 participant