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.
This commit is contained in:
Louis Knight-Webb
2025-12-11 11:24:37 +00:00
committed by GitHub
parent b8abd9a05e
commit b818f32b1e

View File

@@ -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}