Changeset c7c7f02 in Klonkt


Ignore:
Timestamp:
06/26/2026 01:01:54 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
b6cdc3d
Parents:
bbce8da
Message:

feat(cirkel): render boosted posts in the pinned style with a Boost badge

A post you boosted (ap_timeline.boosted) now stands out in the Cirkel: same visual
treatment as a pinned post on the solo page (accent outline in grid, badge), but the
badge reads 'Boost' (🔁/loop icon) instead of 'Pinned'. Featured-account posts stay
normal. getCirkelPosts returns t.boosted; circle.js sets isBoost; post-card/post-tile
swap the badge + reuse is-pinned styling. No effect on the home page (isBoost only set
in the Cirkel).

Co-Authored-By: Claude <noreply@…>

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/routes/circle.js

    rbbce8da rc7c7f02  
    4646      tags: '',
    4747      pinned: 0,
     48      isBoost: !!r.boosted, // a post YOU boosted → render in the pinned style with a Boost badge
    4849      status: 'published',
    4950      source_name: name,
  • src/services/ActivityPubService.js

    rbbce8da rc7c7f02  
    10631063    if (!_cirkelPosts) _cirkelPosts = db.prepare(`
    10641064      SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url,
    1065              t.content, t.url, t.published, t.media_json
     1065             t.content, t.url, t.published, t.media_json, t.boosted
    10661066      FROM ap_timeline t
    10671067      LEFT JOIN ap_following f ON f.slug = t.slug AND f.actor_uri = t.author_uri
  • src/views/partials/post-card.ejs

    rbbce8da rc7c7f02  
    1919const _typeLabel = (post.type && post.type !== 'overig' && post.type !== 'post') ? post.type : '';
    2020const _isPinned  = !!post.pinned;
     21const _isBoost   = !!post.isBoost;
    2122const _isDraft   = post.status && post.status !== 'published';
    2223
     
    4243}
    4344%>
    44 <li class="post-list-item<%= _hasCover ? ' has-cover' : '' %><%= _isPinned ? ' is-pinned' : '' %>">
     45<li class="post-list-item<%= _hasCover ? ' has-cover' : '' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %>">
    4546
    4647  <% if (_hasCover) { %>
     
    5455  <div class="post-list-body">
    5556    <div class="post-list-meta mono">
    56       <% if (_isPinned) { %><span class="post-list-pin" aria-label="Vastgepind">★</span><% } %>
     57      <% if (_isBoost) { %><span class="post-list-pin post-list-boost" aria-label="Boost">🔁</span><% } else if (_isPinned) { %><span class="post-list-pin" aria-label="Vastgepind">★</span><% } %>
    5758      <time datetime="<%= post.published_at || post.created_at %>"><%= _ddmmyyyy(post.published_at || post.created_at) %></time>
    5859      <% if (_src) { %><span class="post-list-type">&middot; via <%= _src %></span><% } %>
  • src/views/partials/post-tile.ejs

    rbbce8da rc7c7f02  
    55const _tileHue = ((post.id || post.slug || '0').charCodeAt(0) * 7) % 360;
    66const _isPinned = !!post.pinned;
     7const _isBoost = !!post.isBoost;
    78const _hasCover = !!post.cover_image_url;
    89const _typeLabel = (post.type && post.type !== 'post') ? post.type : '';
     
    1314const _ext = !!_external;
    1415%>
    15 <a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= _isPinned ? ' is-pinned' : '' %>"
     16<a class="grid-tile<%= _hasCover ? '' : ' grid-tile-gradient' %><%= (_isPinned || _isBoost) ? ' is-pinned' : '' %>"
    1617   href="<%= _href %>"
    1718   <% if (_hasCover) { %>style="background-image: url('<%= post.cover_image_url %>'); --tile-hue: <%= _tileHue %>;"<% } else { %>style="--tile-hue: <%= _tileHue %>;"<% } %>
     
    2122    <span class="grid-tile-type"><%= _typeLabel %></span>
    2223  <% } %>
    23   <% if (_isPinned) { %>
     24  <% if (_isBoost) { %>
     25    <span class="grid-tile-pin grid-tile-boost"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m17 2 4 4-4 4"/><path d="M3 11v-1a4 4 0 0 1 4-4h14"/><path d="m7 22-4-4 4-4"/><path d="M21 13v1a4 4 0 0 1-4 4H3"/></svg>Boost</span>
     26  <% } else if (_isPinned) { %>
    2427    <span class="grid-tile-pin"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 17v5"/><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z"/></svg>Pinned</span>
    2528  <% } %>
Note: See TracChangeset for help on using the changeset viewer.