Changeset 3289a64 in Klonkt for src/views/partials


Ignore:
Timestamp:
06/26/2026 11:30:21 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
3d37c67
Parents:
c745659
Message:

feat(fedi): comment like is a toggle too (Undo Like / un-favourite)

Symmetric to boost: ap_interactions.acted_like remembers a liked comment, the star
shows an 'on' state, and clicking again retracts it via Undo(Like) (Mastodon honours it).
sendInteraction gains an 'unlike' branch (author-only, no fanout).

File:
1 edited

Legend:

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

    rc745659 r3289a64  
    2222        <input type="hidden" name="interaction_id" value="<%= n.id %>">
    2323        <input type="hidden" name="kind" value="like">
    24         <button type="submit" class="fedi-cact fedi-cact-like" title="<%= t('fedi.like_short') %>" aria-label="<%= t('fedi.like_short') %>"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.6l2.9 5.88 6.49.95-4.7 4.58 1.11 6.46L12 17.96l-5.8 3.06 1.1-6.46-4.69-4.58 6.49-.95z"/></svg></button>
     24        <button type="submit" class="fedi-cact fedi-cact-like<%= n.acted_like ? ' is-on' : '' %>" title="<%= n.acted_like ? t('fedi.unlike_short') : t('fedi.like_short') %>" aria-label="<%= n.acted_like ? t('fedi.unlike_short') : t('fedi.like_short') %>"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.6l2.9 5.88 6.49.95-4.7 4.58 1.11 6.46L12 17.96l-5.8 3.06 1.1-6.46-4.69-4.58 6.49-.95z"/></svg></button>
    2525      </form>
    2626      <form method="post" action="<%= _base %>/posts/<%= postSlug %>/fedi-react" class="fedi-owner-react">
Note: See TracChangeset for help on using the changeset viewer.