Skip to content

fix widget updating in the middle of model change#7500

Merged
pfeerick merged 2 commits into
mainfrom
3djc/fix-7499
Jun 30, 2026
Merged

fix widget updating in the middle of model change#7500
pfeerick merged 2 commits into
mainfrom
3djc/fix-7499

Conversation

@3djc

@3djc 3djc commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes:

Fix #7499 where widgets are updating while model load is in progress on model changes, resulting in hardfault.

Fix was designed by @philmoz (see #7498)

Summary by CodeRabbit

  • Bug Fixes
    • Improved the model-switching experience by temporarily pausing screen refreshes during the transition.
    • Restored refreshes after the new model and screens finish loading, helping avoid visual glitches or partial redraws.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c6f0e0f-4581-4726-b899-21361c9b1ca8

📥 Commits

Reviewing files that changed from the base of the PR and between 71ba867 and c7f2529.

📒 Files selected for processing (1)
  • radio/src/gui/colorlcd/model/model_select.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • radio/src/gui/colorlcd/model/model_select.cpp

📝 Walkthrough

Walkthrough

Widget refresh is disabled during color LCD model selection while the main view layout is replaced and the selected model loads, then re-enabled after custom screens are restored.

Changes

Model switch refresh gating

Layer / File(s) Summary
Refresh bracket around model load
radio/src/gui/colorlcd/model/model_select.cpp
Widget refresh is disabled before the model switch tears down the main view layout, then the selected model and custom screens load, and refresh is re-enabled afterward.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • EdgeTX/edgetx#7385: Also changes ModelsPageBody::selectModel in model_select.cpp, adjusting the model-switch sequence around loadModel(...) and custom screen deletion.

Suggested labels

bug 🪲, color, bug/regression ↩️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: preventing widget updates during a model switch.
Description check ✅ Passed The description follows the template with a summary and links the fix to issue #7499.
Linked Issues check ✅ Passed The change disables widget refresh during model loading and rebuilds screens afterward, matching the bug's root cause and expected fix.
Out of Scope Changes check ✅ Passed The patch appears tightly scoped to model-switch widget refresh handling with no unrelated changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 3djc/fix-7499

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

PR #7500 pauses widget refresh during a model change, but the top bar
widgets are still attached while loadModel() resets g_model. #7385 already
detaches the custom screens before the load for the same reason; the top
bar was left out, which is the path that faults in #7499 (a surviving
ValueWidget reads its torn-down persistent data when checkAll() re-enters
the refresh loop via a throttle/switch warning).

Detach the top bar widgets alongside the custom screens so nothing
survives into the reset window; loadCustomScreens() rebuilds them after
the new model is loaded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@philmoz

philmoz commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Looks ok.

@pfeerick
pfeerick merged commit 3d189a9 into main Jun 30, 2026
40 checks passed
@pfeerick
pfeerick deleted the 3djc/fix-7499 branch June 30, 2026 01:45
@pfeerick pfeerick added the color Related generally to color LCD radios label Jun 30, 2026
@pfeerick pfeerick added this to the 2.12.3 milestone Jun 30, 2026
pfeerick pushed a commit that referenced this pull request Jul 3, 2026
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 3d189a9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.12 To be backported to a 2.12 release also. color Related generally to color LCD radios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hard-fault / freeze when switching models with a throttle or switch warning active (color radios)

4 participants