Skip to content

Conversation

haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Jul 29, 2025

Summary by CodeRabbit

  • New Features

    • Added "Enable All" and "Disable All" buttons to both DShot and Analog beeper configuration sections, allowing users to quickly toggle all beeper condition checkboxes at once.
  • Style

    • Introduced new styling for the beeper control buttons to enhance their appearance and usability.
  • Localization

    • Added new English localization entries for the "Enable All" and "Disable All" button labels.

@haslinghuis haslinghuis added this to the 11.0 milestone Jul 29, 2025
@haslinghuis haslinghuis self-assigned this Jul 29, 2025
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

Bulk "Enable All" and "Disable All" controls were added for both DShot and Analog beeper condition checkboxes in the configuration tab. This includes new localized strings, UI buttons, CSS styling, and JavaScript event handlers to toggle all relevant checkboxes at once, without modifying existing logic or data structures.

Changes

Cohort / File(s) Change Summary
Localization Entries
locales/en/messages.json
Added two new English localization entries: "Enable All" and "Disable All" for beeper configuration controls.
CSS for Beeper Controls
src/css/tabs/configuration.less
Introduced .beeper-controls CSS block for layout and button styling, including hover and active states.
JavaScript Event Handlers
src/js/tabs/configuration.js
Added click event handlers to enable or disable all beeper condition checkboxes in both DShot and Analog sections, triggering change events accordingly.
HTML UI Buttons
src/tabs/configuration.html
Inserted "Enable All" and "Disable All" button groups in DShot and Analog beeper configuration sections, using new i18n labels.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI (HTML/JS)
    participant Checkbox Group

    User->>UI (HTML/JS): Click "Enable All" or "Disable All" button
    UI (HTML/JS)->>Checkbox Group: Set all checkboxes to checked/unchecked
    UI (HTML/JS)->>Checkbox Group: Trigger change events for all checkboxes
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

RN: FEATURE

Suggested reviewers

  • nerdCopter

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c82ccf and 01f301d.

