Skip to content

Commit 1963a24

Browse files
committed
fix: remove compare icon from header, add c shortcut
For consistency with `settings` in the header. This does not change the mobile menu, which still has only the icon and no keyboard shortcut.
1 parent 0d06026 commit 1963a24

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

app/components/AppHeader.vue

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,21 @@ onKeyStroke(
7272
},
7373
{ dedupe: true },
7474
)
75+
76+
onKeyStroke(
77+
'c',
78+
e => {
79+
// Don't trigger if user is typing in an input
80+
const target = e.target as HTMLElement
81+
if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
82+
return
83+
}
84+
85+
e.preventDefault()
86+
navigateTo('/compare')
87+
},
88+
{ dedupe: true },
89+
)
7590
</script>
7691

7792
<template>
@@ -156,10 +171,16 @@ onKeyStroke(
156171
<!-- Desktop: Compare link -->
157172
<NuxtLink
158173
to="/compare"
159-
class="hidden sm:inline-flex link-subtle font-mono text-sm items-center gap-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 rounded"
174+
class="hidden sm:inline-flex link-subtle font-mono text-sm items-center gap-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 rounded"
175+
aria-keyshortcuts="c"
160176
>
161-
<span class="i-carbon:compare w-4 h-4" aria-hidden="true" />
162177
{{ $t('nav.compare') }}
178+
<kbd
179+
class="inline-flex items-center justify-center w-5 h-5 text-xs bg-bg-muted border border-border rounded"
180+
aria-hidden="true"
181+
>
182+
c
183+
</kbd>
163184
</NuxtLink>
164185

165186
<!-- Desktop: Settings link -->

0 commit comments

Comments
 (0)