@michengai/dsh-codex-ui 2.2.3 → 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 CHANGED
@@ -1,5 +1,17 @@
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
+
9
+ ## [2.2.4] - 2026-11-15
10
+
11
+ - **Section Headers Stay Pinned While Scrolling (Issue #100)**:
12
+ - Scrolling the sidebar list no longer pushes the current section header (Pinned, Projects or a custom section) out of view: the header of the section you are reading sticks to the top of the list and hands the spot over to the next section as it comes up;
13
+ - Section headers no longer disappear together with the workspace rows, so it stays clear which group the visible rows belong to.
14
+
3
15
  ## [2.2.3] - 2026-11-14
4
16
 
5
17
  - **Custom Workspace Section Reordering via Actions Menu (Issue #99)**:
@@ -1,5 +1,17 @@
1
1
  # 更新日志
2
2
 
3
+ ## [2.2.5] - 2026-11-15
4
+
5
+ - **主题偏长的智能标题不再被整条丢弃(Issue #101)**:
6
+ - 主题里带插件名、文件路径或长 ID 时,过去整条标题会被放弃,新会话退回成「首条消息开头截断」的样子;现在保留 `✨ 类型|主题` 的形态,只把放不下的部分截掉;
7
+ - 标题依然遵循宿主的长度预算,类型前缀在任何情况下都完整保留,新会话不会因为主题恰好偏长就丢掉智能标题。
8
+
9
+ ## [2.2.4] - 2026-11-15
10
+
11
+ - **滚动时分区标题保持吸顶(Issue #100)**:
12
+ - 在侧栏列表里滚动时,当前分区(「置顶」「项目」或自定义分区)的标题不再被滚出视野:正在查看的那个分区的标题会贴在列表顶部,滚到下一个分区时自动交给下一个标题;
13
+ - 分区标题不再跟着工作区行一起消失,随时能看出可见的行属于哪个分组。
14
+
3
15
  ## [2.2.3] - 2026-11-14
4
16
 
5
17
  - **自定义工作区分区支持菜单调整排序(Issue #99)**:
package/lib/client.js CHANGED
@@ -13425,6 +13425,11 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
13425
13425
  .dcu-ws-section-action{width:24px;height:24px;margin:-4px;padding:0;border:0;border-radius:var(--dsw-radius-xs,4px);background:transparent;color:var(--dsw-alias-label-tertiary,inherit);font:inherit;font-size:12px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
13426
13426
  .dcu-ws-section-action:hover{color:var(--dsw-alias-label-primary,inherit);background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.16))}
13427
13427
  [data-sidebar-collapsed='true'] .dcu-ws-section{display:none !important}
13428
+ /* 滚轮滚动时只让「当前分区」的标题吸顶(判定见 updateStickyHeaders),其余标题留在文档流里,
13429
+ 否则多行标题会一起钉在顶部叠字。吸顶时把 8px 上外边距换成等量上内边距:标题占位总高不变,
13430
+ 但贴住上沿后上方不会再留一条能看见滚动内容的空缝。背景吃侧栏填充色并补一层模糊,
13431
+ 滚过去的会话行不会从标题后面透出来。 */
13432
+ .dcu-ws-section[data-dcu-sticky='true']{position:sticky;top:0;z-index:3;box-sizing:border-box;margin-top:0;padding-top:8px;height:38px;background:var(--dsw-specific-sidebar-fill,var(--dsw-alias-bg-layer-1,#121214));backdrop-filter:blur(12px)}
13428
13433
  /* z-index 取宿主顶级浮层的量级:分区标题 ··· 这条路径把面板挂在 body 上,宿主侧边栏/工作区树自己是
13429
13434
  更大的层级,1000 会让侧边栏的行文字压在面板上(表现为「菜单跑到侧边栏后面」)。
13430
13435
  面板本体由宿主 MenuSurface 原语渲染(表面 + material 磨砂层),这里只补壳外的几何与文字颜色,
@@ -14157,12 +14162,64 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
14157
14162
  header.remove();
14158
14163
  headers.delete(id);
14159
14164
  }
14165
+ scheduleStickyUpdate();
14160
14166
  }
14161
14167
  /** 列表不在工作区视图(频道、定时、rail 收起)时摘掉标题,避免串到别的列表里。 */
14162
14168
  function detachHeaders() {
14163
14169
  for (const header of headers.values()) header.remove();
14164
14170
  headers.clear();
14165
14171
  }
14172
+ /** 标题上的吸顶标记:只有「当前分区」的那一个带它,样式见 SECTIONS_CSS。 */
14173
+ const STICKY_ATTR = "data-dcu-sticky";
14174
+ let stickyRaf = 0;
14175
+ /** 从列表向上找真正的滚动容器(宿主的 `.listArea`),找不到时退化成文档滚动。 */
14176
+ function findStickyScroller(from) {
14177
+ if (from === void 0) return null;
14178
+ let node = from.parentElement;
14179
+ while (node !== null && node !== document.body) {
14180
+ const overflowY = getComputedStyle(node).overflowY;
14181
+ if (overflowY === "auto" || overflowY === "scroll" || overflowY === "overlay") return node;
14182
+ node = node.parentElement;
14183
+ }
14184
+ return null;
14185
+ }
14186
+ /**
14187
+ * 只给「当前分区」的标题打吸顶标记。
14188
+ *
14189
+ * 多个标题同时 sticky 会一起钉在顶部叠字(后一个盖住前一个),所以取「已经越过滚动口上沿、
14190
+ * 且最靠下」的那个标题作为当前分区;换区时上一个标题退回文档流,随内容一起滚走。
14191
+ * 吸顶中的标题 border-box 正好贴上沿,因此用 `<= 上沿 + 1px` 判定它仍属于当前分区。
14192
+ */
14193
+ function updateStickyHeaders() {
14194
+ stickyRaf = 0;
14195
+ if (disposed) return;
14196
+ const connected = Array.from(headers.values()).filter((header) => header.isConnected);
14197
+ if (connected.length === 0) return;
14198
+ const scroller = findStickyScroller(list);
14199
+ const edge = scroller === null ? 0 : scroller.getBoundingClientRect().top;
14200
+ let active = null;
14201
+ const ordered = connected.slice().sort((left, right) => left.compareDocumentPosition(right) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1);
14202
+ for (const header of ordered) if (header.getBoundingClientRect().top <= edge + 1) active = header;
14203
+ for (const header of connected) if (header === active) {
14204
+ if (!header.hasAttribute(STICKY_ATTR)) header.setAttribute(STICKY_ATTR, "true");
14205
+ } else if (header.hasAttribute(STICKY_ATTR)) header.removeAttribute(STICKY_ATTR);
14206
+ }
14207
+ function scheduleStickyUpdate() {
14208
+ if (stickyRaf !== 0 || disposed) return;
14209
+ stickyRaf = window.requestAnimationFrame(updateStickyHeaders);
14210
+ }
14211
+ /** 滚动事件不冒泡,只能在捕获阶段拿;只要是列表的滚动祖先就重算一次。 */
14212
+ function onScrollForSticky(event) {
14213
+ const target = event.target;
14214
+ if (target instanceof Document) {
14215
+ scheduleStickyUpdate();
14216
+ return;
14217
+ }
14218
+ if (!(target instanceof Element) || list === void 0) return;
14219
+ if (!target.contains(list)) return;
14220
+ scheduleStickyUpdate();
14221
+ }
14222
+ document.addEventListener("scroll", onScrollForSticky, true);
14166
14223
  /** 清理「内部 pointerout 截断」监听(每次开面板重新挂,closeSectionMenu 里释放)。 */
14167
14224
  let flyoutExitCleanup;
14168
14225
  /**
@@ -15165,6 +15222,8 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
15165
15222
  document.removeEventListener("click", onDocumentClickClearPending, true);
15166
15223
  document.removeEventListener("keydown", onDocumentKeydownClearPending, true);
15167
15224
  document.removeEventListener("contextmenu", onContextMenuToPrepareMenu, true);
15225
+ document.removeEventListener("scroll", onScrollForSticky, true);
15226
+ if (stickyRaf !== 0) window.cancelAnimationFrame(stickyRaf);
15168
15227
  unsubscribeDirectoryFlow?.();
15169
15228
  unsubscribe?.();
15170
15229
  closeSectionMenu();
@@ -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 compactMessageTheme(message) {
1975
- const line = message.replace(/\s+/g, " ").trim();
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 line) {
1978
+ for (const character of value) {
1980
1979
  const bytes = Buffer.byteLength(character, "utf8");
1981
- if (used + bytes > 40) break;
1980
+ if (used + bytes > maxBytes) break;
1982
1981
  output += character;
1983
1982
  used += bytes;
1984
1983
  }
1985
- return output.trimEnd();
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 title = isRedundantTheme(parsed.type, parsed.theme) ? `${SESSION_TITLE_EMOJI[parsed.type]} ${label}` : `${SESSION_TITLE_EMOJI[parsed.type]} ${label}|${parsed.theme}`;
2052
- if (Buffer.byteLength(title, "utf8") > 80) return void 0;
2053
- return title;
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",
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": "./assets/icon.svg",
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
  }