From 7a867906704ab00db52f4866c9de44c8700ac15d Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 1 Dec 2025 03:17:17 -0800 Subject: [PATCH] weapons: add recruits character search field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add CharacterTypeahead component for async character search using Svelecte. The component debounces input and queries the search API for matching characters. Added recruits field to weapon creation page. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/ui/CharacterTypeahead.svelte | 191 ++++++++++++++++++ .../(app)/database/weapons/new/+page.svelte | 7 + 2 files changed, 198 insertions(+) create mode 100644 src/lib/components/ui/CharacterTypeahead.svelte diff --git a/src/lib/components/ui/CharacterTypeahead.svelte b/src/lib/components/ui/CharacterTypeahead.svelte new file mode 100644 index 00000000..a8aa39ba --- /dev/null +++ b/src/lib/components/ui/CharacterTypeahead.svelte @@ -0,0 +1,191 @@ + + + + + +
+ + {#if isLoading} + ... + {/if} +
+ + diff --git a/src/routes/(app)/database/weapons/new/+page.svelte b/src/routes/(app)/database/weapons/new/+page.svelte index 1b945126..af297be1 100644 --- a/src/routes/(app)/database/weapons/new/+page.svelte +++ b/src/routes/(app)/database/weapons/new/+page.svelte @@ -14,6 +14,7 @@ import Button from '$lib/components/ui/Button.svelte' import ValidatedInput from '$lib/components/ui/ValidatedInput.svelte' import TagInput from '$lib/components/ui/TagInput.svelte' + import CharacterTypeahead from '$lib/components/ui/CharacterTypeahead.svelte' import { entityAdapter } from '$lib/api/adapters/entity.adapter' import { getRarityOptions } from '$lib/utils/rarity' @@ -285,6 +286,12 @@ + + + + + +