Skip to content

Commit 40b4ab8

Browse files
committed
UX: Add Ctrl-F and Ctrl-R keyboard shortcuts for search and reload #1131
Signed-off-by: Michael Mayer <michael@photoprism.app>
1 parent 2351133 commit 40b4ab8

File tree

22 files changed

+145
-19
lines changed

22 files changed

+145
-19
lines changed

frontend/src/common/view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@ export class View {
337337

338338
// Returns true if the specified view component is currently inactive, e.g. hidden in the background.
339339
isHidden(c) {
340-
return !this.isVisible(c);
340+
return !this.hasFocus(c);
341341
}
342342

343343
// Returns true if the specified view component is currently active, e.g. visible in the foreground.
344-
isVisible(c) {
344+
hasFocus(c) {
345345
if (!c || this.isApp()) {
346346
return true;
347347
}

frontend/src/component/label/edit/dialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
validate-on="invalid-input"
1313
class="form-label-edit"
1414
accept-charset="UTF-8"
15+
tabindex="1"
1516
@submit.prevent="confirm"
1617
>
1718
<v-card>

frontend/src/component/people/edit/dialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
validate-on="invalid-input"
1313
class="form-person-edit"
1414
accept-charset="UTF-8"
15+
tabindex="1"
1516
@submit.prevent="confirm"
1617
>
1718
<v-card>

frontend/src/component/photo/album/dialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class="p-dialog p-photo-album-dialog"
77
@keydown.esc="close"
88
>
9-
<v-form ref="form" validate-on="invalid-input" accept-charset="UTF-8" @submit.prevent="confirm">
9+
<v-form ref="form" validate-on="invalid-input" accept-charset="UTF-8" tabindex="1" @submit.prevent="confirm">
1010
<v-card>
1111
<v-card-title class="d-flex justify-start align-center ga-3">
1212
<v-icon icon="mdi-bookmark" size="28" color="primary"></v-icon>

frontend/src/component/photo/edit/details.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
validate-on="invalid-input"
66
class="p-form p-form-photo-details-meta"
77
accept-charset="UTF-8"
8+
tabindex="1"
89
@submit.prevent="save"
910
>
1011
<div class="form-body">

frontend/src/component/photo/edit/files.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<v-expansion-panel
55
v-for="file in view.model.fileModels().filter((f) => !f.Missing)"
66
:key="file.UID"
7-
class="pa-0 elevation-0"
7+
tabindex="1"
88
style="margin-top: 1px"
9+
class="pa-0 elevation-0"
910
>
1011
<v-expansion-panel-title>
1112
<div class="text-caption font-weight-bold filename">

frontend/src/component/photo/edit/info.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="p-tab p-tab-photo-advanced">
3-
<v-form ref="form" validate-on="invalid-input" accept-charset="UTF-8" @submit.prevent>
3+
<v-form ref="form" validate-on="invalid-input" accept-charset="UTF-8" tabindex="1" @submit.prevent>
44
<div class="v-table__overflow">
55
<v-table tile hover density="compact" class="bg-table">
66
<tbody>

frontend/src/component/photo/edit/labels.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
class="p-form p-form--table p-form-photo-labels"
66
validate-on="invalid-input"
77
accept-charset="UTF-8"
8+
tabindex="1"
89
@submit.prevent
910
>
1011
<div class="form-body">
@@ -141,6 +142,7 @@
141142
:rules="[nameRule]"
142143
color="surface-variant"
143144
autocomplete="off"
145+
autofocus
144146
single-line
145147
flat
146148
variant="plain"

frontend/src/component/photo/edit/people.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</v-alert>
1919
<div v-else class="v-row search-results face-results cards-view d-flex">
2020
<div v-for="m in markers" :key="m.UID" class="v-col-12 v-col-sm-6 v-col-md-4 v-col-lg-3 d-flex">
21-
<v-card :data-id="m.UID" :class="m.classes()" class="result not-selectable flex-grow-1">
21+
<v-card :data-id="m.UID" :class="m.classes()" class="result not-selectable flex-grow-1" tabindex="1">
2222
<v-img :src="m.thumbnailUrl('tile_320')" aspect-ratio="1" class="card">
2323
<v-btn
2424
v-if="!m.SubjUID && !m.Invalid"

frontend/src/component/photo/upload/dialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class="p-photo-upload-dialog v-dialog--upload"
99
@keydown.esc="close"
1010
>
11-
<v-form ref="form" class="p-photo-upload" validate-on="invalid-input" @submit.prevent="submit">
11+
<v-form ref="form" class="p-photo-upload" validate-on="invalid-input" tabindex="1" @submit.prevent="submit">
1212
<input ref="upload" type="file" multiple class="d-none input-upload" @change.stop="onUpload()" />
1313
<v-card :tile="$vuetify.display.mdAndDown">
1414
<v-toolbar

0 commit comments

Comments
 (0)