From 76aad18646c54059923d3ce2ab760c81a87b4238 Mon Sep 17 00:00:00 2001 From: Michi Date: Tue, 24 Nov 2026 22:09:42 +0100 Subject: [PATCH] filter-chips: nie gequetscht, passen sich der breite an MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die Schnellfilter brachen bei schmalem Fenster um ("Ohne / Remote") und wurden rechts abgeschnitten – vor allem auf Deutsch (längere Namen). Jetzt schrumpfen Chips nicht mehr; reicht der Platz nicht, zeigen sie nur Icon + Zahl (Name im Tooltip), notfalls scrollt die Reihe seitlich mit Ausblendung am Rand. Gemessen statt fester Breite, also sprachunabhängig. Co-Authored-By: Claude Opus 5.5 --- public/app.js | 13 +++++++++++++ public/index.html | 9 +++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/public/app.js b/public/app.js index 3096620..7323b42 100644 --- a/public/app.js +++ b/public/app.js @@ -1381,7 +1381,19 @@ function renderQuickFilters() { return `` }).join('') for (const b of document.querySelectorAll('.fchip')) b.onclick = () => { quickFilter = b.dataset.q; render() } + requestAnimationFrame(fitChips) // after the rest of the toolbar (sort, board mode) has its final size } +// Measured, not a fixed breakpoint (labels differ per language): too wide → icon + count only, +// still too wide → the row scrolls sideways with a fade at the edge. +function fitChips() { + const el = document.getElementById('chipfilters') + if (!el) return + el.classList.remove('compact', 'more') + if (el.scrollWidth > el.clientWidth + 1) el.classList.add('compact') + if (el.scrollWidth > el.clientWidth + 1) el.classList.add('more') +} +// the toolbar's width, not the chips' (fitChips changes those itself – that would loop) +new ResizeObserver(() => fitChips()).observe(document.querySelector('.toolbar')) function render() { document.getElementById('count').textContent = noneShown ? t('count.none') : !rootDir ? t('count.noFolder') @@ -1401,6 +1413,7 @@ function updateToolbarForView() { document.getElementById('selStatusWrap').style.display = activeView === 'board' ? 'none' : '' document.getElementById('selSortWrap').style.display = activeView === 'tasks' ? 'none' : '' document.getElementById('boardMode').style.display = activeView === 'board' ? '' : 'none' + requestAnimationFrame(fitChips) // the space left for the filter chips changed } /* ── scan ─────────────────────────────────────────────────────────────── */ diff --git a/public/index.html b/public/index.html index ec2fc2e..1765428 100644 --- a/public/index.html +++ b/public/index.html @@ -120,7 +120,7 @@ .toolbar select { border: none; background: transparent; padding: 7px 4px; font-size: 13px; outline: none; color: var(--text); cursor: pointer; } .toolbar select option { background: var(--surface); } .chipfilters { display: flex; gap: 6px; flex-wrap: wrap; } - .fchip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); } + .fchip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); flex: 0 0 auto; white-space: nowrap; } .fchip:hover { color: var(--text); } .fchip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); } .fchip .n { font-size: 11px; opacity: .8; } @@ -395,7 +395,12 @@ /* toolbar stays one row: chips drop their labels first */ .toolbar { flex-wrap: nowrap; container-type: inline-size; container-name: toolbar; } - .chipfilters { flex-wrap: nowrap; min-width: 0; overflow: hidden; } + /* chips never squeeze: too many for the width → labels hide (fitChips in app.js), then the row scrolls sideways */ + .chipfilters { flex-wrap: nowrap; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; } + .chipfilters::-webkit-scrollbar { display: none; } + .chipfilters.compact .fchip:not(.active) .fl { display: none; } + .chipfilters.compact .fchip { padding: 5px 9px; } + .chipfilters.more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); } .toolbar .sel { flex: 0 0 auto; } @container toolbar (max-width: 1050px) { .fchip:not(.active) .fl { display: none; } .fchip { padding: 5px 9px; } } @container toolbar (max-width: 700px) { .fchip .fl { display: none; } }