Fix three GUI runtime errors surfaced while browsing#8
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three independent issues seen in the terminal while clicking around the app.
1. FFT reconstruct mode combo —
AttributeErrorcurrentIndexChangedemits the combo's int index, which was connected straight to_update_reconstruct_status(res=…). Changing the mode then ranint.imag_residual_norm→AttributeError. Fixed by dropping the index via a lambda. (fft_viewer_reconstruct_mixin.py)2.
stm_backgroundROI preview —render_scan_image failedA step with
fit_region='active_roi'crashed every thumbnail/preview render:apply_processing_stateruns without aroi_set, the mask helper warned"ROI fit mask ignored"and returnedNone, but the kernel still gotactive_roi+mask=Noneand 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. Addedtypography.mono_font()backed by the real platform fixed-width family (QFontDatabaseFixedFont, mirroring the existingui_font) and routed every mono label through it; dropped now-unusedQFont/Pathimports.Tests:
active_roi-without-roi_setdegrade (real kernel, passes locally) and a reconstruct-mode toggle exercising the combo signal (runs in CI's offscreen Qt).🤖 Generated with Claude Code