Skip to content

Conversation

@haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Sep 23, 2025

Summary by CodeRabbit

  • New Features

    • Expanded parameter input ranges in the header dialog.
    • Updated debug field mappings and friendlier FFT frequency labels.
    • Refreshed sensor/hardware options and updated flight mode names.
  • Chores

    • Unified firmware gating threshold across the app to 2025.12.0, causing UI elements and feature availability to adapt to the new threshold.

@haslinghuis haslinghuis added this to the 4.0.0 milestone Sep 23, 2025
@haslinghuis haslinghuis self-assigned this Sep 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

Updated firmware-version gating thresholds from "4.6.0" to "2025.12.0" across multiple modules; adjusted field/hardware/debug mappings and FFT_FREQ mappings to follow the new threshold; preserved full firmware precision when parsing Betaflight headers; increased several UI parameter upper bounds and moved RC-smoothing UI gating to the new threshold.

Changes

Cohort / File(s) Summary
Version gating changes
src/flightlog.js, src/flightlog_fields_presenter.js, src/header_dialog.js
Replaced firmware threshold checks from "4.6.0" to "2025.12.0" for multiple gating decisions (disabled fields, FFT_FREQ mappings, RC smoothing UI visibility, derivative column ordering, motor_idle min).
Field definitions and mappings
src/flightlog_fielddefs.js
Shifted many threshold branches to "2025.12.0"; updated ACC_HARDWARE removals/additions (e.g., remove LSM303DLHC, add IIM42653), expanded DEBUG_MODE entries, renamed debug/gyro fields (DUAL_*MULTI_*), adjusted flight-mode name selection and various removals/insertions.
FFT / debug field handling
src/flightlog_fields_presenter.js
Guarded FFT_FREQ mapping/decoding/conversion by the new "2025.12.0" threshold and extended FFT_FREQ label mappings for the newer branch.
Parser precision
src/flightlog_parser.js
Constructed Betaflight firmware value using integer parts (preserve full precision) instead of truncating floats; firmwarePatch and firmwareVersion assembly unchanged in structure.
Header UI ranges & gating
src/header_dialog.js
Increased displayed parameter upper bounds (e.g., "999.9.9""9999.9.9" for many Betaflight params); moved multiple UI-gating checks from "4.6.0" to "2025.12.0" and adjusted related conditional logic.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Log as Log File
    participant Parser as flightlog_parser
    participant Defs as flightlog_fielddefs
    participant Presenter as flightlog_fields_presenter
    participant UI as header_dialog / UI

    Log->>Parser: supply header (firmware string)
    Parser->>Parser: parse major.minor(.patch) preserving integer parts
    Parser->>Parser: set firmware, firmwarePatch, firmwareVersion

    UI->>Parser: request firmwareVersion
    Parser-->>UI: return firmwareVersion

    UI->>Defs: request field/hardware/debug defs with firmwareVersion
    alt firmwareVersion >= 2025.12.0
        Defs-->>UI: provide updated defs (MULTI_GYRO, ACC_HARDWARE changes, DEBUG_MODE additions)
        Presenter-->>UI: use expanded FFT_FREQ mappings
    else
        Defs-->>UI: provide legacy defs (DUAL_GYRO, older ACC list)
        Presenter-->>UI: use legacy FFT_FREQ mappings
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

RN: IMPROVEMENT

Suggested reviewers

  • ctzsnooze

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request contains no author-provided description while the repository's template expects contextual information (summary, rationale, testing, and related issues); without that information reviewers cannot verify the intent or testing of the widespread semver/version changes, so the check fails. Please populate the PR description using the repository template: include a concise summary of the changes (which files and key edits), the rationale for the semver/version updates, test or CI results and verification steps, and any related issue numbers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Fix semver" accurately relates to the primary change set, which updates semantic-version checks and firmware parsing across multiple files (e.g., replacing "4.6.0" thresholds with "2025.12.0" and adjusting Betaflight version parsing), so it is concise and relevant though somewhat generic.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ee1a41 and f1041ff.

📒 Files selected for processing (1)
  • src/flightlog_parser.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/flightlog_parser.js

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/flightlog.js (1)

1785-1795: Verify mask remap vs UI for fields_disabled_mask (ATTITUDE/ACC/DEBUG offsets).

For BF >= 2025.12.0 you remap/extend bits (e.g., ATTITUDE at bit 8, ACC moves to bit 9, etc.). The header dialog’s “Selected Fields” list (src/header_dialog.js, builtSelectedFieldsList) still enumerates the legacy 0..13 mapping and doesn’t include ATTITUDE/SERVO. When this threshold becomes active, toggles will drift.

  • Suggest adding ATTITUDE/SERVO to the UI list and gating the bit positions by firmwareVersion here too.
  • Until then, a small comment noting the future mismatch would help.
