Changeset 03bfdce in Klonkt for src/views/shell.ejs


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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.