-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix lint issues #4654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lint issues #4654
Conversation
Warning Rate limit exceeded@haslinghuis has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 51 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (24)
WalkthroughRemoved unused constants and parameters, simplified many callback signatures by dropping unused arguments, tightened several catch clauses to not bind the error, renamed a few local variables, and expanded some USB error logs. A few public method signatures were changed (notably Websocket.connect, led_strip.initialize, EscProtocols methods, TuningSliders.calculateNewPids). Changes
Sequence Diagram(s)No sequence diagram — changes are parameter/catch/variable simplifications and small signature adjustments without new control-flow interactions warranting a diagram. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/js/tabs/firmware_flasher.js (1)
266-270
: Undefined variable reference after parameter removal.The
target
parameter was removed from the forEach callback, but line 267 still referencestargets[target]
. This will cause a runtime error sincetarget
is now undefined.Apply this diff to fix the issue:
- .forEach(function () { - const descriptor = targets[target]; + .forEach(function (target) { + const descriptor = targets[target];Alternatively, use the arrow function with parameter:
- .forEach(function () { - const descriptor = targets[target]; + .forEach((target) => { + const descriptor = targets[target];src/js/tabs/osd.js (2)
29-208
: Misleading parameter naming convention.The parameters have been renamed from
w, h
to_w, _h
throughout thecoords
functions inpositionConfigs
. The underscore prefix typically signals intentionally unused parameters in JavaScript linting conventions (e.g., ESLint'sno-unused-vars
), but these parameters are actively used in coordinate calculations (lines 38, 50, 64, 76, 87, 88, 101, 112, 113, 126, 127, and many others).This creates a semantic contradiction that could confuse future maintainers or cause linting tools to flag false positives. Consider reverting to
w, h
or using a different naming convention that doesn't imply the parameters are unused.Based on learnings: The OSD positioning system relies on width/height calculations working in conjunction with centering coordinate formulas, so these parameters are essential to the positioning logic.
</review_comment_end -->
900-911
: Misleading variable naming convention.The variable has been renamed from
enabledCount
to_enabledCount
(line 900), but it's actively used at line 911 (_enabledCount++
). The underscore prefix typically signals intentionally unused variables in JavaScript linting conventions, creating a semantic contradiction. Consider reverting toenabledCount
or using a different naming convention.</review_comment_end -->
🧹 Nitpick comments (2)
src/js/utils/EscProtocols.js (2)
52-67
: Unused parameter could be removed or documented.The parameter
_apiVersion
is correctly prefixed with an underscore since it's unused in the function body. However, this raises a question: if the parameter isn't used, should it be removed from the signature to simplify the API, or is it intentionally kept for future extension?If it's a future extension point, consider adding a comment to clarify this intent. Otherwise, consider removing the unused parameter to reduce the public API surface.
</review_comment_end -->
69-71
: Unused parameter and identity function.The parameter
_apiVersion
is correctly prefixed with an underscore since it's unused in the function body. However, this method currently just returnsprotocolIndex
unchanged, making it an identity function with an unused parameter. This suggests it's either a stub for future implementation or dead code that could be removed.Consider:
- If this is a placeholder for future protocol reordering logic, add a comment to clarify.
- If the reordering logic is no longer needed, consider removing the method and updating callers to use
protocolIndex
directly.</review_comment_end -->
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
src/js/DarkTheme.js
(0 hunks)src/js/TuningSliders.js
(1 hunks)src/js/model.js
(1 hunks)src/js/msp/MSPHelper.js
(0 hunks)src/js/msp/debug/msp_queue_monitor.js
(1 hunks)src/js/msp/debug/msp_stress_test.js
(1 hunks)src/js/protocols/WebSocket.js
(1 hunks)src/js/protocols/webusbdfu.js
(6 hunks)src/js/receiver_msp/receiver_msp.js
(1 hunks)src/js/serial_backend.js
(2 hunks)src/js/tabs/cli.js
(1 hunks)src/js/tabs/firmware_flasher.js
(3 hunks)src/js/tabs/landing.js
(1 hunks)src/js/tabs/led_strip.js
(2 hunks)src/js/tabs/onboard_logging.js
(4 hunks)src/js/tabs/osd.js
(18 hunks)src/js/tabs/pid_tuning.js
(2 hunks)src/js/utils/EscProtocols.js
(2 hunks)src/js/utils/VtxDeviceStatus/SmartAudioDeviceStatus.js
(1 hunks)src/js/utils/common.js
(1 hunks)src/js/utils/three/CanvasRenderer.js
(1 hunks)src/js/utils/three/Projector.js
(0 hunks)src/tabs/presets/SourcesDialog/SourcesDialog.js
(1 hunks)src/tabs/presets/presets.js
(1 hunks)
💤 Files with no reviewable changes (3)
- src/js/msp/MSPHelper.js
- src/js/DarkTheme.js
- src/js/utils/three/Projector.js
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-02T07:45:48.606Z
Learnt from: blckmn
PR: betaflight/betaflight-configurator#4583
File: src/js/tabs/firmware_flasher.js:949-961
Timestamp: 2025-09-02T07:45:48.606Z
Learning: In src/js/tabs/firmware_flasher.js, the config file loading code path after firmware loading (in the load_file click handler) cannot be reached when UF2 firmware is loaded, according to the maintainer blckmn. This code is maintained for backward compatibility with unified target settings and will be refactored in a future PR.
Applied to files:
src/js/tabs/firmware_flasher.js
📚 Learning: 2025-06-14T13:42:41.217Z
Learnt from: syahmizul
PR: betaflight/betaflight-configurator#4516
File: src/js/tabs/osd.js:3544-3559
Timestamp: 2025-06-14T13:42:41.217Z
Learning: In OSD positioning systems, width/height calculations like `limits.maxX - limits.minX` work in conjunction with centering coordinate formulas like `Math.floor((OSD.data.displaySize.x - w) / 2)`. Adding +1 to width calculations breaks centering by making elements off-center by half a character position. The entire positioning system must be considered holistically when making changes.
Applied to files:
src/js/tabs/osd.js
🧬 Code graph analysis (3)
src/js/serial_backend.js (1)
src/components/eventBus.js (2)
EventBus
(3-8)EventBus
(3-8)
src/js/utils/EscProtocols.js (2)
src/js/tabs/gps.js (1)
protocolIndex
(118-118)src/js/tabs/motors.js (1)
escProtocols
(704-704)
src/js/tabs/onboard_logging.js (2)
src/js/Analytics.js (1)
tracking
(7-7)src/js/fc.js (1)
FC
(131-998)
🔇 Additional comments (31)
src/tabs/presets/presets.js (1)
378-378
: LGTM! Unused parameter removed.The
reason
parameter was not used in the catch block. Removing it improves code clarity and aligns with ESLint's no-unused-vars rule.src/js/msp/debug/msp_stress_test.js (1)
279-279
: LGTM! Unused error binding removed.The catch clause no longer binds the error object, satisfying lint requirements. The timeout recovery logic remains intact.
src/js/utils/three/CanvasRenderer.js (1)
554-554
: LGTM! Unused exception binding removed.The catch clause no longer binds the exception object, satisfying lint requirements. The fallback to
colorStyle1
remains unchanged.src/js/msp/debug/msp_queue_monitor.js (1)
126-128
: LGTM! Unused error binding removed.The catch clause no longer binds the error object, satisfying lint requirements. The duplicate detection error handling remains unchanged.
src/js/protocols/webusbdfu.js (6)
474-477
: LGTM!Removing the unused
index
parameter from the reduce callback improves code clarity without affecting functionality.
502-505
: LGTM!Appending error details to the log message improves debugging capability for USB transfer failures.
527-529
: LGTM!Consistent error logging improvement for OUT transfers, matching the IN transfer enhancement.
903-905
: LGTM!Removing unused parameters from the findIndex callback improves readability without affecting the sector/page lookup logic.
1164-1180
: LGTM!The UPLOAD callback logic is intact. The simplified signature (removing any unused parameters) improves readability while maintaining the verification flow.
1256-1258
: LGTM!Removing the unused data parameter from the GETSTATUS callback is a valid cleanup. The DFU exit sequence logic remains correct.
src/js/receiver_msp/receiver_msp.js (1)
192-194
: LGTM!The removal of the unused event parameter is correct and aligns with the broader cleanup pattern across this PR.
src/tabs/presets/SourcesDialog/SourcesDialog.js (1)
69-72
: LGTM!The removal of the unused
sourcesCount
parameter is correct. The call site at line 41 still passes the argument, but JavaScript silently ignores extra arguments, so no behavioral change occurs.src/js/tabs/landing.js (1)
20-30
: LGTM!The removal of the unused
index
parameter from the jQuery.each()
callback is correct and doesn't affect functionality.src/js/tabs/cli.js (1)
149-153
: LGTM!The removal of the unused
fileName
parameter is correct. The call site at line 163 still passes the argument, but it's harmlessly ignored.src/js/tabs/led_strip.js (2)
229-275
: LGTM!The removal of the unused event parameter from the color button click handler is correct and doesn't affect functionality.
16-16
: No callers rely on the removed scrollPosition parameter
Call sites invokeled_strip.initialize(content_ready)
with a single callback argument.src/js/tabs/firmware_flasher.js (2)
992-995
: LGTM!The removal of the unused event parameter is correct.
1021-1031
: LGTM!The removal of the unused event parameter is correct.
src/js/utils/common.js (1)
64-104
: Document and track re-enabling disabled sortSelect functionality
The current no-op implementation affects all dropdowns relying on alphabetical/grouped ordering. Add a TODO and create a tracking issue referencing the Chrome v140 bug, then verify no user-facing regressions in select dropdown sorting.src/js/protocols/WebSocket.js (1)
60-94
: No direct callers to the WebSocket protocol’s connect method were found; removing theoptions
parameter is safe.src/js/model.js (1)
162-162
: LGTM!Removing the unused
index
parameter from theforEach
callback simplifies the code without changing behavior.src/js/tabs/pid_tuning.js (2)
2108-2110
: LGTM!The callback doesn't use the index or element parameters, only
$(this)
to reference the current element. Removing unused parameters simplifies the signature.
3321-3342
: LGTM!The
e
parameter was never used in the method body. The event object is accessed through the inner event listener callback parameter at line 3322, making the outer parameter unnecessary.src/js/serial_backend.js (2)
62-73
: LGTM!The callback doesn't use the
device
parameter. It only checks conditions and callsconnectDisconnect()
. Removing the unused parameter simplifies the signature.
661-679
: LGTM!The filter predicate doesn't use the
index
parameter, only$(this)
and other context variables. Removing the unused parameter is appropriate.src/js/TuningSliders.js (1)
442-456
: Incorrect:updateSlidersOnly
is a parameter ofreadSimplifiedPids
(defaulting to false), so its use in the.then(() => this.updateFormPids(updateSlidersOnly))
callback is in scope and won’t cause a ReferenceError.Likely an incorrect or invalid review comment.
src/js/tabs/osd.js (2)
547-551
: LGTM!The multi-line formatting of this complex conditional improves readability without changing logic.
</review_comment_end -->
827-830
: LGTM!The multi-line formatting of this complex conditional improves readability without changing logic.
</review_comment_end -->
src/js/tabs/onboard_logging.js (3)
140-140
: LGTM!The call to
populateDebugFields()
correctly matches the updated function signature.
265-278
: LGTM!The removal of the unused
debugFieldsSelect
parameter simplifies the function signature, and the function body correctly operates on global state.
411-414
: No null-check needed for tracking.sendEvent. The app’s startup sequence in main.js invokes checkSetupAnalytics which calls createAnalytics (and sets window.tracking) before any tab initialization or user interaction, so tracking will always be non-null by the time onboard_logging.sendEvent is reached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/js/protocols/webusbdfu.js (1)
474-478
: Guard against null descriptors before populatingchipInfo
.Line 474:
parseDescriptor
deliberately returnsnull
when a descriptor is malformed. After this refactor we dereferencev.type
unconditionally, so any such descriptor now throwsCannot read properties of null
, breaking DFU detection on affected boards. Please skip null entries before using them.- const chipInfo = descriptors.map(parseDescriptor).reduce((o, v) => { - o[v.type.toLowerCase().replace(" ", "_")] = v; - return o; - }, {}); + const chipInfo = descriptors + .map(parseDescriptor) + .reduce((o, v) => { + if (!v) { + return o; + } + o[v.type.toLowerCase().replace(" ", "_")] = v; + return o; + }, {});
♻️ Duplicate comments (1)
src/js/utils/VtxDeviceStatus/SmartAudioDeviceStatus.js (1)
17-17
: Remove the unused variable.The renaming from
sa
to_sa
marks it as intentionally unused, but the computation still serves no purpose and should be removed entirely.Apply this diff to remove the unused variable:
- const _sa = this._version * 100 + this._mode;
🧹 Nitpick comments (1)
src/js/tabs/osd.js (1)
3900-3900
: Consider removing unused counter.
_enabledCount
is incremented but never read. If this was intended for debugging or a future feature, the underscore prefix correctly signals it's intentionally unused. However, if it serves no purpose, consider removing both the declaration (line 3900) and the increment (line 3911) entirely to reduce code clutter.Also applies to: 3911-3911
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
src/js/DarkTheme.js
(0 hunks)src/js/TuningSliders.js
(1 hunks)src/js/model.js
(1 hunks)src/js/msp/MSPHelper.js
(0 hunks)src/js/msp/debug/msp_queue_monitor.js
(1 hunks)src/js/msp/debug/msp_stress_test.js
(1 hunks)src/js/protocols/WebSocket.js
(1 hunks)src/js/protocols/webusbdfu.js
(6 hunks)src/js/receiver_msp/receiver_msp.js
(1 hunks)src/js/serial_backend.js
(2 hunks)src/js/tabs/cli.js
(1 hunks)src/js/tabs/firmware_flasher.js
(3 hunks)src/js/tabs/landing.js
(1 hunks)src/js/tabs/led_strip.js
(2 hunks)src/js/tabs/onboard_logging.js
(4 hunks)src/js/tabs/osd.js
(10 hunks)src/js/tabs/pid_tuning.js
(2 hunks)src/js/utils/EscProtocols.js
(2 hunks)src/js/utils/VtxDeviceStatus/SmartAudioDeviceStatus.js
(1 hunks)src/js/utils/common.js
(1 hunks)src/js/utils/three/CanvasRenderer.js
(1 hunks)src/js/utils/three/Projector.js
(0 hunks)src/tabs/presets/SourcesDialog/SourcesDialog.js
(1 hunks)src/tabs/presets/presets.js
(1 hunks)
💤 Files with no reviewable changes (3)
- src/js/DarkTheme.js
- src/js/utils/three/Projector.js
- src/js/msp/MSPHelper.js
🚧 Files skipped from review as they are similar to previous changes (14)
- src/js/tabs/landing.js
- src/js/serial_backend.js
- src/tabs/presets/presets.js
- src/js/msp/debug/msp_stress_test.js
- src/js/model.js
- src/js/utils/EscProtocols.js
- src/js/tabs/pid_tuning.js
- src/js/receiver_msp/receiver_msp.js
- src/js/TuningSliders.js
- src/js/msp/debug/msp_queue_monitor.js
- src/js/utils/three/CanvasRenderer.js
- src/tabs/presets/SourcesDialog/SourcesDialog.js
- src/js/tabs/cli.js
- src/js/tabs/onboard_logging.js
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-02T07:45:48.606Z
Learnt from: blckmn
PR: betaflight/betaflight-configurator#4583
File: src/js/tabs/firmware_flasher.js:949-961
Timestamp: 2025-09-02T07:45:48.606Z
Learning: In src/js/tabs/firmware_flasher.js, the config file loading code path after firmware loading (in the load_file click handler) cannot be reached when UF2 firmware is loaded, according to the maintainer blckmn. This code is maintained for backward compatibility with unified target settings and will be refactored in a future PR.
Applied to files:
src/js/tabs/firmware_flasher.js
📚 Learning: 2025-06-14T13:42:41.217Z
Learnt from: syahmizul
PR: betaflight/betaflight-configurator#4516
File: src/js/tabs/osd.js:3544-3559
Timestamp: 2025-06-14T13:42:41.217Z
Learning: In OSD positioning systems, width/height calculations like `limits.maxX - limits.minX` work in conjunction with centering coordinate formulas like `Math.floor((OSD.data.displaySize.x - w) / 2)`. Adding +1 to width calculations breaks centering by making elements off-center by half a character position. The entire positioning system must be considered holistically when making changes.
Applied to files:
src/js/tabs/osd.js
🧬 Code graph analysis (1)
src/js/protocols/webusbdfu.js (1)
src/js/gui.js (1)
TABS
(8-8)
🔇 Additional comments (5)
src/js/tabs/osd.js (5)
29-29
: LGTM—unused parameters correctly prefixed.The callback never references
w
orh
, so prefixing both with_
properly signals they are intentionally unused.
37-37
: LGTM—unused parameter correctly prefixed.The callback uses
w
for centering but never referencesh
, so the_h
prefix is appropriate.
49-49
: LGTM—unused parameters correctly prefixed across multiple callbacks.Each callback only uses one dimension:
- TR (line 49) uses
w
for horizontal positioning →_h
is correct.- TML, LMC, BML, BL (lines 62, 99, 138, 174) use
h
for vertical positioning →_w
is correct.Also applies to: 62-62, 99-99, 138-138, 174-174
3547-3553
: LGTM—formatting adjustment with no logic change.The conditional logic remains identical; only whitespace/formatting was adjusted for consistency.
3827-3832
: LGTM—formatting adjustment with no logic change.The conditional logic remains identical; only whitespace/formatting was adjusted.
36faebe
to
20f9f99
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-approving for workflow deferring to tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/js/utils/common.js (1)
57-103
: Clarify disabled sortSelect behavior
- Update JSDoc: remove
@param text
, describe that sorting is disabled due to Chrome v140 and the method simply returns the select element for chaining.- Add a
TODO
(with issue/bug-tracker reference) above the commented-out block to indicate when/how sorting will be re-enabled.- Confirm impact:
sortSelect
is called across many tabs (failsafe, receiver, onboard_logging, led_strip, osd, etc.); verify skipping sort doesn’t degrade UX.
♻️ Duplicate comments (1)
src/js/utils/VtxDeviceStatus/SmartAudioDeviceStatus.js (1)
17-17
: Remove unused variable_sa
.The variable
_sa
is computed but never referenced in the function. This is dead code that should be removed.Apply this diff to remove the unused variable:
- const _sa = this._version * 100 + this._mode;
🧹 Nitpick comments (1)
src/js/tabs/osd.js (1)
3900-3900
: Correctly marked as unused, but consider removing.The variable
_enabledCount
is incremented but never read. The underscore prefix correctly marks it as unused for linting purposes. If this counter serves no purpose, consider removing it entirely along with line 3911.If the counter truly serves no purpose, apply this diff:
- let _enabledCount = 0; OSD.data.displaySize.total = OSD.data.displaySize.x * OSD.data.displaySize.y; for (const field of OSD.data.displayItems) { // versioning related, if the field doesn't exist at the current flight controller version, just skip it if (!field.name) { continue; } if (field.isVisible[OSD.getCurrentPreviewProfile()]) { - _enabledCount++; }Also applies to: 3911-3911
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
src/js/DarkTheme.js
(0 hunks)src/js/TuningSliders.js
(1 hunks)src/js/model.js
(1 hunks)src/js/msp/MSPHelper.js
(0 hunks)src/js/msp/debug/msp_queue_monitor.js
(1 hunks)src/js/msp/debug/msp_stress_test.js
(1 hunks)src/js/protocols/WebSocket.js
(1 hunks)src/js/protocols/webusbdfu.js
(6 hunks)src/js/receiver_msp/receiver_msp.js
(1 hunks)src/js/serial_backend.js
(2 hunks)src/js/tabs/cli.js
(2 hunks)src/js/tabs/firmware_flasher.js
(3 hunks)src/js/tabs/landing.js
(1 hunks)src/js/tabs/led_strip.js
(2 hunks)src/js/tabs/onboard_logging.js
(4 hunks)src/js/tabs/osd.js
(10 hunks)src/js/tabs/pid_tuning.js
(2 hunks)src/js/utils/EscProtocols.js
(2 hunks)src/js/utils/VtxDeviceStatus/SmartAudioDeviceStatus.js
(1 hunks)src/js/utils/common.js
(1 hunks)src/js/utils/three/CanvasRenderer.js
(1 hunks)src/js/utils/three/Projector.js
(1 hunks)src/tabs/presets/SourcesDialog/SourcesDialog.js
(1 hunks)src/tabs/presets/presets.js
(1 hunks)
💤 Files with no reviewable changes (2)
- src/js/msp/MSPHelper.js
- src/js/DarkTheme.js
🚧 Files skipped from review as they are similar to previous changes (16)
- src/js/msp/debug/msp_queue_monitor.js
- src/js/protocols/WebSocket.js
- src/js/msp/debug/msp_stress_test.js
- src/js/model.js
- src/js/tabs/led_strip.js
- src/js/serial_backend.js
- src/js/tabs/firmware_flasher.js
- src/js/protocols/webusbdfu.js
- src/js/utils/three/CanvasRenderer.js
- src/tabs/presets/SourcesDialog/SourcesDialog.js
- src/js/tabs/pid_tuning.js
- src/js/receiver_msp/receiver_msp.js
- src/js/utils/EscProtocols.js
- src/js/tabs/cli.js
- src/js/tabs/onboard_logging.js
- src/js/TuningSliders.js
🔇 Additional comments (7)
src/tabs/presets/presets.js (1)
378-378
: LGTM! Valid cleanup of unused parameter.The removal of the unused error parameter from the catch handler is appropriate. The logic correctly collects failed repositories and continues loading the rest, which is the intended behavior for graceful degradation when some preset sources are unavailable.
src/js/utils/three/Projector.js (1)
136-136
: LGTM! Valid lint fix for unused variable.The variable is assigned but never read within the
RenderList
scope. Renaming to_material
correctly signals to linters that this is intentionally unused, suppressing warnings without altering behavior.Also applies to: 142-142
src/js/tabs/landing.js (1)
20-20
: LGTM!Removing the unused
index
parameter from the jQuery callback is a clean lint fix with no functional impact.src/js/tabs/osd.js (4)
29-32
: LGTM! Unused parameters correctly marked.The underscore prefix correctly indicates that both width and height parameters are unused in this positioning function, which returns a fixed top-left position.
37-40
: LGTM! Parameter usage correctly reflected in naming.The underscore prefix correctly marks unused parameters while keeping the used parameters named normally:
TC
andTR
use width (w
) but not height (_h
)TML
,LMC
,BML
, andBL
use height (h
) but not width (_w
)This improves code clarity by signaling intent.
Also applies to: 49-52, 62-65, 99-102, 138-141, 174-177
3547-3553
: LGTM! Formatting improvement.The multi-line conditional is easier to read with the logical operators aligned. The logic remains unchanged—this shows a warning when an OSD font device is configured but not physically detected.
3827-3832
: LGTM! Formatting improvement.The multi-line conditional improves readability while maintaining the same logic. This correctly disables font-related UI features when the required hardware is unavailable.
|
Preview URL: https://pr4654.betaflight-app-preview.pages.dev |
Thanks @nerdCopter - this is mainly running |
Summary by CodeRabbit
Refactor
API Changes
UI / Behavior
Debug/Developer Tools