Skip to content

fix(color): trims may move by an extra step when trim key released#7473

Merged
pfeerick merged 1 commit into
mainfrom
philmoz/fix-trim
Jun 30, 2026
Merged

fix(color): trims may move by an extra step when trim key released#7473
pfeerick merged 1 commit into
mainfrom
philmoz/fix-trim

Conversation

@philmoz

@philmoz philmoz commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

When a trim key is released after being held until it starts repeating, the trim may jump an extra step.
Introduced for color radios when the long key press logic was refactored.

Fixes #7329

Applies to 2.11, 2.12 and 3.0.

Summary by CodeRabbit

  • Bug Fixes
    • Improved trim event handling so trim actions are processed only for valid “first press” and “repeat” events, avoiding accidental processing of other trim event types. This makes trim control more accurate and reliable during key interactions.

@philmoz philmoz added this to the 2.11.7 milestone Jun 20, 2026
@philmoz philmoz added color Related generally to color LCD radios UX-UI Related to user experience (UX) or user interface (UI) behaviour bug/regression ↩️ A new version of EdgeTX broke something labels Jun 20, 2026
@coderabbitai

coderabbitai Bot commented Jun 20, 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: 19ed58ad-cc9f-4a91-8d45-743c8502bd53

📥 Commits

Reviewing files that changed from the base of the PR and between f73d260 and 977c28a.

📒 Files selected for processing (2)
  • radio/src/edgetx.cpp
  • radio/src/keys.h
💤 Files with no reviewable changes (1)
  • radio/src/keys.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • radio/src/edgetx.cpp

📝 Walkthrough

Walkthrough

keys.h removes IS_KEY_BREAK and a dead trim-event comment. checkTrims() now processes trim input only on first-press or repeat events instead of any non-break event.

Changes

Trim event filtering update

Layer / File(s) Summary
Remove key-break helper
radio/src/keys.h
Deletes the commented IS_TRIM_EVENT block and the inline IS_KEY_BREAK(event_t evt) predicate.
Restrict trim events in checkTrims
radio/src/edgetx.cpp
checkTrims() now enters trim-update logic only for IS_KEY_FIRST(event) or IS_KEY_REPT(event).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested labels

backport/2.11, backport/2.12

🚥 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 describes the trim-release bug fix in color radios.
Description check ✅ Passed The description identifies the bug, references the issue, and notes affected versions.
Linked Issues check ✅ Passed The code change matches issue #7329 by preventing trims from advancing on release after repeat starts.
Out of Scope Changes check ✅ Passed The changes appear narrowly focused on the trim-release bug fix and related cleanup.
✨ 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 philmoz/fix-trim

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.

@philmoz philmoz force-pushed the philmoz/fix-trim branch from 7905d0a to f73d260 Compare June 24, 2026 01:25
@philmoz philmoz force-pushed the philmoz/fix-trim branch from f73d260 to 977c28a Compare June 26, 2026 08:05
@pfeerick pfeerick merged commit 66d9e13 into main Jun 30, 2026
40 checks passed
@pfeerick pfeerick deleted the philmoz/fix-trim branch June 30, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug/regression ↩️ A new version of EdgeTX broke something color Related generally to color LCD radios UX-UI Related to user experience (UX) or user interface (UI) behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Radiomaster tx16s mk3 Trim Centering issue

2 participants