Skip to content

Commit d375c50

Browse files
authored
feat: modify shortcut and add tooltips (#1598)
1 parent 47aaaf8 commit d375c50

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

packages/app-frontend/src/features/components/ComponentsInspector.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default defineComponent({
4242
} = useComponentPick()
4343
4444
onKeyDown(event => {
45-
if (event.key === 'f' && event.ctrlKey) {
45+
if (event.key === 'f' && event.altKey) {
4646
treeFilterInput.value.focus()
4747
return false
4848
}
@@ -90,6 +90,10 @@ export default defineComponent({
9090
<template #left>
9191
<div class="flex flex-col h-full">
9292
<VueInput
93+
v-tooltip="{
94+
content: $t('ComponentTree.filter.tooltip'),
95+
html: true
96+
}"
9397
ref="treeFilterInput"
9498
v-model="treeFilter"
9599
icon-left="search"

packages/app-frontend/src/features/components/SelectedComponentPane.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import EmptyPane from '@front/features/layout/EmptyPane.vue'
44
import RenderCode from './RenderCode.vue'
55
66
import { defineComponent, ref, watch, computed } from '@vue/composition-api'
7+
import { onKeyDown } from '@front/util/keyboard'
78
import { useSelectedComponent } from './composable'
89
910
// @ts-ignore
@@ -26,12 +27,22 @@ export default defineComponent({
2627
}
2728
})
2829
30+
const stateFilterInput = ref()
31+
32+
onKeyDown(event => {
33+
if (event.key === 'd' && event.altKey) {
34+
stateFilterInput.value.focus()
35+
return false
36+
}
37+
})
38+
2939
const sameApp = computed(() => selectedComponent.data.value?.id.split(':')[0] === selectedComponentId.value?.split(':')[0])
3040
3141
return {
3242
...selectedComponent,
3343
showRenderCode,
3444
inspector,
45+
stateFilterInput,
3546
sameApp,
3647
}
3748
},
@@ -53,6 +64,11 @@ export default defineComponent({
5364
</div>
5465

5566
<VueInput
67+
v-tooltip="{
68+
content: $t('StateInspector.filter.tooltip'),
69+
html: true
70+
}"
71+
ref="stateFilterInput"
5672
v-model="stateFilter"
5773
icon-left="search"
5874
placeholder="Filter state..."

packages/app-frontend/src/locales/en.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export default {
2626
dataType: {
2727
tooltip: '[[{{keys.ctrl}}]] + <<mouse>>: Collapse All<br>[[{{keys.shift}}]] + <<mouse>>: Expand All',
2828
},
29+
filter: {
30+
tooltip: '[[{{keys.alt}}]] + [[D]] Filter state by name',
31+
},
2932
},
3033
DataField: {
3134
edit: {
@@ -54,7 +57,7 @@ export default {
5457
tooltip: '[[S]] Select component in the page',
5558
},
5659
filter: {
57-
tooltip: '[[{{keys.ctrl}}]] + [[F]] Filter components by name',
60+
tooltip: '[[{{keys.alt}}]] + [[F]] Filter components by name',
5861
},
5962
},
6063
ComponentInstance: {

0 commit comments

Comments
 (0)