frontend: vehiclesetup: failsafes: visual improvements#3799
frontend: vehiclesetup: failsafes: visual improvements#3799patrickelectric merged 6 commits intobluerobotics:masterfrom
Conversation
…er leak sensor card
Reviewer's GuideUpdates the vehiclesetup failsafes configuration UI to better indicate and handle disabled failsafes, propagates a new disabled state into the inline parameter editor, tweaks layout/styling, reorders some failsafe cards, and fixes the Failsafes component naming/background color usage in the vehiclesetup configuration screen. Sequence diagram for disabled failsafe parameter editing flowsequenceDiagram
actor User
participant Configure
participant FailsafesConfiguration
participant FailsafeCard
participant InlineParameterEditor
participant AutopilotParamsStore
User->>Configure: Select tab failsafes
Configure->>FailsafesConfiguration: Render component
FailsafesConfiguration->>AutopilotParamsStore: Load failsafe params
AutopilotParamsStore-->>FailsafesConfiguration: params_finished_loaded, params
FailsafesConfiguration->>FailsafeCard: Pass failsafeDefinition, params
loop For each failsafe param
FailsafeCard->>InlineParameterEditor: Render with param, disabled = is_disabled && param.name != actionParamName
end
User->>InlineParameterEditor: Change enable param value
InlineParameterEditor->>AutopilotParamsStore: Update param FS_NAME_ENABLE
AutopilotParamsStore-->>FailsafeCard: Updated param values
FailsafeCard->>FailsafeCard: is_disabled = params[controlParam.name].value === 0
FailsafeCard->>InlineParameterEditor: Re-render children with updated disabled flags
User->>InlineParameterEditor: Try edit non action param when failsafe is disabled
InlineParameterEditor->>InlineParameterEditor: disabled prop true, block input
User->>InlineParameterEditor: Edit action param
InlineParameterEditor->>AutopilotParamsStore: Update action param while other fields remain read only
Class diagram for updated failsafes configuration componentsclassDiagram
class Configure {
+main_container_style : background-color var(--v-mariner_blue-base)
+items : Item[]
+data()
}
class FailsafesConfiguration {
+name : FailsafesConfiguration
+params_finished_loaded : boolean
+failsafes : FailsafeDefinition[]
+created()
+load_failsafe_definitions()
}
class FailsafeDefinition {
+name : string
+generalDescription : string
+image : string
+params : ParamDefinitions[]
}
class ParamDefinitions {
+name : string
+replacementTitle : string
+icon : string
}
class FailsafeCard {
+props failsafeDefinition : FailsafeDefinition
+props params : any
+data image : string
+computed available_params() ParamDefinitions[]
+computed is_disabled() boolean
+computed actionParamName() string
+mounted()
+loadImage()
+findControlParam() ParamDefinitions
}
class InlineParameterEditor {
+props param : any
+props label : string
+props formatOptions : any
+props forcing_input : boolean
+props custom_input : boolean
+props disabled : boolean
+data internal_new_value : number | string
+data waiting_for_param_update : boolean
+computed as_select_items() any[]
+methods updateVariables()
+methods isInRange(value)
+methods isValidType(value)
}
Configure --> FailsafesConfiguration : uses
FailsafesConfiguration o--> FailsafeDefinition : defines
FailsafesConfiguration --> FailsafeCard : renders
FailsafeDefinition o--> ParamDefinitions : has
FailsafeCard o--> ParamDefinitions : uses
FailsafeCard --> InlineParameterEditor : renders_with_disabled_prop
InlineParameterEditor --> ParamDefinitions : uses_param_metadata
File-Level Changes
Assessment against 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
findControlParamheuristic inFailsafeCard.vuecurrently relies onreplacementTitletext ('Action'/'Enable') and'_ENABLE'in the name, which is brittle; consider adding an explicit flag on the param definition (e.g.isControlParam: true) and using that instead. - The hard-coded
'DISABLED'label in the.disabled-failsafe::afterCSS pseudo-element bypasses your usual localization/i18n pipeline; consider rendering this badge via the template so it can be translated.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `findControlParam` heuristic in `FailsafeCard.vue` currently relies on `replacementTitle` text (`'Action'`/`'Enable'`) and `'_ENABLE'` in the name, which is brittle; consider adding an explicit flag on the param definition (e.g. `isControlParam: true`) and using that instead.
- The hard-coded `'DISABLED'` label in the `.disabled-failsafe::after` CSS pseudo-element bypasses your usual localization/i18n pipeline; consider rendering this badge via the template so it can be translated.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on February 15
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
core/frontend/src/components/vehiclesetup/configuration/failsafes/FailsafeCard.vue
Show resolved
Hide resolved
2cee89a to
93e6e41
Compare
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The logic in
findControlParamrelies on hard-codedreplacementTitlestrings and_ENABLEsuffixes; consider making the control/action parameter explicit in the failsafe definition type instead of inferring it via string matching to avoid future breakage when labels change. - The
'DISABLED'label in the.disabled-failsafe::afterCSS rule is hard-coded; if the rest of the UI is localized or configurable, you may want to move this into a translatable string rendered in the template rather than in CSS content.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The logic in `findControlParam` relies on hard-coded `replacementTitle` strings and `_ENABLE` suffixes; consider making the control/action parameter explicit in the failsafe definition type instead of inferring it via string matching to avoid future breakage when labels change.
- The `'DISABLED'` label in the `.disabled-failsafe::after` CSS rule is hard-coded; if the rest of the UI is localized or configurable, you may want to move this into a translatable string rendered in the template rather than in CSS content.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
fix: #2788 and fix: #2786
Note
Cursor Bugbot is generating a summary for commit 2cee89a. Configure here.
Summary by Sourcery
Improve the vehiclesetup failsafes UI and disabled-state behavior.
New Features:
Bug Fixes:
Enhancements:
Summary by Sourcery
Improve the vehiclesetup failsafes UI, including disabled-state handling and configuration wiring.
New Features:
Bug Fixes:
Enhancements: