diff --git a/frontend/app.js b/frontend/app.js index 2ff82e3..8681c7a 100755 --- a/frontend/app.js +++ b/frontend/app.js @@ -9379,7 +9379,10 @@ async function renderSettings() {
-
+
+ Saved videos +
+
@@ -9644,6 +9647,13 @@ async function renderSettings() { ]); }); + // The saved-videos list folds; remember how the user left it. + { + const fold = $('cacheFold'); + try { fold.open = localStorage.getItem('ytpCacheFoldOpen') === '1'; } catch { /* blocked */ } + fold.addEventListener('toggle', () => { try { localStorage.setItem('ytpCacheFoldOpen', fold.open ? '1' : '0'); } catch { /* blocked */ } }); + } + // ---- Populate live cache stats ---- try { const res = await API.cacheList(); @@ -9651,6 +9661,7 @@ async function renderSettings() { const total = (res && res.total) || 0; const items = (res && res.items) || []; $('cacheTotal').textContent = `${fmtBytes(total)} · ${items.length} video${items.length === 1 ? '' : 's'}`; + $('cacheFoldCount').textContent = items.length ? `${items.length} · ${fmtBytes(total)}` : 'none'; const listEl = $('cacheList'); if (!items.length) { listEl.innerHTML = '
No videos saved offline yet.
'; diff --git a/frontend/styles.css b/frontend/styles.css index 785e675..62e698f 100755 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -4333,3 +4333,21 @@ html.ios-nozoom, html.ios-nozoom body { touch-action: manipulation; } .ch-pick-t { font: 500 12.5px var(--mono, ui-monospace, monospace); color: var(--text-dim); font-variant-numeric: tabular-nums; } .ch-pick.on { background: color-mix(in srgb, var(--accent) 16%, var(--bg-2)); border-color: color-mix(in srgb, var(--accent) 55%, transparent); } .ch-pick.on .ch-pick-n, .ch-pick.on .ch-pick-t { color: var(--accent-bright); } + +/* Settings → Offline cache: the saved-videos list folds */ +.cache-fold { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); } +.cache-fold > summary { + list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; + cursor: pointer; font-weight: 600; color: var(--text); border-radius: 12px; +} +.cache-fold > summary::-webkit-details-marker { display: none; } +.cache-fold > summary::before { + content: ""; flex: none; width: 7px; height: 7px; margin-right: 2px; + border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim); + transform: rotate(-45deg); transition: transform .18s ease; +} +.cache-fold[open] > summary::before { transform: rotate(45deg); } +.cache-fold > summary:hover { background: var(--bg-2); } +.cache-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } +.cache-fold-count { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; } +.cache-fold > .cache-list { margin: 0; padding: 4px 10px 10px; }