Skip to content

Forum previews and search results show mentions as names (GRYT-2025) - #365

Merged
grytchat merged 1 commit into
mainfrom
claude/GRYT-2025-plain-previews
Nov 6, 2026
Merged

grytchat merged 1 commit into
mainfrom
claude/GRYT-2025-plain-previews

Conversation

@grytchat

@grytchat grytchat commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

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 as root.text.slice(0, 200): raw markup, sometimes cut through the middle of a link. Search snippets (substr(text, 1, 160) and the FTS snippet()) came out the same way.

Fix: mentionsAsText in services/mentionSyntax.ts turns links into words before anything is cut:

  • user → @nickname (current nickname, because a label can be empty like Leo's, or out of date), falling back to the label, then @someone
  • @everyone and @here as they are, a role → @Role, a channel → #channel (the fixed label, as stored)
  • links inside code are left alone
  • where a snippet cut through a link, the end of it is trimmed down to the label

It's used for forum:topics previews and chat:search:results snippets, with one nickname lookup per member per request.

Tests: unit tests for the helper, and one through forum:topics with an empty-label mention. All 2167 server tests pass.

🤖 Generated with Claude Code

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>
@grytchat
grytchat merged commit 04aeddf into main Nov 6, 2026
7 checks passed
@grytchat
grytchat deleted the claude/GRYT-2025-plain-previews branch November 6, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant