Polish: npm test runs every test file, two silent failures now log, Loading placeholders shimmer
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d173555398
commit
551f970721
32 files changed
+68
-47
No files matched your search
+4
-4
@@ -42,7 +42,7 @@ function viewFiles([repo, ...parts]) {
|
||||
if (!sf.token()) return filesLogin();
|
||||
const dir = '/' + parts.join('/');
|
||||
$('#view').innerHTML = `<div class="wrap"><h1>Files</h1><div class="files ${repo ? 'open' : ''}" id="files">
|
||||
<div class="libs" id="libs"><p class="empty">Loading…</p></div><div class="main" id="fmain"></div></div></div>`;
|
||||
<div class="libs" id="libs"><p class="empty loading" role="status">Loading…</p></div><div class="main" id="fmain"></div></div></div>`;
|
||||
libsP = loadLibs(repo);
|
||||
if (repo) loadDir(repo, dir);
|
||||
}
|
||||
@@ -229,7 +229,7 @@ async function prefetchDl(repo, path) {
|
||||
|
||||
async function loadDir(repo, dir) {
|
||||
const main = $('#fmain'); if (!main) return;
|
||||
main.innerHTML = '<p class="empty">Loading…</p>';
|
||||
main.innerHTML = '<p class="empty loading" role="status">Loading…</p>';
|
||||
await libsP.catch(() => {});
|
||||
if (!document.contains(main)) return;
|
||||
const enc = encodeURIComponent, ro = libPerm[repo] === 'r';
|
||||
@@ -243,7 +243,7 @@ async function loadDir(repo, dir) {
|
||||
const visible = () => { const q = v.filter.trim().toLowerCase(); return sortItems(v.items, sortCfg()).filter(x => !q || x.name.toLowerCase().includes(q)); };
|
||||
|
||||
main.innerHTML = `<div id="ftop"></div><div class="crumbs">${crumbs}</div>
|
||||
<input type="search" id="ff" placeholder="Filter this folder" autocomplete="off" hidden><div id="items"><p class="empty">Loading…</p></div><p class="sub" id="fsum" style="text-align:center"></p>`;
|
||||
<input type="search" id="ff" placeholder="Filter this folder" autocomplete="off" hidden><div id="items"><p class="empty loading" role="status">Loading…</p></div><p class="sub" id="fsum" style="text-align:center"></p>`;
|
||||
const go = p => { location.hash = hash(p); };
|
||||
|
||||
const drawTop = () => {
|
||||
@@ -396,7 +396,7 @@ async function loadDir(repo, dir) {
|
||||
const restore = () => { if (v.scrolled) return; v.scrolled = true; const y = fScroll.get(location.hash); if (y) requestAnimationFrame(() => { const view = $('#view'); if (view) view.scrollTop = y; }); };
|
||||
if (!quiet) {
|
||||
if (!v.items.length && saved) { v.items = saved.items; v.stale = 'old'; v.staleWhy = 'Updating…'; redraw(); restore(); } // the saved list at once, the real one right behind it
|
||||
else $('#items').innerHTML = '<p class="empty">Loading…</p>';
|
||||
else $('#items').innerHTML = '<p class="empty loading" role="status">Loading…</p>';
|
||||
}
|
||||
try {
|
||||
const items = await sf.req(`/api2/repos/${enc(repo)}/dir/?p=${enc(dir)}`);
|
||||
|
||||
Reference in new issue
Block a user