Skip to content

Commit 2170f85

Browse files
committed
fix: respect WIP design guidelines in command palette
1 parent 0d59ba1 commit 2170f85

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

app/components/CommandPalette.client.vue

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ useEventListener(document, 'keydown', handleGlobalKeydown)
213213
{{ statusMessage }}
214214
</p>
215215

216-
<div class="border-b border-border px-4 py-4 sm:px-6">
216+
<div class="border-b border-border/70 bg-bg-subtle/60 px-4 py-4 sm:px-5">
217217
<button
218218
v-if="isLanguageView"
219219
type="button"
220-
class="mb-3 inline-flex items-center gap-2 rounded-md px-2 py-1 font-mono text-xs text-fg-muted transition-colors duration-150 hover:text-fg focus-visible:outline-accent/70"
220+
class="mb-3 inline-flex min-h-9 items-center gap-2 rounded-lg border border-transparent px-2.5 py-1.5 text-sm text-fg-muted lowercase transition-colors duration-150 hover:border-border/70 hover:bg-bg hover:text-fg focus-visible:outline-accent/70"
221221
@click="handleBack"
222222
>
223223
<span class="i-lucide:arrow-left rtl-flip inline-block h-3.5 w-3.5" aria-hidden="true" />
@@ -240,26 +240,32 @@ useEventListener(document, 'keydown', handleGlobalKeydown)
240240

241241
<div
242242
:id="resultsId"
243-
class="max-h-[60vh] overflow-y-auto px-2 py-3 sm:px-3"
243+
class="max-h-[60vh] overflow-y-auto bg-bg-muted/30 px-2 py-2 sm:px-3 sm:py-3"
244244
:aria-label="$t('command_palette.results_label')"
245245
role="region"
246246
>
247-
<p v-if="!hasResults" class="px-3 py-6 text-center text-sm text-fg-muted">
248-
{{ $t('command_palette.empty') }}
249-
</p>
250-
<p v-if="!hasResults && trimmedQuery" class="px-3 pb-6 text-center text-sm text-fg-subtle">
251-
{{ $t('command_palette.empty_search_hint', { query: trimmedQuery }) }}
252-
</p>
247+
<div
248+
v-if="!hasResults"
249+
class="mx-1 rounded-xl border border-border/70 bg-bg-subtle/70 px-4 py-8 text-center sm:mx-0"
250+
>
251+
<p class="text-base text-fg-muted lowercase">
252+
{{ $t('command_palette.empty') }}
253+
</p>
254+
<p v-if="trimmedQuery" class="mt-2 text-sm text-fg-subtle">
255+
{{ $t('command_palette.empty_search_hint', { query: trimmedQuery }) }}
256+
</p>
257+
</div>
253258

254259
<div v-else class="flex flex-col gap-3">
255260
<section
256261
v-for="group in groupedCommands"
257262
:key="group.id"
258263
:aria-labelledby="`${dialogId}-group-${group.id}`"
264+
class="rounded-xl border border-border/70 bg-bg-subtle/70 p-1 sm:p-1.5"
259265
>
260266
<h3
261267
:id="`${dialogId}-group-${group.id}`"
262-
class="px-3 pb-1 text-xs font-mono uppercase tracking-wide text-fg-subtle"
268+
class="px-3 pb-2 pt-2 text-sm uppercase tracking-[0.14em] text-fg-subtle"
263269
>
264270
{{ group.label }}
265271
</h3>
@@ -268,10 +274,10 @@ useEventListener(document, 'keydown', handleGlobalKeydown)
268274
<li v-for="command in group.items" :key="command.id">
269275
<button
270276
type="button"
271-
class="w-full cursor-pointer rounded-lg border border-transparent px-3 py-3 text-start transition-colors duration-150 hover:border-border hover:bg-bg-subtle focus-visible:outline-accent/70"
277+
class="min-h-12 w-full cursor-pointer rounded-lg border border-transparent px-3 py-2.5 text-start transition-colors duration-150 hover:border-border/80 hover:bg-bg focus-visible:outline-accent/70"
272278
:class="
273279
activeIndex === (commandIndexMap.get(command.id) ?? -1)
274-
? 'border-border bg-bg-subtle'
280+
? 'border-border/80 bg-bg'
275281
: ''
276282
"
277283
data-command-item="true"
@@ -287,19 +293,19 @@ useEventListener(document, 'keydown', handleGlobalKeydown)
287293
aria-hidden="true"
288294
/>
289295
<span class="min-w-0 flex-1">
290-
<span class="block truncate text-sm font-medium text-fg">
296+
<span class="block truncate text-base text-fg lowercase">
291297
{{ command.label }}
292298
</span>
293299
</span>
294300
<span
295301
v-if="command.badge"
296-
class="rounded border border-border bg-bg px-2 py-0.5 text-xs font-mono text-fg-muted"
302+
class="hidden rounded-lg border border-border/70 bg-bg px-2.5 py-1 text-sm text-fg-muted lowercase sm:inline-flex"
297303
>
298304
{{ command.badge }}
299305
</span>
300306
<span
301307
v-if="command.active"
302-
class="rounded border border-accent/30 bg-accent/10 px-2 py-0.5 text-xs font-mono text-accent"
308+
class="hidden rounded-lg border border-accent/30 bg-accent/10 px-2.5 py-1 text-sm text-accent lowercase sm:inline-flex"
303309
>
304310
{{ command.activeLabel || $t('command_palette.current') }}
305311
</span>

0 commit comments

Comments
 (0)