Hi,
On 7.24.0, and still on master, the mention autocomplete in the comments panel behaves differently depending on which of the three boxes you use.
- In the create box it works: the suggestion list shows contributors and picking one inserts their e-mail address.
- In the reply and edit boxes every suggestion renders as
[Object Object], and picking one inserts@[Object Object]into the text.
Typing the full e-mail address by hand works, which is how I found it. Picking from the list never notifies the mentioned user, because the server only resolves mentions that look like e-mail
addresses.
Root cause, all in frontend/: the three boxes use the same sqx-autocomplete component, but only the create box configures it.
src/app/shared/components/comments/comments.component.html— create box:displayProperty,valuePropertyand an item template.src/app/shared/components/comments/comment.component.html— reply and edit boxes: none of the three.src/app/framework/angular/forms/editors/autocomplete.component.ts—displayPropertyandvaluePropertydefault to'', and the label falls back toselection.toString(), which is
[Object Object]for aContributorDto. The list itself falls back to rendering the item when no template is given.backend/src/Squidex.Domain.Apps.Entities/Collaboration/CommentCollaborationHandler.cs—MentionRegexmatches addresses only, so@[Object Object]resolves to nothing,Mentionsstays
empty, and no notification is sent.
All three boxes were introduced in the same commit, 2b8c93d (“Comment fixes”), and only the create box got the configuration.
The fix is to configure the reply and edit boxes the same way, and to pass valueProperty in the create box too so a picked suggestion writes the address into the form control instead of the
contributor object. It is a small template change plus one pipe import; I have it applied against master and the production build passes locally.
Question: would you prefer an issue with this write-up, or shall I open a pull request with the patch? I would rather ask than open a PR you do not want.
Correction (edited): an earlier version of this post said that editing an existing comment never notifies anyone. That is wrong, and I have removed it. The comment array’s set is implemented
as a delete plus an insert, so the handler sees an edit as an insertion, builds a new comment event and resolves mentions again. Editing does notify, and the fix therefore covers the edit box as
well.