Battery Boost UI: disable button when battery on hold#28489
Open
Battery Boost UI: disable button when battery on hold#28489
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The UI treats the button as logically unavailable in
batteryHoldbut doesn’t actually disable it (:disabledremains driven only bydisabled), which may be confusing for accessibility and screen readers given the PR title; consider wiringbatteryHoldinto the disabled state or otherwise exposing this state via ARIA (e.g.aria-disabled). - You introduced the
BATTERY_MODEenum but still type thebatteryModeprop asStringinLoadpoint.vue,Loadpoints.vue,Site.vue, andVehicle.vue; tightening these toPropType<BATTERY_MODE>would give you better type safety and prevent accidental misuse.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The UI treats the button as logically unavailable in `batteryHold` but doesn’t actually disable it (`:disabled` remains driven only by `disabled`), which may be confusing for accessibility and screen readers given the PR title; consider wiring `batteryHold` into the disabled state or otherwise exposing this state via ARIA (e.g. `aria-disabled`).
- You introduced the `BATTERY_MODE` enum but still type the `batteryMode` prop as `String` in `Loadpoint.vue`, `Loadpoints.vue`, `Site.vue`, and `Vehicle.vue`; tightening these to `PropType<BATTERY_MODE>` would give you better type safety and prevent accidental misuse.
## Individual Comments
### Comment 1
<location path="assets/js/components/Loadpoints/Loadpoints.vue" line_range="91" />
<code_context>
batteryBoostLimit: { type: Number, default: 100 },
batteryConfigured: Boolean,
batterySoc: Number,
+ batteryMode: String,
// session
</code_context>
<issue_to_address>
**suggestion:** Align `batteryMode` prop typing with `BATTERY_MODE` enum for better type safety.
Here, and in `Loadpoint.vue`/`Vehicle.vue`, `batteryMode` is typed as a plain `String`, so you lose the `BATTERY_MODE` enum guarantees from `BatteryBoostButton.vue`. Please update these props to use `String as PropType<BATTERY_MODE>` (or equivalent) to preserve type safety and ensure consistent use of `BATTERY_MODE` across components.
</issue_to_address>
### Comment 2
<location path="server/mcp/openapi.md" line_range="485" />
<code_context>
## setLoadpointBatteryBoost
-Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit.
+Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to configured SoC limit. Note: boost will not work while the battery is on hold (e.g. during fast charging or planned charging with discharge prevention enabled).
**Tags:** loadpoints
</code_context>
<issue_to_address>
**nitpick (typo):** Consider adding 'the' before 'configured SoC limit' for grammatical correctness.
Change the phrase to "drained to the configured SoC limit." for improved readability; the rest of the note reads clearly.
```suggestion
Enable or disable battery boost. When active, the maximum available home battery power is added until the home battery is drained to the configured SoC limit. Note: boost will not work while the battery is on hold (e.g. during fast charging or planned charging with discharge prevention enabled).
```
</issue_to_address>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.
fixes #28419
Only addresses UI. Boost API can still be called. Added behavior note to the docs.