Skip to content

GH-108: Fix control panel status label stuck at Initializing#130

Merged
ehkropf merged 2 commits intomainfrom
gh-108-fix-status-label
Mar 22, 2026
Merged

GH-108: Fix control panel status label stuck at Initializing#130
ehkropf merged 2 commits intomainfrom
gh-108-fix-status-label

Conversation

@ehkropf
Copy link
Owner

@ehkropf ehkropf commented Mar 8, 2026

Summary

  • Replace hardcoded "Initializing..." label in control panel with dynamic m_computationPhase that shows the latest status message during computation setup
  • Show iteration/residual display once Newton iterations start (unchanged behavior)
  • Display convergence/failure summary after computation completes (previously showed nothing)

Fixes #108

Test plan

  • Build succeeds
  • All 314 tests pass, no regressions
  • Manual: Load thesis example, click Compute — verify label shows "Computing conformal map..." initially
  • Manual: Verify label switches to "Iteration: N / Residual: X" once Newton starts
  • Manual: Verify label shows "Converged (N iterations)" on completion

🤖 Generated with Claude Code

ehkropf and others added 2 commits March 8, 2026 13:04
Add m_computationPhase member to MainWindow that tracks the display
state for the control panel status area. The label now shows the latest
status message during setup, iteration progress during Newton steps,
and a convergence/failure summary after computation completes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add null guard on mp_controller in onComputationComplete()
- Set m_computationPhase to "Computing..." when computation starts to
  avoid stale label on first frame
- Distinguish cancellation from failure: add wasCancelled() accessor to
  GuiController and show "Cancelled" instead of "Failed: ..."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ehkropf
Copy link
Owner Author

ehkropf commented Mar 22, 2026

Blind Review Findings

Ran parallel review agents (code-reviewer, silent-failure-hunter, code-simplifier). Summary:

Fixed in 569001c

  1. Null guard on mp_controller in onComputationComplete() — Every other method in MainWindow guards this pointer; the new callback did not. Added if (!mp_controller) return; for consistency.

  2. Stale label on first frame — Brief window between m_isComputing becoming true and the first status message arriving via the message queue. During this window, m_computationPhase showed whatever it had before (empty or previous completion text). Now set to "Computing..." when computeMapping() succeeds.

  3. Cancellation displayed as failure — User-initiated cancel produced "Failed: Computation cancelled". Added wasCancelled() accessor to GuiController (reads m_cancelRequested atomic, which remains true until next computeMapping() resets it). onComputationComplete() now checks cancellation first and shows "Cancelled" instead.

Confirmed non-issues

  • Thread safety — All reads/writes to m_computationPhase happen on GUI thread (status updates delivered via mutex-protected message queue, completion fires from update()). Safe.
  • Stale state on reloadclear() and loadMap() both fire onStatusUpdate() which updates m_computationPhase. Handled by existing callback chain.
  • Exception safety — Controller accessors are simple inline getters returning member values. Cannot throw.

@ehkropf ehkropf merged commit 631d941 into main Mar 22, 2026
@ehkropf ehkropf deleted the gh-108-fix-status-label branch March 22, 2026 19:28
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.

GUI: status label above Compute button stays at "Initializing..." during computation

1 participant