diff --git a/static/index.html b/static/index.html index 4c66b1f..d25c650 100644 --- a/static/index.html +++ b/static/index.html @@ -26,7 +26,7 @@ - + diff --git a/static/js/voice-library.js b/static/js/voice-library.js index 07142a3..558322a 100644 --- a/static/js/voice-library.js +++ b/static/js/voice-library.js @@ -134,19 +134,35 @@ document.addEventListener('click', e => { const icon = btn?.querySelector('.mdi'); if (icon) icon.className = 'mdi mdi-folder' + (window._voiceGroupByTag ? '-open' : '') + '-outline'; renderVoiceList(); - } - if (e.target.closest('#voice-table-view-btn')) { + } else if (e.target.closest('#voice-table-view-btn')) { window._voiceTableView = !window._voiceTableView; + if (!window._voiceTableView) window._voiceTableEditMode = false; try { localStorage.setItem('vl-table-view', window._voiceTableView ? '1' : '0'); } catch (_) {} const btn = document.getElementById('voice-table-view-btn'); btn?.classList.toggle('active', window._voiceTableView); + + const editBtn = document.getElementById('voice-table-edit-btn'); + if (editBtn) { + editBtn.style.display = window._voiceTableView ? 'inline-flex' : 'none'; + editBtn.classList.toggle('active', !!window._voiceTableEditMode); + } + document.querySelector('.voices-workbench')?.classList.toggle('table-view', window._voiceTableView); + document.querySelector('.voices-workbench')?.classList.toggle('table-edit-mode', !!window._voiceTableEditMode); + // Auto-close any open inspector row when toggling table view if (window._voiceTableView) { document.querySelectorAll('.edit-open').forEach(r => r.classList.remove('edit-open')); const inspector = document.getElementById('voices-inspector'); if (inspector) inspector.innerHTML = '
Table View Mode
Click a row to exit table view and edit.