dsh-neotui 0.0.29 → 0.0.31

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-neotui",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "Neo-TUI: mouse-driven terminal UI client for DeepSeek Harness (B-tier per dsh-tui-design.md)",
5
5
  "type": "module",
6
6
  "bin": { "dsh-neotui": "bin/dsh-tui.js" },
package/src/md.js CHANGED
@@ -246,7 +246,10 @@ export function renderMd(text, width) {
246
246
  const codeLines = codeBuf.length === 0 ? [""] : codeBuf;
247
247
  let maxLen = Math.max(...codeLines.map((l) => strWidth(l)), 1);
248
248
  const barW = Math.min(hw, maxLen + 2);
249
- lines.push([SEG("┌" + "─".repeat(Math.max(1, barW - 2)) + "┐", { fg: C.hr }), SEG(" " + lang, { fg: C.dim })]);
249
+ // a fence WITHOUT a language gets no label the bare "text" tag next
250
+ // to the box corner just looks like a rendering artifact
251
+ const tag = lang && lang !== "text" ? " " + lang : "";
252
+ lines.push([SEG("┌" + "─".repeat(Math.max(1, barW - 2)) + "┐" + tag, { fg: C.hr })]);
250
253
  for (const cl of codeLines) {
251
254
  const hls = highlightLine(cl, lang);
252
255
  lines.push([SEG("│ ", { fg: C.hr }), ...wrapSegs(hls, hw, { pad: true }).map((l) => l).flatMap((l, k) => (k === 0 ? l : [SEG(" ", { fg: C.hr }), ...l])), SEG(" │", { fg: C.hr })]);
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