From bf3715f6aaa3ef0d677ff7d82e3bcb41401c72bf Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 15 May 2026 09:41:28 -0400 Subject: [PATCH] Truncate long layer names in Layers panel list to prevent horizontal scroll --- src/index.html | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 412a76c..a3bd3cc 100644 --- a/src/index.html +++ b/src/index.html @@ -975,6 +975,21 @@ justify-content: space-between; gap: 8px; text-align: left; + min-width: 0; + overflow: hidden; + } + + .layerItem > span:first-child { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .layerItem > span:last-child { + flex-shrink: 0; + color: var(--muted); + font-size: .78rem; } .layerItem.active { @@ -3394,7 +3409,9 @@ const item = document.createElement('button'); item.type = 'button'; item.className = `layerItem${layer.id === state.selectedLayerId ? ' active' : ''}`; - item.innerHTML = `${layer.name || layer.type}${layer.type}`; + const rawName = layer.name || layer.type; + const displayName = rawName.length > 32 ? rawName.slice(0, 29) + '...' : rawName; + item.innerHTML = `${displayName}${layer.type}`; item.addEventListener('click', () => { state.selectedLayerId = layer.id; render();