Changeset eb2fe08 in Klonkt


Ignore:
Timestamp:
06/25/2026 10:37:09 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
283f618
Parents:
6cabd18
Message:

ux(profile): fediverse-follow is a compact icon in the links row, hidden for the owner

The follow button was a full-width pill that added a whole row to the profile
header. Now it's a small icon alongside the social links (no extra height), and
it only shows to visitors — the owner can't follow their own site.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/profile-header.ejs

    r6cabd18 reb2fe08  
    6868      <% } %>
    6969
    70       <% if (_profileLinks.length) { %>
     70      <%# Follow-via-fediverse: a compact icon in the links row (keeps the header
     71          short), and hidden for the owner — you don't follow yourself. %>
     72      <% var _showFollow = (typeof canManageFedi === 'undefined' || !canManageFedi) && site && site.slug; %>
     73      <% if (_profileLinks.length || _showFollow) { %>
    7174        <% const _platforms = (typeof platforms_catalog !== 'undefined' && platforms_catalog) || {}; %>
    7275        <ul class="profile-links" aria-label="External links">
     
    8689            </li>
    8790          <% }); %>
     91          <% if (_showFollow) { %>
     92            <li>
     93              <button type="button" class="profile-link profile-fedi-link" data-fedi-actor-slug="<%= site.slug %>"
     94                      aria-label="<%= t('fedi.profile_follow') %>" title="<%= t('fedi.profile_follow') %>">🐘</button>
     95            </li>
     96          <% } %>
    8897        </ul>
    8998      <% } %>
    90 
    91       <button type="button" class="profile-fedi-btn" data-fedi-actor-slug="<%= site.slug %>">
    92         🐘 <%= t('fedi.profile_follow') %>
    93       </button>
    9499    </div>
    95100
     
    101106  window.__pcmsFediFollowWired = true;
    102107  document.addEventListener('click', function (e) {
    103     var b = e.target.closest && e.target.closest('.profile-fedi-btn');
     108    var b = e.target.closest && e.target.closest('.profile-fedi-link');
    104109    if (!b) return;
    105110    var raw = window.prompt(<%- JSON.stringify(t('fedi.remote_prompt')) %>, '');
     
    272277.on-archive .profile-links { display: none; }
    273278
    274 /* Follow-via-fediverse button */
    275 .profile-fedi-btn {
    276   margin-top: 0.65rem;
    277   display: inline-flex; align-items: center; gap: 0.4rem;
    278   padding: 0.4rem 0.85rem;
    279   border: 1px solid var(--rule);
    280   border-radius: 999px;
    281   background: var(--paper-2);
    282   color: var(--ink-soft);
    283   font: inherit; font-size: 0.85rem; font-weight: 600;
    284   cursor: pointer;
    285   transition: border-color 120ms, color 120ms, background 120ms;
    286 }
    287 .profile-fedi-btn:hover { border-color: var(--accent); color: var(--ink); }
    288 .on-post .profile-fedi-btn,
    289 .on-special .profile-fedi-btn,
    290 .on-search .profile-fedi-btn,
    291 .on-archive .profile-fedi-btn { display: none; }
     279/* Follow-via-fediverse: compact icon button, sits in the links row */
     280.profile-fedi-link { border: 0; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
    292281</style>
Note: See TracChangeset for help on using the changeset viewer.