From 2181d2e04b74585a23d8d65b46a9a33b030ddd9e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Jan 2026 23:32:05 +0000 Subject: [PATCH] Filter out empty tags when creating or editing accounts Empty tags (or whitespace-only tags) are now filtered out before saving. Tags are also trimmed of leading/trailing whitespace. Fixes #9 --- entrypoints/sidepanel/components/TagsInput.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entrypoints/sidepanel/components/TagsInput.tsx b/entrypoints/sidepanel/components/TagsInput.tsx index be5993e..63ef2a5 100644 --- a/entrypoints/sidepanel/components/TagsInput.tsx +++ b/entrypoints/sidepanel/components/TagsInput.tsx @@ -11,8 +11,12 @@ export default function TagsInput({ allKnownTags, initialTags }: TagsInputProps) const [hiddenValue, setHiddenValue] = useState(JSON.stringify(initialTags)); const handleChange = useCallback((newTags: string[]) => { - setTags(newTags); - setHiddenValue(JSON.stringify(newTags)); + // Filter out empty tags and trim whitespace + const filteredTags = newTags + .map(tag => tag.trim()) + .filter(tag => tag.length > 0); + setTags(filteredTags); + setHiddenValue(JSON.stringify(filteredTags)); }, []); return (