Skip to content

Fix: Use with modern dialog store for firmwareUpgradeRequired, update warning content#5081

Open
VitroidFPV wants to merge 2 commits intobetaflight:masterfrom
VitroidFPV:fix-firmwareUpgradeRequired
Open

Fix: Use with modern dialog store for firmwareUpgradeRequired, update warning content#5081
VitroidFPV wants to merge 2 commits intobetaflight:masterfrom
VitroidFPV:fix-firmwareUpgradeRequired

Conversation

@VitroidFPV
Copy link
Copy Markdown
Member

@VitroidFPV VitroidFPV commented May 2, 2026

The app would connect to the CLI without any notice, the previous warning did not show. This PR updates it to use the modern dialog store, and updates the warning to point directly to older app downloads that should be compatible with old firmware versions.

image

Summary by CodeRabbit

  • Documentation

    • Expanded firmware upgrade warning with detailed instructions, links to older app releases, and backup/restore cautions.
  • Style

    • Adjusted dialog confirm button max-width for improved layout.
  • Bug Fixes

    • Improved dialog behavior: version-mismatch now shows an information dialog, and dialogs reliably close on disconnect to prevent lingering modals.

@VitroidFPV VitroidFPV added this to the 2026.6 milestone May 2, 2026
@VitroidFPV VitroidFPV self-assigned this May 2, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 56b9af6e-590f-4f20-a41e-ca175b70bda1

📥 Commits

Reviewing files that changed from the base of the PR and between fcca3f7 and 1838832.

📒 Files selected for processing (2)
  • locales/en/messages.json
  • src/js/serial_backend.js
✅ Files skipped from review due to trivial changes (1)
  • locales/en/messages.json

Walkthrough

Updated the firmware-upgrade user message, refactored version-mismatch UI to use the Pinia-backed InformationDialog, and adjusted the dialog confirm button max-width.

Changes

Firmware upgrade + dialog migration

Layer / File(s) Summary
Message Content
locales/en/messages.json
firmwareUpgradeRequired.message replaced with a longer multi-paragraph warning including links to older Betaflight App releases, CLI version instructions, backup/restore guidance, and a caution about older-firmware backups (PID/failsafe called out).
Core Control Flow
src/js/serial_backend.js
showVersionMismatchAndCli(message) now opens an i18n-driven InformationDialog via useDialogStore().open("InformationDialog", ...) (confirm handler closes via dialogStore.close()), then continues to connectCli(). finishClose() and onClosed() now ensure any active InformationDialog/Pinia modal is closed.
Styling / Layout
src/css/main.less
.dialogInformation .dialogInformation-confirmButton max-width changed from 400px to 42rem to accommodate the longer dialog content.

Sequence Diagram(s)

sequenceDiagram
    participant Serial as serial_backend
    participant Dialog as DialogStore
    participant CLI as CLI/Connection

    Serial->>Dialog: open InformationDialog(title, message, confirm)
    Dialog-->>Serial: user presses confirm -> confirm handler
    Serial->>Dialog: dialogStore.close()
    Serial->>CLI: connectCli()
    CLI-->>Serial: connection established / error
    Serial->>Dialog: onClosed/finishClose -> dialogStore.close() (cleanup)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Fix offline dialog #4975: Related UI adjustments to InformationDialog styling (padding) that complement this PR’s dialog styling changes.

Suggested reviewers

  • blckmn
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete; it lacks required sections from the template and provides minimal context about the changes made. Add details explaining the problem being fixed, the solution approach, and reference any related issues using 'Fixes #' format as required by the template.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main changes: fixing the firmwareUpgradeRequired flow to use the modern dialog store and updating the warning content.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: Turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).


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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@locales/en/messages.json`:
- Line 638: The message string under the "message" key in
locales/en/messages.json currently links to firmware releases
(github.com/betaflight/betaflight) but the text refers to "older releases" of
the app; update the two href URLs to point to the Betaflight App/Configurator
release pages (e.g., github.com/betaflight/betaflight-configurator or the
official app releases repo) so the links match the wording and guide users to
app downloads; keep the same anchor text and attributes (target/rel) and ensure
the two replaced URLs correspond to the intended app release versions referenced
in the copy (e.g., app release matching 10.8.0 and 10.5.1 equivalents).

In `@src/js/serial_backend.js`:
- Around line 347-362: The disconnect path leaves the InformationDialog opened
by showVersionMismatchAndCli() because finishClose() only closes
InteractiveDialog; update finishClose() to also close InformationDialog (i.e.
check if dialogStore.activeDialog?.type is "InteractiveDialog" OR
"InformationDialog" and call dialogStore.close()) or unconditionally call
dialogStore.close() to ensure any leftover modal is removed on disconnect;
reference finishClose(), dialogStore.activeDialog?.type, "InteractiveDialog",
"InformationDialog", dialogStore.close(), and showVersionMismatchAndCli() when
making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bf8db74b-c2f8-4c6f-ba60-30d7f8c49c6b

📥 Commits

Reviewing files that changed from the base of the PR and between a58d7e8 and fcca3f7.

📒 Files selected for processing (3)
  • locales/en/messages.json
  • src/css/main.less
  • src/js/serial_backend.js

Comment thread locales/en/messages.json Outdated
Comment thread src/js/serial_backend.js
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 2, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

🎉 Do you want to test this code? 🎉

⚠️ CAUTION: The build may be unstable and result in corrupted configurations or data loss. Use only for testing! ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: App

Development

Successfully merging this pull request may close these issues.

2 participants