frontend: wizard: check if there is a board available before running wizard customization step#3821
Open
nicoschmdt wants to merge 1 commit intobluerobotics:masterfrom
Open
frontend: wizard: check if there is a board available before running wizard customization step#3821nicoschmdt wants to merge 1 commit intobluerobotics:masterfrom
nicoschmdt wants to merge 1 commit intobluerobotics:masterfrom
Conversation
…wizard customization step
Reviewer's GuideAdds a board-presence check to the wizard’s vehicle customization step and firmware installation, showing a warning in the UI and aborting actions when no flight controller is detected. Sequence diagram for board check in wizard customization and firmware installsequenceDiagram
actor User
participant WizardVue as WizardVue
participant AutopilotManagerUpdater as AutopilotManagerUpdater
participant Autopilot as Autopilot
rect rgb(230,230,255)
User->>WizardVue: click setupBoat or setupROV
WizardVue->>AutopilotManagerUpdater: fetchCurrentBoard()
AutopilotManagerUpdater-->>Autopilot: update current_board
Autopilot-->>WizardVue: current_board state
alt current_board is null
WizardVue->>WizardVue: set board_not_detected = true
WizardVue-->>User: show warning No flight controller detected
else current_board present
WizardVue->>WizardVue: set board_not_detected = false
WizardVue->>WizardVue: set vehicle_type, vehicle_name, vehicle_image
WizardVue-->>User: show configured vehicle in customization step
end
end
rect rgb(230,255,230)
User->>WizardVue: start installLatestStableFirmware(vehicle)
WizardVue->>AutopilotManagerUpdater: fetchCurrentBoard()
AutopilotManagerUpdater-->>Autopilot: update current_board
Autopilot-->>WizardVue: current_board state
alt current_board is null
WizardVue-->>User: return status No flight controller board detected
else current_board present
WizardVue->>Autopilot: continue firmware installation flow
Autopilot-->>WizardVue: firmware install result
WizardVue-->>User: show install status
end
end
Class diagram for Wizard component board detection changesclassDiagram
class WizardVue {
bool board_not_detected
bool model_viewer_supported
bool model_viewer_ready
int configuration_page_index
Vehicle vehicle_type
string vehicle_name
string vehicle_image
+async setupBoat()
+async setupROV()
+async installLatestStableFirmware(vehicle Vehicle) ConfigurationStatus
}
class AutopilotManagerUpdater {
+availableFirmwares
+fetchCurrentBoard()
+fetchFirmwareInfo()
+installFirmwareFromUrl()
}
class Autopilot {
Board current_board
}
WizardVue ..> AutopilotManagerUpdater : uses fetchCurrentBoard
WizardVue ..> Autopilot : reads current_board for board detection
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
fetchCurrentBoard+autopilot.current_boardcheck is duplicated insetupBoat,setupROV, andinstallLatestStableFirmware; consider extracting a small helper (e.g.,ensureBoardConnected()that also managesboard_not_detected) to keep this logic consistent and easier to change. - The new async
setupBoat/setupROVmethods assumefetchCurrentBoardalways resolves successfully; it may be worth handling or surfacing errors from that call explicitly so the user sees a clear message if board detection fails for reasons other than no board being present.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `fetchCurrentBoard` + `autopilot.current_board` check is duplicated in `setupBoat`, `setupROV`, and `installLatestStableFirmware`; consider extracting a small helper (e.g., `ensureBoardConnected()` that also manages `board_not_detected`) to keep this logic consistent and easier to change.
- The new async `setupBoat`/`setupROV` methods assume `fetchCurrentBoard` always resolves successfully; it may be worth handling or surfacing errors from that call explicitly so the user sees a clear message if board detection fails for reasons other than no board being present.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #3426
before:

after:

if the board is disconnected after the customization step the correct error is shown:

Summary by Sourcery
Ensure the wizard checks for a connected flight controller board before running customization and firmware installation steps, and surfaces clear feedback when none is detected.
Bug Fixes:
Enhancements: