enh: workspace search clear button

Co-Authored-By: silentoplayz <50341825+silentoplayz@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-05-19 02:36:15 +04:00
co-authored by silentoplayz
parent 3af289d196
commit aee9d05916
4 changed files with 61 additions and 7 deletions
+13
View File
@@ -31,6 +31,7 @@
import ChevronRight from '../icons/ChevronRight.svelte';
import Spinner from '../common/Spinner.svelte';
import { capitalizeFirstLetter } from '$lib/utils';
import XMark from '../icons/XMark.svelte';
const i18n = getContext('i18n');
@@ -194,6 +195,18 @@
bind:value={query}
placeholder={$i18n.t('Search Tools')}
/>
{#if query}
<div class="self-center pl-1.5 translate-y-[0.5px] rounded-l-xl bg-transparent">
<button
class="p-0.5 rounded-full hover:bg-gray-100 dark:hover:bg-gray-900 transition"
on:click={() => {
query = '';
}}
>
<XMark className="size-3" strokeWidth="2" />
</button>
</div>
{/if}
</div>
<div>