📒 Files selected for processing (1)
  • src/css/tabs/configuration.less (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/css/tabs/configuration.less
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@haslinghuis haslinghuis moved this to App in 2025.12.0 Jul 29, 2025
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
locales/en/messages.json (1)

1713-1718: Consider keeping configuration* keys in lexicographic order
Current insertion (configurationBeeperEnableAll, configurationBeeperDisableAll) precedes configuration3d, whereas ASCII ordering would place "configuration3d" before any "configurationB..." keys. If the surrounding block is normally sorted, swap the positions to maintain consistency.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c51874 and c90fe7f.

📒 Files selected for processing (4)
  • locales/en/messages.json (1 hunks)
  • src/css/tabs/configuration.less (1 hunks)
  • src/js/tabs/configuration.js (2 hunks)
  • src/tabs/configuration.html (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: mituritsyn
PR: betaflight/betaflight-configurator#4526
File: src/js/gui.js:43-43
Timestamp: 2025-06-20T12:35:49.283Z
Learning: In the Betaflight Configurator codebase, tabs in `defaultCloudBuildTabOptions` are conditionally displayed based on firmware build options. The logic in `serial_backend.js` checks `FC.CONFIG.buildOptions` and only adds tabs to `GUI.allowedTabs` if the firmware was built with support for that feature.
Learnt from: haslinghuis
PR: betaflight/betaflight-configurator#4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.
Learnt from: haslinghuis
PR: betaflight/betaflight-configurator#4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.
src/js/tabs/configuration.js (3)

Learnt from: mituritsyn
PR: #4526
File: src/js/gui.js:43-43
Timestamp: 2025-06-20T12:35:49.283Z
Learning: In the Betaflight Configurator codebase, tabs in defaultCloudBuildTabOptions are conditionally displayed based on firmware build options. The logic in serial_backend.js checks FC.CONFIG.buildOptions and only adds tabs to GUI.allowedTabs if the firmware was built with support for that feature.

Learnt from: haslinghuis
PR: #4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.

Learnt from: haslinghuis
PR: #4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.

locales/en/messages.json (1)

Learnt from: haslinghuis
PR: #4490
File: locales/en/messages.json:1534-1545
Timestamp: 2025-05-26T11:37:09.758Z
Learning: In the Betaflight Configurator repository, only English messages should be added directly to locales/en/messages.json; other language translations are handled via Crowdin automation and should not be manually updated in PRs.

src/tabs/configuration.html (4)

Learnt from: haslinghuis
PR: #4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.

Learnt from: haslinghuis
PR: #4532
File: src/js/VirtualFC.js:234-234
Timestamp: 2025-06-27T22:06:49.210Z
Learning: In the betaflight-configurator codebase, the VirtualFC.js AUX_CONFIG array must stay synchronized with the betaflight firmware's msp_box.c definitions to ensure proper auxiliary mode functionality. Changes to mode names should follow the firmware source code even if it potentially breaks backward compatibility with saved presets.

Learnt from: mituritsyn
PR: #4526
File: src/js/gui.js:43-43
Timestamp: 2025-06-20T12:35:49.283Z
Learning: In the Betaflight Configurator codebase, tabs in defaultCloudBuildTabOptions are conditionally displayed based on firmware build options. The logic in serial_backend.js checks FC.CONFIG.buildOptions and only adds tabs to GUI.allowedTabs if the firmware was built with support for that feature.

Learnt from: haslinghuis
PR: #4490
File: locales/en/messages.json:1534-1545
Timestamp: 2025-05-26T11:37:09.758Z
Learning: In the Betaflight Configurator repository, only English messages should be added directly to locales/en/messages.json; other language translations are handled via Crowdin automation and should not be manually updated in PRs.

🔇 Additional comments (6)
locales/en/messages.json (1)

1713-1718: Localization keys look correct and follow existing JSON style
Keys, values, trailing commas, and indentation all match the file’s prevailing conventions.

src/css/tabs/configuration.less (1)

138-160: LGTM! Clean CSS implementation for beeper controls.

The styling follows good CSS practices with proper flexbox layout, consistent button appearance, and appropriate interactive states. The scoping within .tab-configuration ensures the styles won't conflict with other components.

src/tabs/configuration.html (2)

406-409: LGTM! Well-structured button group for DShot beeper controls.

The HTML follows good semantic practices with proper button elements, type attributes, and CSS classes for both styling and JavaScript event binding.


426-429: LGTM! Consistent implementation for analog beeper controls.

The button group maintains the same structure and pattern as the DShot beeper controls, ensuring UI consistency across the configuration tab.

src/js/tabs/configuration.js (2)

120-131: LGTM! Well-implemented DShot beeper toggle functionality.

The event handlers properly scope to the DShot beeper section and trigger change events to ensure existing validation logic is executed. The implementation follows consistent patterns with the rest of the codebase.


659-670: LGTM! Consistent analog beeper toggle implementation.

The handlers maintain the same pattern as the DShot beeper controls while properly scoping to the analog beeper section. Triggering change events ensures data consistency with existing logic.

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.

it works
image

padding: 0.15rem 0.5rem;
font-size: 10px;
border: 1px solid #ccc;
background: #f5f5f5;
Copy link
Member

Choose a reason for hiding this comment

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

Best to use the existing color variables instead of hard set colors - it looks off in dark mode the variables automatically switch between light and dark

    --surface-50: hsl(0, 0%, 100%);
    --surface-100: hsl(0, 0%, 98%);
    --surface-200: hsl(0, 0%, 95%);
    --surface-300: hsl(0, 0%, 92%);
    --surface-400: hsl(0, 0%, 84%);
    --surface-500: hsl(0, 0%, 75%);
    --surface-600: hsl(0, 0%, 65%);
    --surface-700: hsl(0, 0%, 55%);
    --surface-800: hsl(0, 0%, 40%);
    --surface-900: hsl(0, 0%, 30%);
    --surface-950: hsl(0, 0%, 20%);
image

Works correctly otherwise

Copy link

Copy link
Contributor

Preview URL: https://01f301d2.betaflight-configurator.pages.dev

Copy link
Member

@VitroidFPV VitroidFPV left a comment

Choose a reason for hiding this comment

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

image

Still a little off, but definitely better. I could fix this in a follow-up PR

@VitroidFPV VitroidFPV merged commit 25badda into betaflight:master Jul 31, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from App to Done in 2025.12.0 Jul 31, 2025
@haslinghuis haslinghuis deleted the beeper-config branch July 31, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants