feat: add keyboard shortcut tooltips

This commit is contained in:
Zoe
2026-03-02 13:41:57 -06:00
parent 579f4730c8
commit e2a4643419
16 changed files with 217 additions and 53 deletions
+11 -6
View File
@@ -12,6 +12,7 @@ const { addShortcut } = useKeyboardShortcuts();
const props = defineProps<{
providers: ProviderWithModels[];
addHotkey?: boolean;
}>();
const selectedModel = defineModel<ModelWithProvider | null>();
@@ -182,11 +183,15 @@ const handleSearchKeyDown = (event: KeyboardEvent) => {
}
};
const unbindShortcut = addShortcut(['ctrl', 'shift', 'm'], (event) => {
event.preventDefault();
event.stopPropagation();
toggleDropdown();
});
let unbindShortcut: () => void = () => { };
if (props.addHotkey) {
unbindShortcut = addShortcut(['ctrl', 'shift', 'm'], (event) => {
event.preventDefault();
event.stopPropagation();
toggleDropdown();
});
}
onUnmounted(() => {
unbindShortcut();
@@ -240,7 +245,7 @@ onUnmounted(() => {
<div v-for="provider in filteredProviders" :key="provider.id" class="mb-2">
<div v-if="provider.models.filter(m => m.enabled).length > 0"
class="px-4 py-1.5 text-[13px] font-medium text-[var(--text-secondary)] capitalize tracking-wider flex justify-between">
class="px-4 py-1.5 text-[13px] font-medium text-[var(--text-secondary)] case-capital tracking-wider flex justify-between">
{{ provider.name }}
<button
@click="closeDropdown(); openDialog(DialogType.Settings, undefined, { page: 'providers', params: provider.id })"