@hheei/pi-ext-ui 0.8.0 → 0.8.1

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.
@@ -16,13 +16,26 @@ export function memberParts(member) {
16
16
  function isBlankRow(row) {
17
17
  return row === undefined || visibleWidth(row) === 0;
18
18
  }
19
+ /**
20
+ * Whether this tail's own rows can still change. A tool earns the floor until its final result
21
+ * arrives, and a thinking run while its text is streaming into a visible body; a settled tool, a
22
+ * hidden thinking preview, and a notice have drawn their last frame, so padding them adds no
23
+ * stability and only empty rows.
24
+ */
25
+ function stillGrowing(member) {
26
+ if (member.kind === "tool")
27
+ return member.completed !== true;
28
+ return member.kind === "thinking" && member.thinkingHidden !== true;
29
+ }
19
30
  export class TailUnit {
20
31
  #parts;
21
32
  #background;
33
+ #floor;
22
34
  #offsets = [];
23
35
  constructor(member, background) {
24
36
  this.#parts = memberParts(member);
25
37
  this.#background = background;
38
+ this.#floor = stillGrowing(member);
26
39
  }
27
40
  render(width) {
28
41
  const offsets = [];
@@ -52,7 +65,7 @@ export class TailUnit {
52
65
  const shift = out.length - rows.length;
53
66
  this.#offsets = offsets.map((offset) => ({ ...offset, top: offset.top + shift }));
54
67
  // Surface padding counts toward the minimum; added rows stay outside surfaces and hit areas.
55
- const minimum = this.#background() ? 4 : 2;
68
+ const minimum = this.#floor ? (this.#background() ? 4 : 2) : 0;
56
69
  if (contentRows > 0) {
57
70
  for (let row = contentRows; row < minimum; row++)
58
71
  out.push("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hheei/pi-ext-ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Collapsible tool rendering frame and tool renderer pilot for Pi.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",