Changeset 9915786 in Klonkt


Ignore:
Timestamp:
06/16/2026 10:53:05 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
6224462
Parents:
e2a8e31
Message:

Hub mobile: Home button goes to the hub root instead of the artist sub-home

In hub mode, _siteUrlBase set the mobile Home button to /user/<slug>/
(the sub-home of the artist). Now Home in hub always goes to the hub root
(/) with a full nav (resets the shell context), matching the desktop brand
link. Active state only on the real hub root. Solo/circle unchanged.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/partials/bottom-tab.ejs

    re2a8e31 r9915786  
    1515const _hasPrutter  = !!(user && site && site.enable_prutter && (typeof tenancy !== 'undefined' && tenancy === 'hub') && (typeof premiumUnlocked === 'undefined' || premiumUnlocked));
    1616const _ownProfile  = user ? ('/users/' + user.username) : null;
     17const _isHub       = (typeof tenancy !== 'undefined' && tenancy === 'hub');
     18// Home gaat in hub-modus ALTIJD naar de hub-root (/), niet naar de sub-home van
     19// een artiest. In solo/circle is _siteUrlBase leeg, dus dat blijft '/'.
     20const _homeHref    = (_isHub ? '' : _siteUrlBase) + '/';
    1721
    1822// Strip site prefix for cleaner matching
     
    2428
    2529let _active = null;
    26 if (_p === '/' || _p === '') _active = 'home';
     30// In hub is Home alleen actief op de échte hub-root, niet op een artiest-sub-home.
     31if (_isHub ? (_path === '/') : (_p === '/' || _p === '')) _active = 'home';
    2732else if (_p.indexOf('/search') === 0 || _p.indexOf('/tag/') === 0 || _p.indexOf('/type/') === 0) _active = 'search';
    2833else if (_p === '/posts/new' || /^\/posts\/[^/]+\/edit$/.test(_p)) _active = 'create';
     
    3641  <!-- Home -->
    3742  <a class="bottom-tab-item<%= _active === 'home' ? ' is-active' : '' %>"
    38      href="<%= _siteUrlBase %>/"
    39      hx-get="<%= _siteUrlBase %>/?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
    40      hx-push-url="<%= _siteUrlBase %>/" hx-indicator="#pcms-loading"
     43     href="<%= _homeHref %>"
     44     <% if (!_isHub) { %>hx-get="<%= _homeHref %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="<%= _homeHref %>" hx-indicator="#pcms-loading"<% } %>
    4145     aria-label="Home" <%= _active === 'home' ? 'aria-current="page"' : '' %>>
    4246    <svg class="bottom-tab-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
Note: See TracChangeset for help on using the changeset viewer.