src/flightlog_fields_presenter.js (1)

1317-1489: Fix typo: SPA debug mapping key missing closing bracket.

'debug[all' should be 'debug[all]'. Without the bracket, friendly names for SPA won’t resolve.

-      DEBUG_FRIENDLY_FIELD_NAMES.SPA = {
-        'debug[all': 'SPA',
+      DEBUG_FRIENDLY_FIELD_NAMES.SPA = {
+        'debug[all]': 'SPA',
         'debug[0]': 'Setpoint PID Attenuation [roll]',
         'debug[1]': 'Setpoint PID Attenuation [pitch]',
         'debug[2]': 'Setpoint PID Attenuation [yaw]',
       };
src/header_dialog.js (2)

1577-1587: RC smoothing indices changed; confirm data layout for rc_smoothing_active_cutoffs_ff_sp_thr.

For >= 2025.12.0 you hide FF and map only [SP, THR] from indexes [0],[1]. In 4.3–4.5 you map [FF, SP, THR] as [0],[1],[2]. Please confirm the header format actually changes to a 2‑element tuple in new firmware; otherwise this will mis-assign values.


1713-1718: DOM reordering guarded for < 2025.12.0.

Looks harmless. Consider guarding with element existence checks to avoid null derefs if IDs change.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fea4f1 and 5ee1a41.

📒 Files selected for processing (5)
  • src/flightlog.js (1 hunks)
  • src/flightlog_fielddefs.js (3 hunks)
  • src/flightlog_fields_presenter.js (3 hunks)
  • src/flightlog_parser.js (1 hunks)
  • src/header_dialog.js (16 hunks)
🔇 Additional comments (7)
src/flightlog_fields_presenter.js (3)

1317-1489: Nice: expanded debug mappings for >= 2025.12.0.

The FFT_FREQ, MULTI_GYRO*, AUTOPILOT_* additions look consistent with fielddefs updates.


1978-1993: LGTM: FFT_FREQ unit switch aligns with new field order.

Using deg/s for debug[0] on >= 2025.12.0 and Hz otherwise matches the name remap.


2730-2749: LGTM: ConvertDebugFieldValue mirrors the display logic for FFT_FREQ.

The conversion paths are consistent with decodeDebugFieldToFriendly.

src/header_dialog.js (2)

101-111: Bounds bumped to 9999.9.9 across many params: OK; sanity-check semver lib limits.

This effectively “un-caps” visibility checks. Confirm your semver implementation handles large majors (e.g., 9999.9.9) without surprises.

Also applies to: 131-141, 143-159, 173-183, 187-195, 197-207, 211-219, 221-225, 247-255, 257-261, 269-279, 281-291, 299-303, 311-321, 329-333, 337-339, 347-351, 353-357, 361-363, 367-375, 377-399, 401-405, 409-417, 425-429, 433-441, 445-447, 451-459, 463-471, 475-483, 487-495, 499-507, 521-525, 529-537, 541-549, 553-561, 565-573, 577-585, 589-597, 601-609, 613-621, 647-651, 655-663, 667-675, 679-687, 691-699, 703-711, 715-723, 727-735, 739-747, 751-759, 763-771, 775-783


329-333: Gate motor_idle on >= 2025.12.0.

Looks fine; ensure logs with this header actually set motor_idle so the field isn’t rendered “missing” by default.

src/flightlog_fielddefs.js (2)

532-558: Debug list evolution for >= 2025.12.0 looks consistent.

  • D_MAX vs D_MIN swap pre-threshold is sensible.
  • ACC_HARDWARE pruning and IIM42653 insertion OK.
  • MULTI_GYRO renames align with presenter mappings.

Please verify firmware outputs the renamed debug modes (MULTI_GYRO_, AUTOPILOT_, OPTICALFLOW, TPA, SPA, S_TERM, TASK, GIMBAL, WING_SETPOINT).


564-568: Flight mode names switch to POST_4_5 only for >= 2025.12.0.

De-risking by pushing the boundary out is fine. Ensure any UI text elsewhere that relied on the old 4.6.0 split doesn’t assume POST_4_5 until the new threshold.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
88.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@github-actions
Copy link

Preview URL: https://pr858.betaflight-blackbox.pages.dev

Copy link
Member

@nerdCopter nerdCopter left a comment

Choose a reason for hiding this comment

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

  • only briefly tested, did not deep inspect.

@haslinghuis haslinghuis merged commit c9e1863 into betaflight:master Sep 24, 2025
4 of 5 checks passed
@haslinghuis haslinghuis deleted the fix-semver branch September 24, 2025 14:12
@haslinghuis haslinghuis mentioned this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants