zcode-pro 1.8.1 → 1.8.2
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/README.en.md +37 -27
- package/README.md +42 -32
- package/dist/inject.js +460 -54
- package/package.json +1 -1
- package/src/host/helper.mjs +33 -4
- package/src/host/main.mjs +27 -12
- package/src/inject/core.js +12 -4
- package/src/inject/features/composer-edit-model.js +312 -0
- package/src/inject/features/settings-dialog.js +8 -2
- package/src/inject/features/status-bar.js +59 -8
- package/src/inject/features/styles.js +48 -28
- package/src/inject/features/theme.js +10 -0
- package/src/inject/features/ws-running.js +68 -12
- package/src/inject/index.js +2 -0
- package/src/inject/ui.js +2 -2
|
@@ -11,7 +11,8 @@ import { getConfig } from '../core.js';
|
|
|
11
11
|
|
|
12
12
|
// 各样式项的应用默认值(用于设置界面显示与“恢复默认”)
|
|
13
13
|
export const STYLE_DEFAULTS = {
|
|
14
|
-
|
|
14
|
+
thinkingRowGap: 20, // 思考段落间距:“已工作/工作中”过程视图内各行之间的距离
|
|
15
|
+
answerRowGap: 20, // 回答段落间距:回答正文内文本块、回合之间的垂直间距
|
|
15
16
|
listSpacing: 12, // 列表上下留白(my-3)
|
|
16
17
|
listItemSpacing: 6, // 列表项之间的间距(space-y-1.5)
|
|
17
18
|
quoteCodeSpacing: 16, // 引用块上下留白(my-4;代码块同规则)
|
|
@@ -56,38 +57,55 @@ const SEL_TABLE = `${CONV} .space-y-4 > div:has(table)`;
|
|
|
56
57
|
|
|
57
58
|
function buildCss(styles) {
|
|
58
59
|
const parts = [];
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const num = (v) => (typeof v === 'number' && Number.isFinite(v) && v >= 0 ? v : null);
|
|
61
|
+
const tg = num(styles.thinkingRowGap);
|
|
62
|
+
const ag = num(styles.answerRowGap);
|
|
63
|
+
const thinkingSet = tg !== null;
|
|
64
|
+
const answerSet = ag !== null;
|
|
65
|
+
if (answerSet) {
|
|
62
66
|
parts.push(
|
|
63
67
|
// 回合内外各级容器(SECTION 自身或后代,二者都覆盖)
|
|
64
|
-
`${CONV}.pb-5,${CONV} .pb-5{padding-bottom:${
|
|
65
|
-
`${CONV}.pt-5,${CONV} .pt-5{padding-top:${
|
|
66
|
-
`${CONV} .flex.flex-col.gap-5{gap:${
|
|
67
|
-
`${CONV} .flex.flex-col.gap-4{gap:${
|
|
68
|
+
`${CONV}.pb-5,${CONV} .pb-5{padding-bottom:${ag}px !important;}`,
|
|
69
|
+
`${CONV}.pt-5,${CONV} .pt-5{padding-top:${ag}px !important;}`,
|
|
70
|
+
`${CONV} .flex.flex-col.gap-5{gap:${ag}px !important;}`,
|
|
71
|
+
`${CONV} .flex.flex-col.gap-4{gap:${ag}px !important;}`,
|
|
68
72
|
// 答案内相邻文本块之间(特殊块除外,走各自间距项)
|
|
69
|
-
`${CONV} .space-y-4 > * + *:not(${SPECIAL}){margin-block-start:${
|
|
73
|
+
`${CONV} .space-y-4 > * + *:not(${SPECIAL}){margin-block-start:${ag}px !important;margin-top:${ag}px !important;}`,
|
|
70
74
|
// 特殊块后接文本块:去掉文本块的段落间距,避免与特殊块自身留白叠加
|
|
71
75
|
`${CONV} .space-y-4 > ${SPECIAL} + *:not(${SPECIAL}){margin-block-start:0 !important;margin-top:0 !important;}`,
|
|
72
|
-
//
|
|
73
|
-
`.history-message.flex.flex-col > * +
|
|
76
|
+
// 历史回合里“已工作”展开块之后接回答正文:这段距离算回答间距
|
|
77
|
+
`.history-message.flex.flex-col > * + *[class~="group/assistant-row"]{margin-block-start:${ag}px !important;margin-top:${ag}px !important;}`,
|
|
74
78
|
// 工具/状态卡片(“N 个文件已更改”等)上方间距下限 8px:
|
|
75
|
-
//
|
|
76
|
-
`${CONV} .flex.flex-col.gap-5 > [data-slot="collapsible"]{margin-block-start:max(0px, calc(8px - ${
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
// 回答段落间距调到 0 时也不至于贴死(gap 与 margin 在弹性布局里相加)
|
|
80
|
+
`${CONV} .flex.flex-col.gap-5 > [data-slot="collapsible"]{margin-block-start:max(0px, calc(8px - ${ag}px)) !important;margin-top:max(0px, calc(8px - ${ag}px)) !important;}`,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
if (thinkingSet) {
|
|
84
|
+
parts.push(
|
|
81
85
|
// 过程视图(思考/工具摘要/过程正文)的行块:应用给容器 4px gap + 每行
|
|
82
|
-
// 12px 上内边距(共 16px
|
|
86
|
+
// 12px 上内边距(共 16px)。思考段落间距设置时直接接管:gap 归零、上内边距
|
|
83
87
|
// 按设置值,总间距等于设置值(设 0 就完全贴紧)
|
|
84
88
|
`${CONV} [data-conversation-work-items]{gap:0 !important;}`,
|
|
85
|
-
`${CONV} [data-conversation-work-items] > * + *{padding-top:${
|
|
89
|
+
`${CONV} [data-conversation-work-items] > * + *{padding-top:${tg}px !important;}`,
|
|
90
|
+
// 过程视图里的叙述正文按思考算(比回答间距规则多一层容器限定,优先命中)
|
|
91
|
+
`${CONV} [data-conversation-work-items] .space-y-4 > * + *:not(${SPECIAL}){margin-block-start:${tg}px !important;margin-top:${tg}px !important;}`,
|
|
92
|
+
// 过程视图里特殊块后接文本块同样清零,避免与特殊块自身留白叠加(后写覆盖上一条)
|
|
93
|
+
`${CONV} [data-conversation-work-items] .space-y-4 > ${SPECIAL} + *:not(${SPECIAL}){margin-block-start:0 !important;margin-top:0 !important;}`,
|
|
94
|
+
// “已工作”展开块顶部留白(包裹层在历史内容容器内)
|
|
95
|
+
`${CONV} [data-testid^="chat-assistant-history-content"] .pt-5{padding-top:${tg}px !important;}`,
|
|
96
|
+
// 历史回合里“已工作”触发行等过程行之间;回答正文那一行走回答间距规则
|
|
97
|
+
`.history-message.flex.flex-col > * + *:not([data-slot="collapsible-content"]):not([class~="group/assistant-row"]){margin-block-start:${tg}px !important;margin-top:${tg}px !important;}`,
|
|
86
98
|
);
|
|
87
99
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
100
|
+
if (thinkingSet || answerSet) {
|
|
101
|
+
// 3.18 的“工作中”槽位带 -8px 上边距(默认 gap 20 → 实际 12px);行间距调小后
|
|
102
|
+
// 这层负边距会把槽位拉得贴住上面的内容(gap 7 → 实际 -1px)。清掉负边距,
|
|
103
|
+
// 让它跟其它块一样按设置的行间距排
|
|
104
|
+
parts.push(`${CONV} .flex.flex-col.gap-5 > [data-zcode-chat-loading-slot]:not(:first-child){margin-block-start:0 !important;margin-top:0 !important;}`);
|
|
105
|
+
}
|
|
106
|
+
// 特殊块(列表/引用块/表格)自身间距项未设置时跟随回答段落间距,
|
|
107
|
+
// 否则它们带的原生默认边距(12/16px)会与回答段落间距合并取大值,调小于该值无效
|
|
108
|
+
const own = (v) => (typeof v === 'number' && Number.isFinite(v) && v >= 0 ? v : (answerSet ? ag : null));
|
|
91
109
|
const ls = own(styles.listSpacing);
|
|
92
110
|
const qc = own(styles.quoteCodeSpacing);
|
|
93
111
|
const tsp = own(styles.tableSpacing);
|
|
@@ -97,7 +115,7 @@ function buildCss(styles) {
|
|
|
97
115
|
// 文本块自带的底边距(应用给段落默认 16px)清零:相邻块的边距合并会取大值,
|
|
98
116
|
// 不清零时段落间距调小于 16 无效,列表也会上边距大、下边距小。
|
|
99
117
|
// 任一间距项设置时启用,间距完全由设置的起始边距决定
|
|
100
|
-
if (
|
|
118
|
+
if (thinkingSet || answerSet || anySet) {
|
|
101
119
|
parts.push(`${CONV} .space-y-4 > :not(${SPECIAL}){margin-block-end:0 !important;margin-bottom:0 !important;}`);
|
|
102
120
|
}
|
|
103
121
|
if (tsp !== null) {
|
|
@@ -288,7 +306,8 @@ export function startStyleAdjustments() {
|
|
|
288
306
|
// 边距,数值直观);间距类项再把实际边距区域用淡黄色涂出,调值时黄条
|
|
289
307
|
// 随设置实时变宽变窄。设置弹窗本身用透明遮罩,正好看得见后面的会话 ——
|
|
290
308
|
const HL_SELECTORS = {
|
|
291
|
-
|
|
309
|
+
thinkingRowGap: `${CONV} [data-conversation-work-items] > * + *, .history-message.flex.flex-col > * + *:not([data-slot="collapsible-content"]):not([class~="group/assistant-row"])`,
|
|
310
|
+
answerRowGap: `${CONV} .space-y-4 > *, ${CONV} .flex.flex-col.gap-5 > *`,
|
|
292
311
|
listSpacing: `${CONV} :is(ul, ol)`,
|
|
293
312
|
listItemSpacing: `${CONV} :is(ul, ol) > li`,
|
|
294
313
|
quoteCodeSpacing: SEL_QUOTE,
|
|
@@ -307,10 +326,11 @@ const HL_SELECTORS = {
|
|
|
307
326
|
};
|
|
308
327
|
|
|
309
328
|
// 间距类项的边距黄条:受影响元素与边距方向(与 buildCss 里的规则选择器保持一致)
|
|
310
|
-
//
|
|
311
|
-
//
|
|
329
|
+
// 思考行间距落在行块的上内边距里,黄条画在元素内侧;回答间距排除两种边距实际
|
|
330
|
+
// 为零的元素:特殊块自身(走各自间距项)、紧跟特殊块的文本(其起始边距被清零)
|
|
312
331
|
const HL_MARGIN = {
|
|
313
|
-
|
|
332
|
+
thinkingRowGap: { sel: `${CONV} [data-conversation-work-items] > * + *`, top: true, insideTop: true },
|
|
333
|
+
answerRowGap: { sel: `${CONV} .space-y-4 > * + *:not(${SPECIAL}):not(${SPECIAL} + *)`, top: true },
|
|
314
334
|
listSpacing: { sel: SEL_LIST, top: true, bottom: true },
|
|
315
335
|
listItemSpacing: { sel: `${CONV} :is(ul, ol) > li + li`, top: true },
|
|
316
336
|
quoteCodeSpacing: { sel: SEL_QUOTE, top: true, bottom: true },
|
|
@@ -341,7 +361,7 @@ export function showStyleHighlight(key, value = null) {
|
|
|
341
361
|
// 伪元素画在边距所在的区域(元素边界外侧),高度跟随当前设置值;
|
|
342
362
|
// 调值提交时调用方会带新值重进,黄条随之变宽变窄
|
|
343
363
|
parts.push(`${margin.sel}{position:relative !important;}`);
|
|
344
|
-
if (margin.top) parts.push(`${margin.sel}::before{content:'' !important;position:absolute;left:0;right:0
|
|
364
|
+
if (margin.top) parts.push(`${margin.sel}::before{content:'' !important;position:absolute;left:0;right:0;${margin.insideTop ? 'top:0' : 'bottom:100%'};height:${v}px;background:${HL_AMBER};pointer-events:none;}`);
|
|
345
365
|
if (margin.bottom) parts.push(`${margin.sel}::after{content:'' !important;position:absolute;left:0;right:0;top:100%;height:${v}px;background:${HL_AMBER};pointer-events:none;}`);
|
|
346
366
|
}
|
|
347
367
|
hlEl.textContent = parts.join('');
|
|
@@ -409,7 +409,15 @@ function cardVeilCss() {
|
|
|
409
409
|
return `html,body{background:rgba(${rgb},${veil}) !important}`;
|
|
410
410
|
}
|
|
411
411
|
function applyWebviewTransparency() {
|
|
412
|
+
// 只处理插件卡片(zcode-sandbox 壳)的 webview:右侧预览等用户页面同样挂在
|
|
413
|
+
// <webview> 里,遮罩不能插进用户的页面。guest 未就绪(URL 为空)时先挂监听,
|
|
414
|
+
// dom-ready 拿到真实 URL 再判定
|
|
415
|
+
const guestUrl = (w) => {
|
|
416
|
+
try { return String(w.getURL ? w.getURL() : w.src || ''); } catch { return ''; }
|
|
417
|
+
};
|
|
418
|
+
const maybeCard = (w) => { const u = guestUrl(w); return u === '' || /^zcode-sandbox:\/\//i.test(u); };
|
|
412
419
|
const hook = (w, css) => {
|
|
420
|
+
if (!maybeCard(w)) return; // 明确是用户页面(http/file 等):不挂监听、不插样式
|
|
413
421
|
// on 每次现读、css 每轮扫描现算:扫描定时器只启动一次、长期存活,闭包固化
|
|
414
422
|
// 初值会让后建的 webview 拿到旧遮罩,还会每 2 秒把滑杆改后的新值覆盖回旧值
|
|
415
423
|
const on = document.documentElement.classList.contains('zcodepro-bg-on');
|
|
@@ -418,6 +426,7 @@ function applyWebviewTransparency() {
|
|
|
418
426
|
const entry = { el: w, key: null, css, handler: null };
|
|
419
427
|
entry.handler = () => {
|
|
420
428
|
if (!wvStyled.includes(entry)) return; // 已随关壁纸摘牌:别再插遮罩
|
|
429
|
+
if (!maybeCard(w)) return; // dom-ready 时是用户页面:不插(URL 空则只进空白文档,无影响)
|
|
421
430
|
const myCss = entry.css; // 插入期间遮罩可能又变:结果回来只认自己这份
|
|
422
431
|
try {
|
|
423
432
|
void w.insertCSS(myCss).then((k) => {
|
|
@@ -431,6 +440,7 @@ function applyWebviewTransparency() {
|
|
|
431
440
|
wvStyled.push(entry);
|
|
432
441
|
entry.handler();
|
|
433
442
|
} else if (on && rec && rec.css !== css) {
|
|
443
|
+
if (!maybeCard(w)) return; // 用户页面:不插遮罩
|
|
434
444
|
// 遮罩滑杆变了:撤旧 key 重插新值(insertCSS 的 key 对应一份 CSS 文本)
|
|
435
445
|
rec.css = css;
|
|
436
446
|
const oldKey = rec.key;
|
|
@@ -174,12 +174,12 @@ const ACTIVE_IDS_TTL_MS = 25_000;
|
|
|
174
174
|
const ACTIVE_IDS_TIMEOUT_MS = 6_000;
|
|
175
175
|
const activeIdsCache = new Map(); // base → { ids, doneAt, pending }
|
|
176
176
|
|
|
177
|
-
export function listActiveIdsCached(base) {
|
|
177
|
+
export function listActiveIdsCached(base, fresh = false) {
|
|
178
178
|
const key = String(base).replace(/[\\/]+$/, '');
|
|
179
179
|
const now = Date.now();
|
|
180
180
|
const hit = activeIdsCache.get(key);
|
|
181
181
|
if (hit && hit.pending) return hit.pending;
|
|
182
|
-
if (hit && now - hit.doneAt < ACTIVE_IDS_TTL_MS) return Promise.resolve(hit.ids);
|
|
182
|
+
if (!fresh && hit && now - hit.doneAt < ACTIVE_IDS_TTL_MS) return Promise.resolve(hit.ids);
|
|
183
183
|
const services = findServices();
|
|
184
184
|
const ts = services && services.zcodeTaskService;
|
|
185
185
|
if (!ts || typeof ts.listActiveTaskIds !== 'function') return Promise.resolve(null);
|
|
@@ -282,6 +282,7 @@ function toggleNavSafe(head) {
|
|
|
282
282
|
|
|
283
283
|
function scan() {
|
|
284
284
|
wsWithRows = new Set();
|
|
285
|
+
const changed = new Set(); // 本轮运行状态有变化的工作区(用于立即催权威扫描)
|
|
285
286
|
for (const el of document.querySelectorAll(TASK_SEL)) {
|
|
286
287
|
const key = el.getAttribute('data-task-item-key') || '';
|
|
287
288
|
const ws = workspaceOf(key);
|
|
@@ -291,11 +292,26 @@ function scan() {
|
|
|
291
292
|
let set = runningByWs.get(ws);
|
|
292
293
|
if (run) {
|
|
293
294
|
if (!set) { set = new Set(); runningByWs.set(ws, set); }
|
|
295
|
+
if (!set.has(key)) changed.add(ws);
|
|
294
296
|
set.add(key);
|
|
295
297
|
} else if (set) {
|
|
296
|
-
set.delete(key);
|
|
298
|
+
if (set.delete(key)) changed.add(ws);
|
|
297
299
|
}
|
|
298
300
|
}
|
|
301
|
+
// 行上的 loader 增减是应用自己给出的实时信号:立刻作废该工作区的活跃缓存
|
|
302
|
+
// 并催一次权威扫描。否则任务结束后项目/分区图标要等 30 秒周期 + 25 秒缓存
|
|
303
|
+
// 才熄灭(折叠项目更是要等 60 秒复核)。
|
|
304
|
+
if (changed.size) {
|
|
305
|
+
for (const ws of changed) activeIdsCache.delete(String(ws).replace(/[\\/]+$/, ''));
|
|
306
|
+
// 刚变空闲的工作区先从项目活跃集合里摘掉,图标当场熄灭,权威扫描回来再校正
|
|
307
|
+
for (const ws of changed) {
|
|
308
|
+
const set = runningByWs.get(ws);
|
|
309
|
+
if (set && set.size) continue;
|
|
310
|
+
const norm = (v) => String(v || '').replace(/[\\/]+$/, '');
|
|
311
|
+
for (const p of [...activeProjectPaths]) if (norm(p) === norm(ws)) activeProjectPaths.delete(p);
|
|
312
|
+
}
|
|
313
|
+
scheduleForceScan();
|
|
314
|
+
}
|
|
299
315
|
// 无条件复核探查调度:行从有到无(折叠/卸载)时 scan 本身看不到变化,
|
|
300
316
|
// 但 wsWithRows 已更新,正是需要(重新)排复核的时机
|
|
301
317
|
syncPeeks();
|
|
@@ -433,13 +449,36 @@ let activeProjectPaths = new Set();
|
|
|
433
449
|
let authActiveByWs = new Map();
|
|
434
450
|
// 周期复查:缓存到期就无条件重扫(不看当前值)——只在 true 时扫会有两个缺口:
|
|
435
451
|
// 空闲后新任务启动无人触发(折叠分区头不亮);任务结束但数据库完成状态尚未
|
|
436
|
-
//
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
452
|
+
// 写入的过渡窗口里旧值一直被沿用。有图标亮着时 10 秒一轮、空闲时 30 秒一轮:
|
|
453
|
+
// 任务刚结束要尽快熄灭,空闲期不必高频扫(扫描本身是内存级过滤)
|
|
454
|
+
function anySpinLit() {
|
|
455
|
+
return anyActiveCache.value === true || sectionActive.task || sectionActive.project
|
|
456
|
+
|| sectionActive.pinned || activeProjectPaths.size > 0;
|
|
457
|
+
}
|
|
458
|
+
let globalScanTimer = 0;
|
|
459
|
+
function scheduleGlobalScan() {
|
|
460
|
+
clearTimeout(globalScanTimer);
|
|
461
|
+
const wait = anySpinLit() ? 10_000 : 30_000;
|
|
462
|
+
globalScanTimer = setTimeout(() => {
|
|
463
|
+
if (!document.hidden && enabled && !anyActiveCache.busy) {
|
|
464
|
+
if (anySpinLit()) globalAnyActive(true);
|
|
465
|
+
else if (Date.now() - anyActiveCache.at >= 30_000) globalAnyActive();
|
|
466
|
+
}
|
|
467
|
+
scheduleGlobalScan();
|
|
468
|
+
}, wait);
|
|
469
|
+
}
|
|
470
|
+
scheduleGlobalScan();
|
|
471
|
+
// DOM 看到运行状态变化后的立即重扫:合并 800 毫秒内的多次变化,绕过缓存
|
|
472
|
+
let forceScanTimer = 0;
|
|
473
|
+
function scheduleForceScan() {
|
|
474
|
+
if (forceScanTimer) return;
|
|
475
|
+
forceScanTimer = setTimeout(() => {
|
|
476
|
+
forceScanTimer = 0;
|
|
477
|
+
if (!document.hidden && enabled) globalAnyActive(true);
|
|
478
|
+
}, 800);
|
|
479
|
+
}
|
|
480
|
+
function globalAnyActive(force) {
|
|
481
|
+
if (!force && anyActiveCache.value !== null && Date.now() - anyActiveCache.at < 30_000) return anyActiveCache.value;
|
|
443
482
|
if (anyActiveCache.busy) return anyActiveCache.value === true;
|
|
444
483
|
anyActiveCache.busy = true;
|
|
445
484
|
sectionActive.task = false;
|
|
@@ -489,9 +528,11 @@ function globalAnyActive() {
|
|
|
489
528
|
projectPaths.set(proj.name, names);
|
|
490
529
|
}
|
|
491
530
|
// 各工作区并行查(串行 await 在几十个工作区时要跑数秒):每区两种尾斜杠
|
|
492
|
-
// 各查一次,走共享缓存(subagent-icon
|
|
531
|
+
// 各查一次,走共享缓存(subagent-icon 复用同一份结果)。强制重扫时,
|
|
532
|
+
// 当前亮着图标的工作区不吃缓存——它们正是可能刚结束、要尽快熄灭的
|
|
533
|
+
const hot = new Set([...activeProjectPaths, ...authActiveByWs.keys()]);
|
|
493
534
|
const pairs = await Promise.all([...scanPaths].map(async (base) =>
|
|
494
|
-
[base, (await listActiveIdsCached(base)) || []]));
|
|
535
|
+
[base, (await listActiveIdsCached(base, force && hot.has(base))) || []]));
|
|
495
536
|
for (const [base, ids] of pairs) {
|
|
496
537
|
if (!ids.length) continue;
|
|
497
538
|
byKindByPath.set(base, ids);
|
|
@@ -507,7 +548,21 @@ function globalAnyActive() {
|
|
|
507
548
|
// 有动静的按真活跃;长期不动的才是 syncer 卡滞误报
|
|
508
549
|
const TERMINAL = new Set(['completed', 'error', 'interrupted']);
|
|
509
550
|
const recOf = (id) => (st && st.ok && st.available ? st.statuses[id] : undefined);
|
|
551
|
+
// 侧栏可见行就是应用自己的实时判定:行在场且没有 loader,说明这个会话
|
|
552
|
+
// 确实停了。刚结束时官方活跃集合可能还没清、DB 也还在终态宽限期里,
|
|
553
|
+
// 光靠 5 分钟窗口会让图标多转很久——可见行直接否决
|
|
554
|
+
const domIdle = new Set();
|
|
555
|
+
const domRunningIds = new Set();
|
|
556
|
+
for (const el of document.querySelectorAll(TASK_SEL)) {
|
|
557
|
+
const k = el.getAttribute('data-task-item-key') || '';
|
|
558
|
+
const id = k.slice(k.lastIndexOf(':') + 1);
|
|
559
|
+
if (!id) continue;
|
|
560
|
+
if (isRunningRow(el)) domRunningIds.add(id);
|
|
561
|
+
else domIdle.add(id);
|
|
562
|
+
}
|
|
563
|
+
for (const id of domRunningIds) domIdle.delete(id);
|
|
510
564
|
const live = (id) => {
|
|
565
|
+
if (domIdle.has(id)) return false;
|
|
511
566
|
const rec = recOf(id);
|
|
512
567
|
if (rec === undefined) return true;
|
|
513
568
|
if (!TERMINAL.has(rec.status)) return true;
|
|
@@ -518,6 +573,7 @@ function globalAnyActive() {
|
|
|
518
573
|
// 满足的(listActiveTaskIds 混入的非会话标识、索引尚未记录的新会话)
|
|
519
574
|
// 不进弹窗,否则会出现点了切不过去的幽灵行
|
|
520
575
|
const liveSession = (id) => {
|
|
576
|
+
if (domIdle.has(id)) return false;
|
|
521
577
|
const rec = recOf(id);
|
|
522
578
|
if (rec === undefined) return !!domRowKeyOf(id);
|
|
523
579
|
if (!TERMINAL.has(rec.status)) return true;
|
package/src/inject/index.js
CHANGED
|
@@ -28,6 +28,7 @@ import { startTheme } from './features/theme.js';
|
|
|
28
28
|
import { startTableCopy } from './features/table-copy.js';
|
|
29
29
|
import { startSessionLink } from './features/session-link.js';
|
|
30
30
|
import { startComposerProvider } from './features/composer-provider.js';
|
|
31
|
+
import { startComposerEditModel } from './features/composer-edit-model.js';
|
|
31
32
|
import { startPluginUpdateCheck } from './features/plugin-updates.js';
|
|
32
33
|
import { ensureStyle } from './ui.js';
|
|
33
34
|
|
|
@@ -95,6 +96,7 @@ import { ensureStyle } from './ui.js';
|
|
|
95
96
|
try { startTableCopy(); } catch { /* ignore */ }
|
|
96
97
|
try { startSessionLink(); } catch { /* ignore */ }
|
|
97
98
|
try { startComposerProvider(); } catch { /* ignore */ }
|
|
99
|
+
try { startComposerEditModel(); } catch { /* ignore */ }
|
|
98
100
|
try { startSettingsEntry(); } catch { /* ignore */ }
|
|
99
101
|
// 插件更新检查慢(可能 git pull),异步进行,不阻塞其他功能
|
|
100
102
|
try { void startPluginUpdateCheck(); } catch { /* ignore */ }
|
package/src/inject/ui.js
CHANGED
|
@@ -754,8 +754,8 @@ export function ensureStyle() {
|
|
|
754
754
|
color: var(--color-muted-foreground, #888);
|
|
755
755
|
}
|
|
756
756
|
/* 状态栏统计(status-bar.js):输入框下方右对齐的一行小字,每项带 lucide 小图标。
|
|
757
|
-
|
|
758
|
-
|
|
757
|
+
会话视图里绝对定位到滚动容器外的底部(避开滚动裁剪),新建会话视图在输入框后
|
|
758
|
+
按原样排;位置与间距由脚本控制 */
|
|
759
759
|
.zcodepro-statusbar {
|
|
760
760
|
display: flex;
|
|
761
761
|
justify-content: flex-end;
|