Skip to content

Outputs: show the Smart ESC port count only when it disagrees with the mixer - #2829

Open
MrScothh wants to merge 3 commits into
iNavFlight:maintenance-10.xfrom
MrScothh:fix/srxl2-ports-note-only-when-wrong
Open

MrScothh wants to merge 3 commits into
iNavFlight:maintenance-10.xfrom
MrScothh:fix/srxl2-ports-note-only-when-wrong

Conversation

@MrScothh

@MrScothh MrScothh commented Oct 9, 2026

Copy link
Copy Markdown

The Spektrum Smart ESC box in the Outputs tab printed "SRXL2 ports open on the board: 1, for 1 motor(s). Motor 1 uses the lowest-numbered port." on every board, including the ones where the count was exactly right. A line that reports the normal state is noise, and it buried the one case where the figures matter.

The box is now quiet when the ports the board opened match the mixer's motor count. The count line appears only when the mixer has no motors yet, so the board cannot be checked against it, or when more ports are open than motors, where it now says that the extra ports drive nothing. The warnings for no port, a port assigned but not opened, and too few ports are unchanged, and while one of them shows the count line stays hidden, so the numbers are not printed twice. The wiring note is shorter, and still says that motor 1 is the lowest-numbered port. The locale key srxl2PortCount had no user left and is removed from the English file.

While the board has not answered the status request yet, the line stays hidden instead of showing the count assigned in the tab; that state ends with the first reply, and the warning for a missing port still shows.

Testing

Packaged build against the SITL of the same firmware, motor_pwm_protocol = SRXL2, airplane mixer with one motor:

  • one port assigned to Spektrum Smart ESC: the box shows the wiring note and the settings, no count line, no warning;
  • a second port assigned: "SRXL2 ports open on the board: 2, for 1 motor(s). Motor 1 uses the lowest-numbered port and the others follow in motor order; the ports beyond the motor count drive nothing.", no warning.

yarn test: everything passes except the MZTC sender scan, which fails on Windows for the path separator independently of this change (#2826 fixes it).

#2814 touches the same block and will need a restack once this is merged.

…e mixer

A count that matches the mixer is the normal state, and a line saying so on
every board hid the one case where the figures matter. The line now appears
only with no mixer set or a port left over, and never beside a warning that
already carries the numbers. The wiring note is shorter.
@qodo-code-review

Copy link
Copy Markdown
Contributor

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Show Smart ESC port counts only when they need attention

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Hide the SRXL2 count when board ports match the mixer or status has not arrived.
• Show counts for an unset mixer or extra ports, without duplicating warnings.
• Shorten the wiring guidance and remove an unused English locale key.
Diagram

graph TD
  Status["Board status"] --> Refresh["Outputs refresh"] --> Warning{"Port warning?"} -->|no| Count{"Count needed?"} -->|yes| Info["Count box"]
  Warning -->|yes| WarnBox["Warning box"]
  Count -->|no| Hidden["Hidden count"]
  Refresh -->|no reply| Hidden
Loading
High-Level Assessment

Keep the existing board-reported counts and separate warning and informational messages. The focused visibility change avoids duplicating figures or inferring motor counts from UI settings; a broader redesign is unnecessary.

Files changed (3) +50 / -28

Bug fix (3) +50 / -28
messages.jsonClarify extra-port behavior and shorten wiring guidance +2/-5

Clarify extra-port behavior and shorten wiring guidance

• Shortens the Smart ESC wiring note and explains that ports beyond the motor count drive nothing. Removes the unused assigned-port count message.

locale/en/messages.json

outputs.htmlHide the port-count box until needed +1/-1

Hide the port-count box until needed

• Sets the SRXL2 count box to be hidden initially, so it does not appear before board status is available.

tabs/outputs.html

outputs.jsShow SRXL2 counts only for actionable mismatches +47/-22

Show SRXL2 counts only for actionable mismatches

• Separates port-warning selection from count-message selection. Hides counts when ports match motors, a warning already supplies the figures, or no status reply has arrived; retains counts for an unset mixer or extra ports.

tabs/outputs.js

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Serbian users miss the idle-port warning ✓ Resolved
Description
The updated srxl2PortCountOpen message explains that ports beyond the motor count drive nothing,
but its Serbian translation still contains only the old count and motor-order text. When a
Serbian-language user has more open ports than motors, the Outputs tab selects that translation
instead of the English message, so the new explanation never appears.
Code

locale/en/messages.json[1675]

+        "message": "SRXL2 ports open on the board: $1, for $2 motor(s). Motor 1 uses the lowest-numbered port and the others follow in motor order; the ports beyond the motor count drive nothing."
Evidence
The revised English message adds the idle-port explanation; the existing Serbian entry for the same
key does not. The Outputs tab uses this key specifically when open ports exceed motors, and
localization loads Serbian as an available language with English only as a fallback.

locale/en/messages.json[1674-1676]
locale/sr/messages.json[1460-1462]
tabs/outputs.js[258-266]
js/localization.js[7-8]
js/localization.js[23-37]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Serbian translation of the extra-port count message omits the newly added explanation that excess ports drive nothing.
## Fix Focus Areas
- locale/en/messages.json[1674-1676]
- locale/sr/messages.json[1460-1462]
## Recommended Fix
Update the Serbian `srxl2PortCountOpen` translation to convey that ports beyond the motor count drive nothing, while retaining both count placeholders.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread locale/en/messages.json
They read nothing from the tab's closure, and SonarCloud counts them as nested
too deeply inside initialize.
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Configurator test build ready — commit 4f5d380

Download build artifacts for PR #2829

Available platforms (scroll to the Artifacts section at the bottom of the run page):

  • Windows x64 (ZIP, MSI) and x32 (ZIP, MSI)
  • macOS arm64 (ZIP, DMG) and x64 (ZIP, DMG)
  • Linux x64 (DEB, RPM, ZIP) and aarch64 (DEB, RPM, ZIP)

A GitHub login is required to download artifacts. Build is for testing only.

The count line's new wording and the shorter wiring note, with the orphan
srxl2PortCount removed there as well.
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

1 participant