v2: header 标题超长时末尾省略号(文字包 span 可收缩)

This commit is contained in:
2026-09-03 15:40:56 +08:00
parent 7ae0de1266
commit cc760279b2
2 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -60,9 +60,14 @@ input, textarea { font: inherit; color: inherit; border: 0; outline: none; backg
}
.header-title {
font-size: 15px; line-height: 1.3;
max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
min-width: 0; max-width: 100%; overflow: hidden;
white-space: nowrap;
display: flex; align-items: center; gap: 5px; justify-content: center;
}
/* 文字层可收缩,过长时末尾省略号(flex 容器本身不响应 text-overflow,须包 span) */
.header-title-text {
min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.header-mode-icon {
width: 17px; height: 17px; flex: none; color: var(--active);
fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
+2 -1
View File
@@ -367,7 +367,8 @@
title.className = 'header-title';
title.style.cursor = 'pointer';
title.title = '点击重命名';
title.innerHTML = (modeIcons[state.mode] || '') + esc(state.sessionTitle || state.sessionId);
title.innerHTML = (modeIcons[state.mode] || '') +
'<span class="header-title-text">' + esc(state.sessionTitle || state.sessionId) + '</span>';
title.addEventListener('click', renameSession); // 点标题重命名(同步 index)
c.innerHTML = '';
c.appendChild(title);