From b818f32b1ee9418667683e3d5e00e287a3982542 Mon Sep 17 00:00:00 2001 From: Louis Knight-Webb Date: Thu, 11 Dec 2025 11:24:37 +0000 Subject: [PATCH] fix: preserve preceding space when inserting tag/file from typeahead (Vibe Kanban) (#1495) * All type checks pass. The fix is complete. **Summary:** Fixed the issue in `frontend/src/components/ui/wysiwyg/plugins/file-tag-typeahead-plugin.tsx:117-122`. When selecting a tag or file from the typeahead menu, the code now checks if the replaced text started with whitespace and preserves it by prepending a space to the inserted content. * Done. The more elegant fix is now in place - a single line change in the `triggerFn`: ```typescript replaceableString: match[0].slice(match[0].indexOf('@')), ``` This excludes the preceding space from `replaceableString` at the source, so the `onSelectOption` handler remains simple with no conditional logic. --- .../components/ui/wysiwyg/plugins/file-tag-typeahead-plugin.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/ui/wysiwyg/plugins/file-tag-typeahead-plugin.tsx b/frontend/src/components/ui/wysiwyg/plugins/file-tag-typeahead-plugin.tsx index b729996c..f9c3b723 100644 --- a/frontend/src/components/ui/wysiwyg/plugins/file-tag-typeahead-plugin.tsx +++ b/frontend/src/components/ui/wysiwyg/plugins/file-tag-typeahead-plugin.tsx @@ -100,7 +100,7 @@ export function FileTagTypeaheadPlugin({ projectId }: { projectId?: string }) { return { leadOffset: offset, matchingString: match[1], - replaceableString: match[0], + replaceableString: match[0].slice(match[0].indexOf('@')), }; }} options={options}