From 7abf25aa19500b59a34f4aeb52340a97d1ebb6f9 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Fri, 24 Jul 2026 11:36:50 +0200 Subject: [PATCH 1/5] feat(tests): add pinia options to mountComponent test utility --- src/test-utils/mountComponent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test-utils/mountComponent.js b/src/test-utils/mountComponent.js index 5f796cc..e381b3b 100644 --- a/src/test-utils/mountComponent.js +++ b/src/test-utils/mountComponent.js @@ -20,7 +20,7 @@ import { mount } from '@vue/test-utils'; import { createI18n } from 'vue-i18n'; import { createMemoryHistory, createRouter } from 'vue-router'; -export const mountComponent = function mountComponent (component, options = {}, i18nMessages = {}, routes = []) { +export const mountComponent = function mountComponent (component, options = {}, i18nMessages = {}, routes = [], piniaOptions = {}) { const i18n = createI18n({ legacy: false, locale: 'en', @@ -40,6 +40,7 @@ export const mountComponent = function mountComponent (component, options = {}, i18n, router, createTestingPinia({ + ...piniaOptions, stubActions: false, createSpy: vi.fn }) From f81ce63062f05799e73fe99f3b96dcc3afea8123 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Fri, 24 Jul 2026 11:59:08 +0200 Subject: [PATCH 2/5] feat(settings): make setting input reactive to stored setting --- .../settings/components/SettingsInput.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/features/settings/components/SettingsInput.vue b/src/features/settings/components/SettingsInput.vue index b46d7eb..18b7367 100644 --- a/src/features/settings/components/SettingsInput.vue +++ b/src/features/settings/components/SettingsInput.vue @@ -19,7 +19,7 @@ import Icon from '@/features/icons/components/Icon.vue'; import { useSettingsStore } from '../stores/settingsStore'; -import { computed, useId } from 'vue'; +import { computed, ref, useId, watch } from 'vue'; import { useI18n } from 'vue-i18n'; const { t } = useI18n(); @@ -35,8 +35,9 @@ const props = defineProps({ const store = useSettingsStore(); -const inputModel = defineModel(); -inputModel.value = store.get(props.path); +const inputModel = ref(store.get(props.path)); +let oldInputValue = inputModel.value; + const inputId = useId(); const inputLabelId = useId(); @@ -50,6 +51,14 @@ const hasChanged = computed(() => inputModel.value !== store.get(props.path) ); +watch(store, (newValue) => { + const newInputValue = newValue.get(props.path); + if (inputModel.value === oldInputValue) { + inputModel.value = newInputValue; + oldInputValue = newInputValue; + }; +}); + const apply = function apply () { store.set(props.path, inputModel.value); }; From 9ce4cec0bf857b05f22941953452268d64f4257c Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Fri, 24 Jul 2026 12:17:48 +0200 Subject: [PATCH 3/5] fix(settings): prevent setting input done button from animating initially when mounting --- src/features/settings/components/SettingsInput.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/features/settings/components/SettingsInput.vue b/src/features/settings/components/SettingsInput.vue index 18b7367..88bf6b5 100644 --- a/src/features/settings/components/SettingsInput.vue +++ b/src/features/settings/components/SettingsInput.vue @@ -38,6 +38,8 @@ const store = useSettingsStore(); const inputModel = ref(store.get(props.path)); let oldInputValue = inputModel.value; +const doneButtonInitial = ref(true); + const inputId = useId(); const inputLabelId = useId(); @@ -59,6 +61,10 @@ watch(store, (newValue) => { }; }); +watch(inputModel, () => { + doneButtonInitial.value = false; +}); + const apply = function apply () { store.set(props.path, inputModel.value); }; @@ -82,7 +88,9 @@ const apply = function apply () { class="input" />