@michengai/dsh-codex-ui 2.2.4 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/CHANGELOG.zh-CN.md +6 -0
- package/lib/session-title-plugin.mjs +13 -9
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.2.5] - 2026-11-15
|
|
4
|
+
|
|
5
|
+
- **Longer Generated Titles Are Kept Instead of Discarded (Issue #101)**:
|
|
6
|
+
- A generated title whose theme carried a plugin name, a file path or a long identifier used to be thrown away as a whole, so the session fell back to the clipped first message; the title now keeps its `✨ Type|theme` shape and only the part that does not fit is trimmed;
|
|
7
|
+
- The title still respects the host's byte budget, and the type prefix stays intact in every case, so a new session no longer loses its smart title when the subject happens to be long.
|
|
8
|
+
|
|
3
9
|
## [2.2.4] - 2026-11-15
|
|
4
10
|
|
|
5
11
|
- **Section Headers Stay Pinned While Scrolling (Issue #100)**:
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [2.2.5] - 2026-11-15
|
|
4
|
+
|
|
5
|
+
- **主题偏长的智能标题不再被整条丢弃(Issue #101)**:
|
|
6
|
+
- 主题里带插件名、文件路径或长 ID 时,过去整条标题会被放弃,新会话退回成「首条消息开头截断」的样子;现在保留 `✨ 类型|主题` 的形态,只把放不下的部分截掉;
|
|
7
|
+
- 标题依然遵循宿主的长度预算,类型前缀在任何情况下都完整保留,新会话不会因为主题恰好偏长就丢掉智能标题。
|
|
8
|
+
|
|
3
9
|
## [2.2.4] - 2026-11-15
|
|
4
10
|
|
|
5
11
|
- **滚动时分区标题保持吸顶(Issue #100)**:
|
|
@@ -1971,18 +1971,20 @@ function inferLocaleFromMessage(text) {
|
|
|
1971
1971
|
if (/[㐀-鿿]/.test(text)) return "zh";
|
|
1972
1972
|
if (/[A-Za-z]/.test(text)) return "en";
|
|
1973
1973
|
}
|
|
1974
|
-
function
|
|
1975
|
-
|
|
1976
|
-
if (Buffer.byteLength(line, "utf8") <= 40) return line;
|
|
1974
|
+
function truncateUtf8(value, maxBytes) {
|
|
1975
|
+
if (Buffer.byteLength(value, "utf8") <= maxBytes) return value;
|
|
1977
1976
|
let used = 0;
|
|
1978
1977
|
let output = "";
|
|
1979
|
-
for (const character of
|
|
1978
|
+
for (const character of value) {
|
|
1980
1979
|
const bytes = Buffer.byteLength(character, "utf8");
|
|
1981
|
-
if (used + bytes >
|
|
1980
|
+
if (used + bytes > maxBytes) break;
|
|
1982
1981
|
output += character;
|
|
1983
1982
|
used += bytes;
|
|
1984
1983
|
}
|
|
1985
|
-
return output
|
|
1984
|
+
return output;
|
|
1985
|
+
}
|
|
1986
|
+
function compactMessageTheme(message) {
|
|
1987
|
+
return truncateUtf8(message.replace(/\s+/g, " ").trim(), 40).trimEnd();
|
|
1986
1988
|
}
|
|
1987
1989
|
/** 主题必须跟用户消息同一语言;模型串语言时改用消息原文。 */
|
|
1988
1990
|
function alignThemeToMessage(theme, message) {
|
|
@@ -2048,9 +2050,11 @@ function assembleSessionTitle(type, theme, locale) {
|
|
|
2048
2050
|
if (parsed === void 0) return void 0;
|
|
2049
2051
|
const displayLocale = locale ?? inferLocaleFromTypeToken(type);
|
|
2050
2052
|
const label = typeLabel(parsed.type, displayLocale);
|
|
2051
|
-
const
|
|
2052
|
-
if (
|
|
2053
|
-
|
|
2053
|
+
const prefix = `${SESSION_TITLE_EMOJI[parsed.type]} ${label}`;
|
|
2054
|
+
if (isRedundantTheme(parsed.type, parsed.theme)) return prefix;
|
|
2055
|
+
const budget = 80 - Buffer.byteLength(`${prefix}|`, "utf8");
|
|
2056
|
+
const fitted = truncateUtf8(parsed.theme, budget).trimEnd();
|
|
2057
|
+
return fitted === "" ? prefix : `${prefix}|${fitted}`;
|
|
2054
2058
|
}
|
|
2055
2059
|
function shouldSkipAutoTitle(session) {
|
|
2056
2060
|
const origin = session.origin ?? session.header?.origin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-ui",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "DSH Codex UI — 为 DeepSeek Harness 提供极速历史召回、全屏设置皮肤、原生物理毛玻璃换肤、模块化侧栏与桌面原生窗口菜单 · Input enhancement, settings skin, native glass theme, modular sidebar, and desktop titlebar menu for DSH",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"sidebar",
|
|
31
31
|
"settings"
|
|
32
32
|
],
|
|
33
|
-
"icon": "
|
|
33
|
+
"icon": "assets/icon.svg",
|
|
34
34
|
"type": "module",
|
|
35
35
|
"packageManager": "pnpm@11.22.0",
|
|
36
36
|
"engines": {
|
|
@@ -199,6 +199,5 @@
|
|
|
199
199
|
},
|
|
200
200
|
"dependencies": {
|
|
201
201
|
"lucide-react": "^1.39.0"
|
|
202
|
-
}
|
|
203
|
-
"icon": "assets/icon.svg"
|
|
202
|
+
}
|
|
204
203
|
}
|