Skip to content

frontend: fix usage of autopilot_data instead of autopilot#3983

Merged
patrickelectric merged 1 commit into
bluerobotics:masterfrom
Williangalvani:autopilot_instead_of_autopilot_data
Jul 10, 2026
Merged

frontend: fix usage of autopilot_data instead of autopilot#3983
patrickelectric merged 1 commit into
bluerobotics:masterfrom
Williangalvani:autopilot_instead_of_autopilot_data

Conversation

@Williangalvani

@Williangalvani Williangalvani commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary by Sourcery

Bug Fixes:

  • Fix frame type parameter resolution by switching on the correct autopilot vehicle type property.

@cursor

cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="core/frontend/src/components/vehiclesetup/configuration/ArdupilotVehicleBodySetup.vue" line_range="68" />
<code_context>
     },
     frame_type_parameter(): Parameter | undefined {
-      switch (autopilot_data.vehicle_type) {
+      switch (autopilot.vehicle_type) {
         case 'Submarine':
         case 'Surface Boat':
</code_context>
<issue_to_address>
**issue (bug_risk):** Potentially inconsistent use of `autopilot` vs `autopilot_data` when switching on `vehicle_type`.

In other parts of this component, parameters come from `autopilot_data`, and this line previously used `autopilot_data.vehicle_type`. If `autopilot` and `autopilot_data` can differ, using `autopilot.vehicle_type` here might cause the frame type to no longer match the parameter source. Please confirm `autopilot.vehicle_type` is the intended authoritative value, or standardise on one of these objects for consistency.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: LGTM :shipit:

One-line bug fix in core/frontend/src/components/vehiclesetup/configuration/ArdupilotVehicleBodySetup.vue:68: the frame_type_parameter computed was reading autopilot_data.vehicle_type, but vehicle_type is defined on the autopilot_manager store (imported here as autopilot), not the autopilot parameter store (imported as autopilot_data). The old code would always fall into the default branch and return undefined, hiding the Frame Subtype selector. Confirmed by grep that this was the only remaining stale reference under core/frontend/, and matches the existing usage pattern in core/frontend/src/store/autopilot.ts which also reads autopilot_manager.vehicle_type.

No further comments, nice job 👍

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@Williangalvani Williangalvani added the move-to-stable Needs to be cherry-picked and move to stable label Jul 9, 2026
@patrickelectric patrickelectric merged commit eb8fdbb into bluerobotics:master Jul 10, 2026
9 checks passed
@patrickelectric patrickelectric deleted the autopilot_instead_of_autopilot_data branch July 10, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

move-to-stable Needs to be cherry-picked and move to stable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants