feat(mixer): warn when servo mixer target exceeds rule count#2659
Open
sensei-hacker wants to merge 1 commit into
Open
feat(mixer): warn when servo mixer target exceeds rule count#2659sensei-hacker wants to merge 1 commit into
sensei-hacker wants to merge 1 commit into
Conversation
Adds a warning dialog in the Servo Mixer table when a rule's target servo number is higher than the number of servo mixer rules that exist (1-based: N rules means only servos #1..#N can be validly targeted, so entering a higher number would skip a servo).
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
|
Configurator test build ready — commit Download build artifacts for PR #2659 Available platforms (scroll to the Artifacts section at the bottom of the run page):
|
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.



Summary
Adds a warning dialog in the Mixer tab's Servo Mixer table when a rule's target servo number is invalid given the number of servo mixer rules currently defined.
Changes
getServoTargetWarning()injs/servoMixerTargetWarning.js: with N servo mixer rules defined (rate != 0), only servo targets LTM - Add telemetry support #1..#N are valid (1-based numbering). Entering a higher number would skip a servo..mix-rule-servochange handler intabs/mixer.jscalls this helper and, if the entered target is invalid, shows a jBox modal warning (newservoTargetWarningModal, content intabs/mixer.html).servoMixRuleInvalidServoTargetTitle/servoMixRuleInvalidServoTargetinlocale/en/messages.json.setTarget()) regardless of the warning - this is informational, not a hard block.Testing
tests/servo-mixer-target-validation.test.mjs(Node's built-in test runner) - 12 tests covering: editing one of 2 existing rules, editing the first vs. second rule, the "Add new mixer rule" auto-targeted row, a single-rule mixer, unused (rate=0) rules not counting, duplicate-target rules, andentered = 0never warning. All pass (node --test tests/*.test.mjs, 24/24 across the full suite).tabs/mixer.jsandjs/servoMixerTargetWarning.jspassnode --input-type=module --check.Code Review
Reviewed with the inav-code-review agent; addressed all IMPORTANT findings (verified the warning can't fire during programmatic preset-load/rebuild flows, and extracted the decision logic into a shared module so tests exercise the real code path instead of a mirror).