From 711373eab44ebd2d04ee2e8704f06e864128eb93 Mon Sep 17 00:00:00 2001 From: Theo <36564257+theoholl@users.noreply.github.com> Date: Thu, 12 Mar 2026 19:34:05 +0000 Subject: [PATCH 1/4] Add default icon and load settings lazily Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com> --- .../navigation/AppNavigationBoard.vue | 47 ++++++++++--------- src/store/main.js | 22 +++++++++ 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index 4fac039ce1..06c541949f 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -112,10 +112,9 @@ - {{ dueDateReminderText }} + icon="icon-sound" + @click="openDueReminderMenu"> + {{ t('deck', 'Due date reminders') }} acl.participant.uid === this.currentUser?.uid && acl.participant.type === 0) !== undefined }, - dueDateReminderIcon() { - if (this.board.settings['notify-due'] === 'all') { - return 'icon-sound' - } else if (this.board.settings['notify-due'] === 'assigned') { - return 'icon-user' - } else if (this.board.settings['notify-due'] === 'off') { - return 'icon-sound-off' - } - return '' - }, - dueDateReminderText() { - if (this.board.settings['notify-due'] === 'all') { - return t('deck', 'All cards') - } else if (this.board.settings['notify-due'] === 'assigned') { - return t('deck', 'Only assigned cards') - } else if (this.board.settings['notify-due'] === 'off') { - return t('deck', 'No reminder') - } - return '' + hasDueDateReminderSetting() { + return ['all', 'assigned', 'off'].includes(this.board.settings?.['notify-due']) }, isDefaultBoard() { return this.defaultBoardId === String(this.board.id) @@ -417,6 +400,24 @@ export default { cancelEdit(e) { this.editing = false }, + async openDueReminderMenu() { + this.isDueSubmenuActive = true + + if (this.hasDueDateReminderSetting || this.loadingDueReminderSettings) { + return + } + + this.loadingDueReminderSettings = true + + try { + await this.$store.dispatch('hydrateBoardSettings', this.board.id) + } catch (error) { + OC.Notification.showTemporary(t('deck', 'Failed to load due date reminder settings')) + console.error(error) + } finally { + this.loadingDueReminderSettings = false + } + }, async updateSetting(key, value) { this.updateDueSetting = value const setting = {} diff --git a/src/store/main.js b/src/store/main.js index 857d31073c..7b53e32450 100644 --- a/src/store/main.js +++ b/src/store/main.js @@ -252,6 +252,23 @@ export default function storeFactory() { setCurrentCard(state, card) { state.currentCard = card }, + setBoardSettings(state, { boardId, settings }) { + const indexExisting = state.boards.findIndex((board) => board.id === boardId) + + if (indexExisting > -1) { + Vue.set(state.boards[indexExisting], 'settings', { + ...(state.boards[indexExisting].settings || {}), + ...settings, + }) + } + + if (state.currentBoard?.id === boardId) { + Vue.set(state.currentBoard, 'settings', { + ...(state.currentBoard.settings || {}), + ...settings, + }) + } + }, // label mutators removeLabelFromCurrentBoard(state, labelId) { @@ -309,6 +326,11 @@ export default function storeFactory() { setFullApp({ commit }, isFullApp) { commit('setFullApp', isFullApp) }, + async hydrateBoardSettings({ commit }, boardId) { + const board = await apiClient.loadById(boardId) + commit('setBoardSettings', { boardId, settings: board.settings || {} }) + return board.settings || {} + }, async setConfig({ commit }, config) { for (const key in config) { try { From 8d352dda7e0685b3463e71efb6b3c1405503b0fc Mon Sep 17 00:00:00 2001 From: Theo <36564257+theoholl@users.noreply.github.com> Date: Sun, 15 Mar 2026 09:02:04 +0000 Subject: [PATCH 2/4] Restore shared board reminder labels and lazy-load settings on menu open Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com> --- .../navigation/AppNavigationBoard.vue | 55 ++++++++++++++----- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index 06c541949f..a54f934ac9 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -12,6 +12,7 @@ :menu-placement="'auto'" :force-display-actions="isTouchDevice" @click="onNavigate" + @update:menuOpen="onUpdateMenuOpen" @undo="unDelete"> - {{ t('deck', 'Due date reminders') }} + :name="t('deck', 'Due date reminders')" + :icon="dueDateReminderIcon" + @click="isDueSubmenuActive=true"> + {{ dueDateReminderText }} acl.participant.uid === this.currentUser?.uid && acl.participant.type === 0) !== undefined }, + dueDateReminderIcon() { + if (this.board.settings['notify-due'] === 'all') { + return 'icon-sound' + } else if (this.board.settings['notify-due'] === 'assigned') { + return 'icon-user' + } else if (this.board.settings['notify-due'] === 'off') { + return 'icon-sound-off' + } + + return '' + }, + dueDateReminderText() { + if (this.board.settings['notify-due'] === 'all') { + return t('deck', 'All cards') + } else if (this.board.settings['notify-due'] === 'assigned') { + return t('deck', 'Assigned cards') + } else if (this.board.settings['notify-due'] === 'off') { + return t('deck', 'No notifications') + } + + return '' + }, hasDueDateReminderSetting() { return ['all', 'assigned', 'off'].includes(this.board.settings?.['notify-due']) }, @@ -400,10 +424,15 @@ export default { cancelEdit(e) { this.editing = false }, - async openDueReminderMenu() { - this.isDueSubmenuActive = true + async onUpdateMenuOpen(menuOpen) { + this.menuOpen = menuOpen + + if (!menuOpen) { + this.isDueSubmenuActive = false + return + } - if (this.hasDueDateReminderSetting || this.loadingDueReminderSettings) { + if (this.board.archived || this.board.acl?.length === 0 || this.hasDueDateReminderSetting || this.loadingDueReminderSettings) { return } From 610d277ab4bb8365aea283ccb1b4f235f0fc6db9 Mon Sep 17 00:00:00 2001 From: Theo <36564257+theoholl@users.noreply.github.com> Date: Tue, 17 Mar 2026 21:04:33 +0000 Subject: [PATCH 3/4] Give submenu items regular font weight Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com> --- src/components/navigation/AppNavigationBoard.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index a54f934ac9..902150aff4 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -91,25 +91,25 @@ + @click="updateSetting('notify-due', 'all')"> + {{ t('deck', 'All cards') }} + {{ t('deck', 'Assigned cards') }} + {{ t('deck', 'No notifications') }} Date: Tue, 17 Mar 2026 21:17:03 +0000 Subject: [PATCH 4/4] Fix linting errors Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com> --- src/components/navigation/AppNavigationBoard.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index 902150aff4..cc6a430978 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -90,22 +90,19 @@ {{ t('deck', 'Due date reminders') }} - {{ t('deck', 'All cards') }} - {{ t('deck', 'Assigned cards') }} -