Changeset ef1853c in Klonkt for src/views/partials


Ignore:
Timestamp:
07/26/2026 09:52:24 AM (6 weeks ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
42e7616
Parents:
3597763
Message:

Web: custom-emoji ook in messages + threads (Shaer-pariteit)

Na de nieuwsfeed nu ook de andere note-surfaces: messages (msg-item) en
thread-replies (fedi-node) renderen custom-emoji's in de content en in de
auteur-naam. De emoji-tags werden voor replies nog niet bewaard; nu vangt
ap_interactions ze (emoji_json = content-emoji uit o.tag/child.tag,
actor_emoji_json = naam-emoji uit actorInfo) op inbound reply, like/boost en de
thread-crawl, en getNotifications/getInteractions serveren ze mee.

De .emoji-CSS staat nu globaal in shared-styles (was news-only), zodat alle
surfaces 'm delen.

Changed files:
src/config/database.js

  • ap_interactions.emoji_json + actor_emoji_json kolommen

src/services/ActivityPubService.js

  • INSERT ap_interactions + 3 callers (reply/like-boost/thread) vullen de emoji-kolommen
  • emojiJsonOf() helper
  • _listI + getNotifications SELECT en getInteractions-node geven emoji mee

src/views/partials/msg-item.ejs

  • naam + content via emojiName/emojiHtml

src/views/partials/fedi-node.ejs

  • auteur-naam + content via emojiName/emojiHtml

src/views/partials/shared-styles.ejs

  • globale img.emoji-regels (inline, geen media-styling)

src/views/pages/news.ejs

  • dubbele img.emoji-regels weg (nu globaal)

remarks: 187 tests groen. Visueel geverifieerd via standalone render van msg-item
+ fedi-node. Nieuwe replies vangen emoji direct; oude rijen niet (geen self-heal).
Quote-in-replies en de Cirkel-tegel-titels bewust nog niet meegenomen.

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

Location:
src/views/partials
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/fedi-node.ejs

    r3597763 ref1853c  
    66<div class="comment-body">
    77  <div class="comment-meta">
    8     <% if (n.actor_url) { %><a class="comment-author" href="<%= n.actor_url %>" rel="nofollow noopener" target="_blank"><%= n.actor_name %></a>
    9     <% } else { %><span class="comment-author"><%= n.actor_name %></span><% } %>
     8    <% if (n.actor_url) { %><a class="comment-author" href="<%= n.actor_url %>" rel="nofollow noopener" target="_blank"><%- emojiName(n.actor_name, n.actor_emoji_json) %></a>
     9    <% } else { %><span class="comment-author"><%- emojiName(n.actor_name, n.actor_emoji_json) %></span><% } %>
    1010    <% if (n.actor_handle) { %><span class="fedi-handle"><%= n.actor_handle %></span><% } %>
    1111    <% if (n.created_at) { %><span class="comment-time"><%= formatDateTime(n.created_at) %></span><% } %>
    1212  </div>
    13   <div class="comment-content"><%- n.content %></div>
     13  <div class="comment-content"><%- emojiHtml(n.content, n.emoji_json) %></div>
    1414  <%# Rich replies: media on our own sent replies (attachments on the Note).
    1515      Visitors see these too, and the reply editor (owner-only) may not render,
  • src/views/partials/msg-item.ejs

    r3597763 ref1853c  
    4040                <% if (n.to_handle) { %><span class="msg-handle">→ <%= n.to_handle %></span><% } %>
    4141              <% } else { %>
    42                 <a class="msg-who" href="<%= n.url %>" target="_blank" rel="nofollow noopener"><%= _who %></a>
     42                <a class="msg-who" href="<%= n.url %>" target="_blank" rel="nofollow noopener"><%- emojiName(_who, n.actor_emoji_json) %></a>
    4343                <% if (n.handle && n.name) { %><span class="msg-handle"><%= n.handle %></span><% } %>
    4444              <% } %>
     
    6767
    6868            <% if (_t === 'report' && n.content) { %><div class="msg-content"><%= n.content %></div>
    69             <% } else if ((_t === 'reply' || _t === 'mention' || _t === 'sent') && n.content) { %><div class="msg-content"><%- n.content %></div>
     69            <% } else if ((_t === 'reply' || _t === 'mention' || _t === 'sent') && n.content) { %><div class="msg-content"><%- emojiHtml(n.content, n.emoji_json) %></div>
    7070              <% if (_t === 'mention' && n.wave && n.actorUri && canMutate) { %>
    7171                <form class="msg-quickreply" method="post" action="<%= (typeof siteUrlBase !== 'undefined' ? siteUrlBase : '') %>/messages/quick-reply" style="display:flex;gap:6px;flex-wrap:wrap;margin-top:6px">
  • src/views/partials/shared-styles.ejs

    r3597763 ref1853c  
    193193.load-more-btn:hover { background: color-mix(in srgb, var(--ink, #000) 9%, transparent); }
    194194.load-more-btn.htmx-request { opacity: .6; pointer-events: none; }
     195
     196/* FEP-9098 custom emojis: small inline images (Shaer parity), rendered in note
     197   content and display names across the timeline, messages and threads. Never
     198   styled as media (no rounding/background), and never blown up to media width. */
     199img.emoji { height: 1.3em; width: auto; margin: 0 .05em; vertical-align: -0.2em;
     200  display: inline-block; border-radius: 0; background: none; box-shadow: none; }
     201.tl-content img.emoji, .tl-quote-body img.emoji, .msg-content img.emoji, .comment-content img.emoji,
     202.tl-author img.emoji, .tl-boost-by img.emoji, .tl-quote-name img.emoji, .msg-who img.emoji, .comment-author img.emoji {
     203  max-width: none; height: 1.3em; border-radius: 0; background: none; box-shadow: none; vertical-align: -0.2em; }
    195204</style>
Note: See TracChangeset for help on using the changeset viewer.