fix: restore htmx pagination and seed theme defaults
Some checks failed
CI / build (push) Waiting to run
Preview Performance Regression Gate / preview-perf (push) Has been cancelled

This commit is contained in:
matt 2025-09-30 08:26:11 -07:00
parent 4f7d39acba
commit 6e9ba244c9
14 changed files with 66 additions and 28227 deletions

View file

@ -84,7 +84,14 @@
resultsHost.setAttribute('aria-busy','true');
fetch('/themes/fragment/list_simple?'+ps, {cache:'no-store'})
.then(r=>r.text())
.then(html=>{ resultsHost.innerHTML=html; resultsHost.removeAttribute('aria-busy'); renderActive(); })
.then(html=>{
resultsHost.innerHTML=html;
if(window.htmx && typeof window.htmx.process==='function'){
window.htmx.process(resultsHost);
}
resultsHost.removeAttribute('aria-busy');
renderActive();
})
.catch(()=>{ resultsHost.innerHTML='<div class="empty" style="font-size:13px;">Failed to load.</div>'; resultsHost.removeAttribute('aria-busy'); });
}
function performSearch(q){

View file

@ -163,7 +163,17 @@ mark { background:#fde68a; color:inherit; padding:0 2px; border-radius:2px; }
toggleRefreshBtn(true);
fetch('/themes/fragment/list?'+base, {cache:'no-store', signal: controller.signal})
.then(r=>r.text())
.then(html=>{ if(controller.signal.aborted) return; target.innerHTML = html; target.removeAttribute('aria-busy'); target.classList.remove('preload-hide'); listRenderComplete(); toggleRefreshBtn(false); })
.then(html=>{
if(controller.signal.aborted) return;
target.innerHTML = html;
if(window.htmx && typeof window.htmx.process==='function'){
window.htmx.process(target);
}
target.removeAttribute('aria-busy');
target.classList.remove('preload-hide');
listRenderComplete();
toggleRefreshBtn(false);
})
.catch(err=>{ if(controller.signal.aborted) return; target.innerHTML = '<div class="error" role="alert">Failed loading themes. <button id="retry-fetch" class="btn btn-ghost">Retry</button></div>'; target.removeAttribute('aria-busy'); target.classList.remove('preload-hide'); attachRetry(); structuredLog('list_fetch_error'); announceResultCount(); toggleRefreshBtn(false); });
}
function attachRetry(){ var b=document.getElementById('retry-fetch'); if(!b) return; b.addEventListener('click', function(){ fetchList(); }); }