Skip to content

Conversation

@naltatis
Copy link
Member

@naltatis naltatis commented Jan 6, 2026

fixes #24217

Make broken loadpoint references (circuit, vehicle) fixable in UI.

Note: Loadpoint/vehicle refs are already auto-removed, when you delete a vehicle via UI. However, since we support mixed setup (vehicle via yaml, lp via ui) broken refs can still happen. I've added extra handling and tests to cover this.

Bildschirmfoto 2026-01-06 um 16 01 32

@naltatis naltatis added bug Something isn't working ux User experience/ interface labels Jan 6, 2026
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 left some high level feedback:

  • The VehicleOption type could likely be simplified to non-optional, non-nullable fields (key: string; name: string) since all current usages set both properties to concrete strings, which would tighten typing and reduce null/undefined handling overhead.
  • The invalidCircuit and invalidVehicle computed properties share the same pattern of reference validation; consider extracting a small reusable helper (e.g., isInvalidReference(value, options)) to reduce duplication and keep the logic consistent if it evolves.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `VehicleOption` type could likely be simplified to non-optional, non-nullable fields (`key: string; name: string`) since all current usages set both properties to concrete strings, which would tighten typing and reduce `null`/`undefined` handling overhead.
- The `invalidCircuit` and `invalidVehicle` computed properties share the same pattern of reference validation; consider extracting a small reusable helper (e.g., `isInvalidReference(value, options)`) to reduce duplication and keep the logic consistent if it evolves.

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.

@andig andig merged commit 19bcd72 into master Jan 7, 2026
7 checks passed
@andig andig deleted the fix/config_ui_lp_refs branch January 7, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ux User experience/ interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config UI: fix broken circuit, meter, loadpoint relations via UI

3 participants