From e4f56bf708face7f6e6187494f6a95d39f97dc99 Mon Sep 17 00:00:00 2001 From: MedMan Dev Date: Fri, 30 Oct 2026 15:46:52 +0000 Subject: Add tag-assignment progress bar and enlarge autocomplete input - Batch tag assignment shows spinner + progress bar with counter while POSTing to all selected files (concurrent chunks of 10) - Autocomplete input enlarged in padding/font for better dropdown fit --- templates/index.html | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/templates/index.html b/templates/index.html index 13f4ea3..0e577f2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -141,6 +141,16 @@ main { flex:1; display:flex; overflow:hidden; min-height:0; } .tagac .ac-item { padding:4px 8px; font-size:0.7rem; cursor:pointer; color:var(--text); } .tagac .ac-item:hover, .tagac .ac-item.active { background:var(--surface2); color:var(--accent); } .tagac .ac-item .create { color:var(--green); font-size:0.6rem; margin-left:4px; } +.tagac input.tag-in { padding:6px 8px; font-size:0.78rem; } + +/* ── batch tag progress ───────────────────────────────────────────────── */ +.tagprog { margin-top:10px; display:none; } +.tagprog.on { display:block; } +.tagprog .row { display:flex; align-items:center; gap:8px; } +.tagprog .spin { width:16px; height:16px; border:2px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin 0.7s linear infinite; flex-shrink:0; } +.tagprog .lbl { font-size:0.68rem; color:var(--text2); flex-shrink:0; } +.tagprog .bar-wrap { flex:1; height:6px; background:var(--surface2); border-radius:3px; overflow:hidden; } +.tagprog .bar { height:100%; width:0%; background:var(--accent); border-radius:3px; transition:width 0.15s ease; } .mc .nav-row { display:flex; align-items:center; gap:6px; margin-top:12px; padding-top:8px; border-top:1px solid var(--border); } .mc .nav-row button { flex:1; background:var(--surface2); color:var(--text); border:1px solid var(--border); border-radius:4px; padding:5px 10px; cursor:pointer; font-size:0.7rem; } @@ -697,16 +707,40 @@ async function selTag(){
+
+
+
+
+ 0 / ${S.sel.size} +
+
`; document.getElementById('prev-modal').classList.add('on'); let container=document.querySelector('#m-body .tagac'); let input=_tagAutocomplete(container, [], async (name)=>{ - let c=0; - for(let h of[...S.sel]){ - try{await _assignTagByName(h, name);c++;}catch(e){} + let total=S.sel.size, done=0, err=0; + let prog=document.getElementById('tagprog'); + let bar=document.getElementById('tagprog-bar'); + let lbl=document.getElementById('tagprog-lbl'); + prog.classList.add('on'); + input.disabled=true; + let hashes=[...S.sel]; + // Assign in small concurrent chunks for speed + smooth progress + let chunk=10; + for(let i=0;i_assignTagByName(h,name))); + for(let r of results){if(r.status==='fulfilled')done++;else err++;} + let pct=Math.round((i+batch.length)/hashes.length*100); + bar.style.width=pct+'%'; + lbl.textContent=done+' / '+total+(err?' ('+err+' Fehler)':''); } + bar.style.width='100%'; + lbl.textContent=done+' / '+total+(err?' ('+err+' Fehler)':'')+' ✓'; + setTimeout(()=>prog.classList.remove('on'),400); + input.disabled=false; document.getElementById('prev-modal').classList.remove('on'); - st(`${c} Dateien mit '${name}' getaggt`); + st(`${done} Dateien mit '${name}' getaggt`); await reloadFiles(); if(S.sel.size){selTag();} // reopen for further tagging }); -- cgit v1.2.3