Skip to content

Battery Boost UI: disable button when battery on hold#28489

Open
naltatis wants to merge 6 commits intomasterfrom
feat/battery_boost_hold_disable
Open

Battery Boost UI: disable button when battery on hold#28489
naltatis wants to merge 6 commits intomasterfrom
feat/battery_boost_hold_disable

Conversation

@naltatis
Copy link
Member

fixes #28419

Only addresses UI. Boost API can still be called. Added behavior note to the docs.

@naltatis naltatis added enhancement New feature or request ux User experience/ interface labels Mar 23, 2026
@naltatis naltatis requested a review from andig March 23, 2026 11:01
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • 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.
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>

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.

naltatis and others added 4 commits March 23, 2026 12:13
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ux User experience/ interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Battery Boost does not override Battery Hold during Planned Charging

1 participant