Repository navigation
Forum previews and search results show mentions as names (GRYT-2025) - #365
Merged
Merged
Conversation
Leo found it in the community server. A topic with no title falls back to a preview of its first message, and the server built that as root.text.slice(0, 200): the raw [label](mention:user_…) markup, sometimes cut through the middle of a link. Desktop and phone both showed it as is. Search snippets came out the same way. mentionsAsText turns mention, role and channel links into words before anything is cut. Users go by their current nickname, because a link's label can be empty (as in Leo's case) or stale. Links inside code are left alone, and the end of a link a snippet cut through is trimmed down to its label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Leo reported it in the community server: a thread showed
[](mention:user_6723d073-…where its title should be.Cause: a forum topic with no title falls back to a preview of its first message, on desktop (
ForumView) and phone (ForumChannel). The server built that preview asroot.text.slice(0, 200): raw markup, sometimes cut through the middle of a link. Search snippets (substr(text, 1, 160)and the FTSsnippet()) came out the same way.Fix:
mentionsAsTextinservices/mentionSyntax.tsturns links into words before anything is cut:@nickname(current nickname, because a label can be empty like Leo's, or out of date), falling back to the label, then@someone@Role, a channel →#channel(the fixed label, as stored)It's used for
forum:topicspreviews andchat:search:resultssnippets, with one nickname lookup per member per request.Tests: unit tests for the helper, and one through
forum:topicswith an empty-label mention. All 2167 server tests pass.🤖 Generated with Claude Code