Skip to content

Sanitize global search message metadata and resolve sender IDs to display names - #18

Draft
joan-code6 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-html-display-issues
Draft

joan-code6 with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-html-display-issues

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown

Global search message results were rendering raw recipient HTML (<span>, <i>, entity text like &amp;) and showing numeric sender IDs instead of readable names. This change normalizes message metadata before rendering so previews show plain, human-readable text.

  • Message text normalization in search results

    • Added HTML tag stripping + entity decoding for message subject/sender/recipient fields used by GlobalSearch.
    • Collapses whitespace after cleanup so subtitles remain compact and readable.
  • Sender identity resolution

    • Added username-cache mapping lookup when building message search items.
    • Uses cached display name when available; falls back to the original sender value if no mapping exists.
  • Recipient subtitle cleanup

    • Normalizes each recipient entry from empf before joining into An: ..., preventing raw markup from leaking into the preview line.
const senderRaw = String(m.Sender || '');
const sender = cleanHtmlText(usernameMap[senderRaw] || senderRaw);

const empf = Array.isArray(m.empf)
  ? m.empf.map((entry) => cleanHtmlText(String(entry || ''))).filter(Boolean).join(', ')
  : '';

@appwrite

appwrite Bot commented Jul 15, 2026

Copy link
Copy Markdown

Lanis

Project ID: 698337a60017b46df380

Sites (1)
Site Status Logs Preview QR
 lanis_ui
6a180889003c768d3660
Ready Ready View Logs Preview URL QR Code

Tip

Global CDN and DDoS protection come free with every Sites deployment

Copilot AI requested a review from joan-code6 July 15, 2026 11:23
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.

2 participants