ux(classifier): drop the hover "Extract All" button from folder rows
It wasn't needed and its margin-left:auto shoved the folder's direct/total stats out of position. Removed the button and its now-unused helpers (countZipDescendants / getZipDescendants / handleExtractAllZips) and CSS. The per-archive "Extract" on an expanded zip-root stays. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
800454d0db
commit
4b79386c4e
2 changed files with 0 additions and 105 deletions
|
|
@ -567,24 +567,6 @@ input.tfile__name:focus { border-color: var(--primary); background: var(--bg); o
|
||||||
cursor: wait;
|
cursor: wait;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ZIP Extract All Button */
|
|
||||||
.zip-extract-all-btn {
|
|
||||||
margin-left: auto;
|
|
||||||
padding: 0.15rem 0.4rem;
|
|
||||||
font-size: 0.7rem;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.15s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.folder-item:hover .zip-extract-all-btn {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.zip-extract-all-btn:disabled {
|
|
||||||
opacity: 0.5;
|
|
||||||
cursor: wait;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── By-tracking merged-cell table ──────────────────────────────────────── */
|
/* ── By-tracking merged-cell table ──────────────────────────────────────── */
|
||||||
#trackingTree { padding: 0; } /* table reaches the edges; cells carry padding */
|
#trackingTree { padding: 0; } /* table reaches the edges; cells carry padding */
|
||||||
.ttable { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.82rem; }
|
.ttable { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.82rem; }
|
||||||
|
|
|
||||||
|
|
@ -340,22 +340,6 @@
|
||||||
});
|
});
|
||||||
item.appendChild(extractBtn);
|
item.appendChild(extractBtn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract All button for folders with ZIP descendants (but not ZIP roots themselves)
|
|
||||||
if (!folder.isZipRoot && !folder.isVirtualDir) {
|
|
||||||
const zipCount = countZipDescendants(folder);
|
|
||||||
if (zipCount > 0) {
|
|
||||||
const extractAllBtn = document.createElement('button');
|
|
||||||
extractAllBtn.className = 'btn btn-sm zip-extract-all-btn';
|
|
||||||
extractAllBtn.textContent = `📤 Extract All (${zipCount})`;
|
|
||||||
extractAllBtn.title = `Extract all ${zipCount} ZIP file(s) in this folder`;
|
|
||||||
extractAllBtn.addEventListener('click', async (e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
await handleExtractAllZips(folder);
|
|
||||||
});
|
|
||||||
item.appendChild(extractAllBtn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Click handler for selection
|
// Click handler for selection
|
||||||
item.addEventListener('click', (e) => {
|
item.addEventListener('click', (e) => {
|
||||||
|
|
@ -507,77 +491,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Count ZIP descendants in a folder
|
|
||||||
*/
|
|
||||||
function countZipDescendants(folder) {
|
|
||||||
let count = 0;
|
|
||||||
if (folder.children) {
|
|
||||||
for (const child of folder.children) {
|
|
||||||
if (child.isZipRoot) {
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
count += countZipDescendants(child);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all ZIP folders as flat list
|
|
||||||
*/
|
|
||||||
function getZipDescendants(folder, zips = []) {
|
|
||||||
if (folder.children) {
|
|
||||||
for (const child of folder.children) {
|
|
||||||
if (child.isZipRoot) {
|
|
||||||
zips.push(child);
|
|
||||||
}
|
|
||||||
getZipDescendants(child, zips);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return zips;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle extracting all ZIPs in a folder
|
|
||||||
*/
|
|
||||||
async function handleExtractAllZips(folder) {
|
|
||||||
const zips = getZipDescendants(folder);
|
|
||||||
if (zips.length === 0) return;
|
|
||||||
|
|
||||||
const confirmed = confirm(`Extract ${zips.length} ZIP file(s)?\n\nThis will create folders for each ZIP with their contents.`);
|
|
||||||
if (!confirmed) return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Show extracting state on button
|
|
||||||
const btn = document.querySelector(`.folder-item[data-path="${folder.path}"] .zip-extract-all-btn`);
|
|
||||||
if (btn) {
|
|
||||||
btn.textContent = '⏳ Extracting...';
|
|
||||||
btn.disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract all ZIPs
|
|
||||||
for (const zip of zips) {
|
|
||||||
if (zip.zipPath) {
|
|
||||||
await window.app.modules.scanner.extractZip(zip.zipPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Auto-refresh preserving tree state
|
|
||||||
await window.app.modules.scanner.scanDirectory(window.app.rootHandle, true);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Error extracting ZIPs:', err);
|
|
||||||
alert('Error extracting ZIPs: ' + err.message);
|
|
||||||
|
|
||||||
// Reset button
|
|
||||||
const btn = document.querySelector(`.folder-item[data-path="${folder.path}"] .zip-extract-all-btn`);
|
|
||||||
if (btn) {
|
|
||||||
btn.textContent = `📤 Extract All (${zips.length})`;
|
|
||||||
btn.disabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle folder expansion
|
* Toggle folder expansion
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue