Changeset 03bfdce in Klonkt


Ignore:
Timestamp:
06/16/2026 11:35:13 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
108fd5f
Parents:
09ac0a5
Message:

Hub: always render chrome + CSS toggle (body.on-hub) → hub nav via htmx (no audio jumping)

In hub mode, topnav/view-switcher are now always in the DOM; CSS hides them
on the hub landing (body.on-hub, also toggled in the htmx body-class swap).
Roster, main card, feed, and brand links are now htmx → navigating between
hub-home and an artist happens in-place, so the persistent audio player
stays alive (no jumping). Solo/circle completely unchanged
(renderChrome = !bareChrome there).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@…>

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/assets/css/style.css

    r09ac0a5 r03bfdce  
    20282028    margin-bottom: 1.5rem;
    20292029}
     2030/* Hub-landing (body.on-hub): verberg de site-chrome. In hub-modus staan masthead
     2031   + view-switcher altijd in de DOM (zodat htmx tussen hub-home en artiest-sites
     2032   kan schakelen zonder full-reload); hier toggelen we hun zichtbaarheid. De
     2033   hub-home heeft z'n eigen kop/nav in de content. */
     2034body.on-hub .masthead,
     2035body.on-hub .view-switcher-wrap { display: none !important; }
    20302036.view-switcher {
    20312037    display: flex;
  • src/views/pages/hub-home.ejs

    r09ac0a5 r03bfdce  
    3434    <% if (mainSite) { %>
    3535    <section class="hub-sec hub-sec-main">
    36       <a class="hub-main-card" href="/user/<%= mainSite.slug %>">
     36      <a class="hub-main-card" href="/user/<%= mainSite.slug %>"
     37         hx-get="/user/<%= mainSite.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
     38         hx-push-url="/user/<%= mainSite.slug %>" hx-indicator="#pcms-loading">
    3739        <% var _mAva = mainSite.profile_photo || mainSite.owner_avatar; %>
    3840        <span class="hub-main-avatar"<% if (_mAva) { %> style="background-image:url('<%= _mAva %>')"<% } else { %> style="background:<%= mainSite.accent || 'var(--accent)' %>;color:#fff"<% } %>>
     
    6062      <div class="roster">
    6163        <% artists.forEach(function(a){ %>
    62           <a class="roster-card" href="/user/<%= a.slug %>">
     64          <a class="roster-card" href="/user/<%= a.slug %>"
     65             hx-get="/user/<%= a.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
     66             hx-push-url="/user/<%= a.slug %>" hx-indicator="#pcms-loading">
    6367            <% var _ava = a.profile_photo || a.owner_avatar; %>
    6468            <span class="roster-avatar"<% if (_ava) { %> style="background-image:url('<%= _ava %>')"<% } else { %> style="background:<%= a.accent || 'var(--accent)' %>;color:#fff"<% } %>>
     
    8589      <div class="hub-feed">
    8690        <% posts.forEach(function(p){ %>
    87           <a class="feed-item" href="/user/<%= p.site_slug %>/<%= p.slug %>">
     91          <a class="feed-item" href="/user/<%= p.site_slug %>/<%= p.slug %>"
     92             hx-get="/user/<%= p.site_slug %>/<%= p.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
     93             hx-push-url="/user/<%= p.site_slug %>/<%= p.slug %>" hx-indicator="#pcms-loading">
    8894            <% if (p.cover_image_url) { %>
    8995              <span class="feed-cover" style="background-image:url('<%= p.cover_image_url %>')"></span>
  • src/views/partials/topnav.ejs

    r09ac0a5 r03bfdce  
    2828        <a href="<%= _siteUrlBase %>/" class="nav-link nav-link-admin">← Terug naar site</a>
    2929      <% } else if (typeof tenancy !== 'undefined' && tenancy === 'hub') { %>
    30         <%# Hub: de brand is de hub-naam en gaat naar de hub-home (volledige nav, geen
    31             HTMX, zodat de headerloze overview correct rendert). Eigen class want
    32             .site-title is overal display:none. %>
    33         <a class="nav-hub-home" href="/" aria-label="Home" title="Home">
     30        <%# Hub: de brand gaat naar de hub-home via HTMX. De chrome wordt in hub-modus
     31            altijd gerenderd en via body.on-hub (CSS) verborgen op de landing, dus htmx
     32            kan schakelen zonder full-reload → de audioplayer blijft leven. %>
     33        <a class="nav-hub-home" href="/" aria-label="Home" title="Home"
     34           hx-get="/?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/" hx-indicator="#pcms-loading">
    3435          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
    3536        </a>
  • src/views/shell.ejs

    r09ac0a5 r03bfdce  
    267267    - auth-pagina's (on-auth): focus-schermen voor in-/uitloggen.
    268268    Die chrome hoort bij een Klonkt-site en verschijnt dus op /user/-pagina's. %>
     269<% var _isHub  = (typeof tenancy !== 'undefined' && tenancy === 'hub'); %>
     270<% var _onAuth = (typeof bodyClass === 'string' && bodyClass.indexOf('on-auth') >= 0); %>
    269271<% var bareChrome = (typeof bodyClass === 'string' && (bodyClass.indexOf('on-hub') >= 0 || bodyClass.indexOf('on-auth') >= 0))
    270      || ((typeof tenancy !== 'undefined' && tenancy === 'hub') && !siteUrlBase && !isAdminPage); %>
    271 
    272 <% if (!bareChrome) { %>
     272     || (_isHub && !siteUrlBase && !isAdminPage); %>
     273<%# In HUB-modus de chrome ALTIJD renderen (CSS verbergt 'm op de hub-landing via
     274    body.on-hub) zodat htmx tussen hub-home en artiest-sites kan schakelen zónder
     275    full-reload → de audioplayer blijft leven, geen verspringen. profile-header
     276    self-hidet als er geen site is. Solo/circle: ongewijzigd (!bareChrome). %>
     277<% var renderChrome = _isHub ? !_onAuth : !bareChrome; %>
     278
     279<% if (renderChrome) { %>
    273280  <%- include('partials/topnav') %>
    274281  <%- include('partials/profile-header') %>
     
    279286    on non-feed pages (post, account, search, auth) it navigates to /
    280287    in the chosen view. Click logic is in shell.ejs at the bottom. %>
    281 <% if (!isAdminPage && !bareChrome) { %>
     288<% if (!isAdminPage && renderChrome) { %>
    282289  <%- include('partials/view-switcher') %>
    283290<% } %>
     
    353360    PAGE_CLASSES.forEach(function(c) { document.body.classList.remove(c); });
    354361    document.body.classList.add(firstClass);
     362    // 'on-hub' is een modifier náást de page-class: apart toggelen zodat de
     363    // hub-chrome (topnav/view-switcher) via CSS mee-schakelt bij htmx-navigatie
     364    // tussen hub-home (on-hub) en artiest-sites (geen on-hub).
     365    document.body.classList.toggle('on-hub', /(^|\s)on-hub(\s|$)/.test(String(next)));
    355366  });
    356367})();
Note: See TracChangeset for help on using the changeset viewer.