Koala-Theme: Plans - temporary mode warning, link to plan settings#3147
Koala-Theme: Plans - temporary mode warning, link to plan settings#3147Brett-S-OWB wants to merge 16 commits intoopenWB:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds UI hints and navigation to help users understand and handle “temporary charge settings mode” while editing charging plans in the Koala web theme.
Changes:
- Expose a new MQTT-store computed flag for temporary charge template mode.
- Show a warning banner in scheduled/time plan detail dialogs when temporary mode is active.
- Add a “go to persistent plan settings” button and introduce a theme color variable for it; refactor charge point messages into a reusable
BaseMessage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/modules/web_themes/koala/source/src/stores/mqtt-store.ts | Adds temporaryChargeModeAktiv computed and exports it from the store. |
| packages/modules/web_themes/koala/source/src/css/quasar.variables.scss | Introduces --q-charge-plan-link-button CSS variable for button styling. |
| packages/modules/web_themes/koala/source/src/components/ChargePointTimeChargingPlanDetails.vue | Adds temporary-mode warning + link button in time plan details and sets fixed card width. |
| packages/modules/web_themes/koala/source/src/components/ChargePointScheduledPlanDetails.vue | Adds temporary-mode warning + link button in scheduled plan details and sets fixed card width. |
| packages/modules/web_themes/koala/source/src/components/ChargePointMessage.vue | Refactors to use new BaseMessage component. |
| packages/modules/web_themes/koala/source/src/components/BaseMessage.vue | New reusable message component with collapse behavior and styling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const temporaryChargeModeAktiv = computed(() => { | ||
| const chargeMode = getValue.value( | ||
| 'openWB/general/temporary_charge_templates_active' | ||
| ) as boolean | undefined; | ||
| return chargeMode; |
There was a problem hiding this comment.
temporaryChargeModeAktiv currently returns boolean | undefined because no default is provided to getValue.value(...). Since callers treat undefined as false anyway, consider passing a default (false) here and returning a plain boolean to simplify usage and keep it consistent with other boolean computeds in this store.
| --q-battery-fill: #{$battery-fill}; | ||
| --q-battery-fill-flow-diagram: #{$battery-fill-flow-diagram}; | ||
| --q-charge-point-stroke: #{$charge-point-stroke}; | ||
| --q-charge-point-fill: #{$charge-point-fill}; | ||
| --q-charge-plan-link-button: #{$charge-plan-link-button}; |
There was a problem hiding this comment.
--q-charge-plan-link-button is added to :root, but it’s not overridden in the .body--dark block later in this file (unlike other custom vars such as --q-charge-point-stroke/fill). If this button should be themed in dark mode as well, add a corresponding --q-charge-plan-link-button definition under .body--dark (potentially with a different color for contrast).
| v-if="showMessage" | ||
| class="row q-mt-sm q-pa-sm text-white no-wrap cursor-pointer" | ||
| :class="[{ 'items-center': collapsed }, messageClass]" | ||
| style="border-radius: 10px" | ||
| @click="toggleCollapse" | ||
| > | ||
| <q-icon :name="iconName" size="sm" class="q-mr-xs" /> | ||
| <div :class="{ ellipsis: collapsed }"> | ||
| {{ message }} | ||
| </div> |
There was a problem hiding this comment.
BaseMessage forces no-wrap and starts in collapsed=true mode, which will truncate the newly added long warning texts (and even when “expanded”, no-wrap still prevents wrapping). Consider adding a prop to disable collapsing / allow wrapping (or default warnings to expanded + wrap) so important warnings are fully readable without awkward overflow.
| ><q-icon left size="xs" name="settings" /> persistente Ladeplan | ||
| Einstellungen</q-btn |
There was a problem hiding this comment.
Button label text has grammatical/capitalization issues: "persistente Ladeplan Einstellungen" should be capitalized and typically hyphenated in German (e.g. "Persistente Ladeplan‑Einstellungen") for readability.
| <BaseMessage | ||
| :show-message="temporaryChargeModeActive" | ||
| message="Temporärer Modus aktiv. Alle Planänderungen werden nach dem Abstecken verworfen." | ||
| type="warning" | ||
| /> |
There was a problem hiding this comment.
PR description mentions an additional, stronger hint specifically when a new plan is created in temporary mode (that the whole plan will be discarded after unplugging). The current implementation always shows the same generic warning string, so that “new plan” case doesn’t seem to be covered yet.
| ><q-icon left size="xs" name="settings" /> persistente Ladeplan | ||
| Einstellungen</q-btn | ||
| > |
There was a problem hiding this comment.
Button label text has grammatical/capitalization issues: "persistente Ladeplan Einstellungen" should be capitalized and typically hyphenated in German (e.g. "Persistente Ladeplan‑Einstellungen") for readability.
| const temporaryChargeModeAktiv = computed(() => { | ||
| const chargeMode = getValue.value( | ||
| 'openWB/general/temporary_charge_templates_active' | ||
| ) as boolean | undefined; | ||
| return chargeMode; | ||
| }); |
There was a problem hiding this comment.
New store export is named temporaryChargeModeAktiv (German spelling) while the consuming components use temporaryChargeModeActive. To keep the public store API consistent with the rest of mqtt-store (mostly English names), consider renaming this to temporaryChargeModeActive (and update references) so callers don’t have to remember mixed-language naming.
| <BaseMessage | ||
| :show-message="temporaryChargeModeActive" | ||
| message="Temporärer Modus aktiv. Alle Planänderungen werden nach dem Abstecken verworfen." | ||
| type="warning" | ||
| /> |
There was a problem hiding this comment.
PR description mentions an additional, stronger hint specifically when a new plan is created in temporary mode (that the whole plan will be discarded after unplugging). The current implementation always shows the same generic warning string, so that “new plan” case doesn’t seem to be covered yet.
| size="sm" | ||
| class="col charge-plan-link-button" | ||
| :href="`/openWB/web/settings/#/VehicleConfiguration/charge_template/${chargeTemplateId ?? ''}`" | ||
| ><q-icon left size="xs" name="settings" /> persistente Ladeplan |
There was a problem hiding this comment.
The settings link is built even when chargeTemplateId is undefined (it falls back to an empty string), which can produce a broken URL like .../charge_template/. Consider guarding the button with v-if="temporaryChargeModeActive && chargeTemplateId != null" or disabling it until an ID is available.
| size="sm" | ||
| class="col charge-plan-link-button" | ||
| :href="`/openWB/web/settings/#/VehicleConfiguration/charge_template/${chargeTemplateId ?? ''}`" | ||
| ><q-icon left size="xs" name="settings" /> persistente Ladeplan |
There was a problem hiding this comment.
The settings link is built even when chargeTemplateId is undefined (it falls back to an empty string), which can produce a broken URL like .../charge_template/. Consider guarding the button with v-if="temporaryChargeModeActive && chargeTemplateId != null" or disabling it until an ID is available.
4499ab1 to
8a4ebdf
Compare
Wenn „Temporäre Ladeeinstellungen“ aktiviert sind:
• In den Ladeplänen wird ein Warnhinweis angezeigt, der den Nutzer darüber informiert, dass Änderungen am Plan nach dem Abstecken des Fahrzeugs verworfen werden.
• Wird in diesem Modus ein neuer Plan erstellt, erscheint zusätzlich ein Hinweis, dass der gesamte Plan nach der Ladesession (nach dem Abstecken) verworfen wird.
• Unteren in Plan wird ein Button zur direkten Navigation in die Fahrzeug-Ladeprofil-Einstellungen eingeblendet, damit Änderungen dort dauerhaft verändert werden können.