dsh-neotui 0.0.28 → 0.0.30
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/package.json +1 -1
- package/src/views.js +6 -3
package/package.json
CHANGED
package/src/views.js
CHANGED
|
@@ -1071,7 +1071,7 @@ export class ChatView extends Widget {
|
|
|
1071
1071
|
mark(realIdx);
|
|
1072
1072
|
for (const ln of md.slice(1)) { lines.push([{ t: " " + " ".repeat(pw) }, ...ln]); mark(realIdx); }
|
|
1073
1073
|
}
|
|
1074
|
-
if (!isExp && text.length > 2000) lines.push([{ t: " …", fg: K.FAINT }]);
|
|
1074
|
+
if (!isExp && text.length > 2000) { lines.push([{ t: " …", fg: K.FAINT }]); mark(realIdx); }
|
|
1075
1075
|
if (node.images) {
|
|
1076
1076
|
for (let ii = 0; ii < node.images.length; ii++) {
|
|
1077
1077
|
const img = node.images[ii];
|
|
@@ -1170,7 +1170,7 @@ export class ChatView extends Widget {
|
|
|
1170
1170
|
mark(realIdx, bi);
|
|
1171
1171
|
const rl = truncateText(b.result, 4000).split("\n");
|
|
1172
1172
|
for (const r of rl.slice(0, 30)) { lines.push([{ t: " " + truncate(r, w - 4), fg: K.DIM }]); mark(realIdx, bi); }
|
|
1173
|
-
if (rl.length > 30) lines.push([{ t: ` …共 ${rl.length} 行`, fg: K.FAINT }]);
|
|
1173
|
+
if (rl.length > 30) { lines.push([{ t: ` …共 ${rl.length} 行`, fg: K.FAINT }]); mark(realIdx, bi); }
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
sep();
|
|
@@ -1257,6 +1257,9 @@ export class ChatView extends Widget {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
this.lines = lines;
|
|
1259
1259
|
this.lineMap = lineMap;
|
|
1260
|
+
if (process.env.DSH_TUI_DEBUG_CLICK && lineMap.length !== lines.length) {
|
|
1261
|
+
this.#clickLog(`INVARIANT BROKEN: lines=${lines.length} lineMap=${lineMap.length}`);
|
|
1262
|
+
}
|
|
1260
1263
|
this.view.setLines(lines);
|
|
1261
1264
|
}
|
|
1262
1265
|
|
|
@@ -1365,7 +1368,7 @@ export class ChatView extends Widget {
|
|
|
1365
1368
|
this.pressCtx = this.pressInfo ? this.#anchorCtx(this.pressInfo, this.pressY) : null;
|
|
1366
1369
|
if (process.env.DSH_TUI_DEBUG_CLICK) {
|
|
1367
1370
|
const t = this.lines[this.pressY]?.map((g) => g.t).join("") ?? "";
|
|
1368
|
-
this.#clickLog(`press screenY=${ev.y} screenX=${ev.x} lineIdx=${this.pressY} mark=${JSON.stringify(this.pressInfo)} text="${t.slice(0, 40)}" scrollY=${this.view.scrollY} viewY=${this.view.y} viewH=${this.view.h}`);
|
|
1371
|
+
this.#clickLog(`press screenY=${ev.y} screenX=${ev.x} lineIdx=${this.pressY} mark=${JSON.stringify(this.pressInfo)} text="${t.slice(0, 40)}" scrollY=${this.view.scrollY} viewY=${this.view.y} viewH=${this.view.h} assumedH=${this.app.screen?.h} assumedW=${this.app.screen?.w} ttyRows=${process.stdout.rows} ttyCols=${process.stdout.columns} inputY=${this.input.y} inputH=${this.input.h} todoH=${this.todoHeight()} footerH=${this.app.footerHeight?.() ?? "?"}`);
|
|
1369
1372
|
}
|
|
1370
1373
|
return true;
|
|
1371
1374
|
}
|