From b208767072bd024e46960ee60ab6bea4addc35b7 Mon Sep 17 00:00:00 2001 From: "Const.Dave" Date: Mon, 28 Aug 2023 11:33:24 -0500 Subject: [PATCH 1/6] add autofocus on title --- src/components/TestWrapper.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/TestWrapper.vue b/src/components/TestWrapper.vue index 6578fd05..dfb1b670 100644 --- a/src/components/TestWrapper.vue +++ b/src/components/TestWrapper.vue @@ -11,6 +11,7 @@ Date: Mon, 28 Aug 2023 18:11:51 -0500 Subject: [PATCH 2/6] added focus on NotesWrapper --- src/components/NotesWrapper.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NotesWrapper.vue b/src/components/NotesWrapper.vue index 5f0b957a..3546adb4 100644 --- a/src/components/NotesWrapper.vue +++ b/src/components/NotesWrapper.vue @@ -605,6 +605,7 @@ export default { this.emojiMenu[`menu-${item.id}`] = false; }); this.fetchNotes(); + this.$refs.notes.editor.commands.focus(); }, methods: { async fetchNotes() { From 0091e8e662327c7d1dc1452eeaaa6c69482a1340 Mon Sep 17 00:00:00 2001 From: "Const.Dave" Date: Wed, 30 Aug 2023 11:53:42 -0500 Subject: [PATCH 3/6] Autofocus Dialogs and add evidence view --- src/components/ControlPanel.vue | 48 +++++++++++++++++-- .../dialogs/DeleteConfirmDialog.vue | 1 + src/components/dialogs/NewSessionDialog.vue | 1 + src/components/dialogs/ResetConfirmDialog.vue | 1 + src/components/dialogs/SaveConfirmDialog.vue | 1 + src/views/AddEvidence.vue | 3 ++ 6 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index cde81b0c..2d4afcb9 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -59,7 +59,7 @@ block :color="currentTheme.primary" :style="{ color: currentTheme.white }" - @click="deleteConfirmDialog = true" + @click="handleDeleteConfirmDialog" > mdi-delete {{ $tc("caption.delete", 1) }} @@ -166,7 +166,7 @@ small color="default" v-on="on" - @click="newSessionDialog = true" + @click="handleNewSessionDialog" > mdi-content-save @@ -186,7 +186,7 @@ small color="default" v-on="on" - @click="resetConfirmDialog = true" + @click="handleResetConfirmDialog" > mdi-close-circle @@ -613,11 +613,13 @@ /> { this.callback = () => this.clearSession(); - this.newSessionDialog = true; + this.handleNewSessionDialog(); }); // save session window.ipc.on("SAVE_SESSION", () => { - this.saveSession(() => (this.saveConfirmDialog = true)); + this.saveSession(() => { + this.saveConfirmDialog = true; + + setTimeout(() => { + this.$refs.saveConfirmDialog.$refs.confirmBtn.focus(); + }); + }); }); // reset session @@ -985,6 +997,12 @@ export default { } }); }, + handleNewSessionDialog() { + this.newSessionDialog = true; + setTimeout(() => { + this.$refs.newSessionDialog.$refs.confirmBtn.$el.focus(); + }, 100); + }, startNewSession() { this.$root.$emit("start-new-session"); if (!this.checkedStatusOfPreSessionTask) { @@ -993,6 +1011,12 @@ export default { this.$store.commit("setQuickTest", false); this.showSourcePickerDialog(); }, + handleResetConfirmDialog() { + this.resetConfirmDialog = true; + setTimeout(() => { + this.$refs.resetConfirmDialog.$refs.confirmBtn.$el.focus(); + }, 100); + }, fetchSources() { return new Promise(function (resolver, reject) { if (!window.ipc) return reject(); @@ -1032,6 +1056,10 @@ export default { showNoteDialog() { if (this.viewMode === "normal") { this.noteDialog = true; + // settimeout + setTimeout(() => { + this.$refs.noteDialog.$refs.comment.editor.commands.focus(); + }); } else { if (!window.ipc) return; window.ipc.invoke(IPC_HANDLERS.WINDOW, { @@ -1050,6 +1078,12 @@ export default { hideNoteDialog() { this.noteDialog = false; }, + handleDeleteConfirmDialog() { + this.deleteConfirmDialog = true; + setTimeout(() => { + this.$refs.deleteConfirmDialog.$refs.confirmBtn.$el.focus(); + }, 100); + }, startInterval() { console.log("start interval"); if (!this.interval) { @@ -1180,6 +1214,10 @@ export default { showSummaryDialog() { if (this.viewMode === "normal") { this.summaryDialog = true; + + setTimeout(() => { + this.$refs.SummaryDialog.$refs.comment.editor.commandManager.commands.focus(); + }, 200); } else { if (!window.ipc) return; window.ipc.invoke(IPC_HANDLERS.WINDOW, { diff --git a/src/components/dialogs/DeleteConfirmDialog.vue b/src/components/dialogs/DeleteConfirmDialog.vue index 9ca48e7b..d54e287f 100644 --- a/src/components/dialogs/DeleteConfirmDialog.vue +++ b/src/components/dialogs/DeleteConfirmDialog.vue @@ -9,6 +9,7 @@ Date: Wed, 30 Aug 2023 17:20:44 -0500 Subject: [PATCH 4/6] abstract saveConfirm focus to function --- src/components/ControlPanel.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index 2d4afcb9..63b4b579 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -644,7 +644,7 @@ v-model="saveConfirmDialog" ref="saveConfirmDialog" :text="$t('message.confirm_session_saved')" - @confirm="saveConfirmDialog = false" + @confirm="handleSaveConfirmDialog" /> { this.saveSession(() => { - this.saveConfirmDialog = true; - - setTimeout(() => { - this.$refs.saveConfirmDialog.$refs.confirmBtn.focus(); - }); + this.handleSaveConfirmDialog(); }); }); @@ -1017,6 +1013,12 @@ export default { this.$refs.resetConfirmDialog.$refs.confirmBtn.$el.focus(); }, 100); }, + handleSaveConfirmDialog() { + this.saveConfirmDialog = true; + setTimeout(() => { + this.$refs.saveConfirmDialog.$refs.confirmBtn.$el.focus(); + }, 100); + }, fetchSources() { return new Promise(function (resolver, reject) { if (!window.ipc) return reject(); From ba5fcde4957a4b986024f7ce9ad7a9a5db470de5 Mon Sep 17 00:00:00 2001 From: dacoaster Date: Thu, 31 Aug 2023 17:43:20 -0700 Subject: [PATCH 5/6] Fixed capitalization and standardized focus on editor --- src/components/ControlPanel.vue | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index 63b4b579..6ccd143f 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -59,7 +59,7 @@ block :color="currentTheme.primary" :style="{ color: currentTheme.white }" - @click="handleDeleteConfirmDialog" + @click="handleDeleteConfirmDialog()" > mdi-delete {{ $tc("caption.delete", 1) }} @@ -92,7 +92,7 @@ - + mdi-download @@ -145,7 +145,7 @@ small color="default" v-on="on" - @click="resume" + @click="resume()" > mdi-play-circle @@ -166,7 +166,7 @@ small color="default" v-on="on" - @click="handleNewSessionDialog" + @click="handleNewSessionDialog()" > mdi-content-save @@ -186,7 +186,7 @@ small color="default" v-on="on" - @click="handleResetConfirmDialog" + @click="handleResetConfirmDialog()" > mdi-close-circle @@ -445,7 +445,7 @@ color="default" :disabled="status === 'pause'" v-on="on" - @click="showNoteDialog" + @click="showNoteDialog()" > { - this.$refs.SummaryDialog.$refs.comment.editor.commandManager.commands.focus(); + this.$refs.summaryDialog.$refs.comment.editor.commands.focus(); }, 200); } else { if (!window.ipc) return; From 5a5f49f62b04bcbb75e4af23ecc0d4ee18ab34a3 Mon Sep 17 00:00:00 2001 From: dacoaster Date: Thu, 31 Aug 2023 17:51:32 -0700 Subject: [PATCH 6/6] Some more consistency tweaks --- src/components/ControlPanel.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index 6ccd143f..35934f41 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -609,19 +609,19 @@ :sources="sources" :sourceId="sourceId" :loaded="loaded" - @submit-source="startSession" + @submit-source="startSession()" />