Skip to content

fix(gui): refresh components only when values change - #2306

Merged
amilcarlucas merged 1 commit into
ArduPilot:masterfrom
YoussGm3o8:fix-component-change-events
Oct 30, 2026
Merged

amilcarlucas merged 1 commit into
ArduPilot:masterfrom
YoussGm3o8:fix-component-change-events

Conversation

@YoussGm3o8

Copy link
Copy Markdown
Contributor

Description

Fixes #2302

Opening an inline component dropdown generates focus events even when its value has not changed. Those events were treated as edits and rebuilt the parameter table, repeatedly opening bitmask usage help and preventing the dropdown from staying open.

Remove the duplicate focus-out binding and skip redundant field writes and table refreshes when component values are unchanged. Copy nested component values during synchronization so subsequent edits remain detectable while preserving the dictionary reference used by computed parameters. Keep the existing bitmask help behavior.

Checklist

  • Run pre-commit checks locally
  • Verified by a human programmer
  • All commits are signed off (use git commit --signoff)
  • Code follows our coding standards
  • Documentation updated if needed
  • No breaking changes or properly documented

Testing

  • The three new regression cases fail without the fix and pass with it. They use real Tk controls to check unchanged focus events, repeated edits, and receiver connection/protocol updates.

  • 722 affected tests pass on Windows with Python 3.14.6. One known pre-existing orientation layout failure was deselected.

  • An automated check in the full offline editor confirms that both receiver dropdowns open without reopening bitmask help.

  • Applicable pre-commit and pre-push checks pass, including Pylint and MyPy. Scoped Pyright checks also pass.

  • Unit tests pass

  • Integration tests pass

  • Manual testing performed

  • Tested on flight controller hardware

The full repository suite and Linux/macOS behavior were not tested locally for this change.

The fork's Windows packaging job fails because the Chinese language-file URL returns a 404 response, which the installer compiler rejects. The Pylint 3.14 job cannot import Tkinter and also reports diagnostics in unchanged files. Neither workflow is changed by this PR. See the Windows build log and Pylint run. Both packaging and Pylint passed at the upstream base commit, acad9f5a.

Focus events from unchanged component controls rebuilt the parameter table and reopened bitmask help, interrupting dropdowns.

Skip unchanged component synchronization and redundant field writes, and remove the duplicate FocusOut binding. Copy nested component values during synchronization so subsequent edits remain detectable while preserving the evaluator reference.

Cover unchanged focus events, repeated edits, and receiver connection cascades with real Tk controls.

Signed-off-by: YoussGm3o8 <youssefelkesti2005@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 05:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@amilcarlucas amilcarlucas added the AIReview Request an automated AI review; picked up by the reviewprs sweep label Oct 30, 2026
@AP-Review

Copy link
Copy Markdown

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: ACCEPT

Reviewed at head 327aee49ac.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/methodicconfigurator/2306/1.html#prMethodicConfigurator-2306

This fixes the spurious parameter-table refresh when a component field gains or loses focus without a change, and it is ready to merge; the new test pins the change-detection and deepcopy logic.

Minor (1)
  • frontend_tkinter_component_editor.py:459: the equal-value guards here and at line 503 are not exercised by any test (removing both still passes everything), since refresh gating comes from the equality check in update_vehicle_components. Either add a case that depends on them (e.g. a legacy string-typed numeric value) or drop them. Optional.

@amilcarlucas
amilcarlucas merged commit a71b7ae into ArduPilot:master Oct 30, 2026
15 of 18 checks passed
@amilcarlucas

Copy link
Copy Markdown
Collaborator

Thanks, for this, merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIReview Request an automated AI review; picked up by the reviewprs sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated bitmask usage popups block inline component dropdowns

4 participants