@nanhara/hara 0.112.1 → 0.112.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/CHANGELOG.md +10 -0
- package/dist/tui/run.js +29 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to `@nanhara/hara`.
|
|
|
5
5
|
> Versioning (pre-1.0, SemVer-style): the **minor** (middle) number bumps for a **new feature**; the
|
|
6
6
|
> **patch** (last) number bumps for **optimizations/fixes of existing features**.
|
|
7
7
|
|
|
8
|
+
## 0.112.2 — moving/resizing the window no longer garbles the UI
|
|
9
|
+
|
|
10
|
+
- **Terminal resize no longer stacks the status row + input box into a garble.** ink 6.8's resize
|
|
11
|
+
handler only clears the screen when the terminal gets *narrower*; on a *widen* (or a resize it doesn't
|
|
12
|
+
classify as narrowing) it just re-renders, so the old frame — reflowed at the new width — is never
|
|
13
|
+
erased, and the ~125ms spinner tick stacks a fresh copy each time (the "I moved the window and the UI
|
|
14
|
+
filled up with repeated `waiting for the model…` lines"). hara now hooks the resize event and, on ANY
|
|
15
|
+
resize, resets ink's tracked output (debounced across a drag's burst of events) so the next render
|
|
16
|
+
starts clean and subsequent ticks erase correctly. Not "just the terminal" — a real repaint fix.
|
|
17
|
+
|
|
8
18
|
## 0.112.1 — the background-job indicator is now LIVE (even at idle)
|
|
9
19
|
|
|
10
20
|
- **`⚙ N bg running` updates in real time — including when hara is idle.** In 0.112.0 the indicator only
|
package/dist/tui/run.js
CHANGED
|
@@ -6,7 +6,35 @@ import { createElement } from "react";
|
|
|
6
6
|
import { App } from "./App.js";
|
|
7
7
|
export async function runTui(props) {
|
|
8
8
|
const instance = render(createElement(App, props));
|
|
9
|
-
|
|
9
|
+
// Resize repaint fix. ink 6.8's own resize handler only clears the screen when the terminal gets
|
|
10
|
+
// NARROWER; on a WIDEN (or a resize it doesn't classify as narrowing) it just re-renders, so the old
|
|
11
|
+
// frame — reflowed at the new width — is never erased, and the ~125ms spinner tick stacks a fresh copy
|
|
12
|
+
// each time (the "moved the window and the UI stacked up" garble). We complement it: on ANY resize,
|
|
13
|
+
// clear ink's tracked output so the next render starts clean. Debounced by a microtask so a burst of
|
|
14
|
+
// resize events during a window drag collapses to one clear.
|
|
15
|
+
const out = process.stdout;
|
|
16
|
+
let pending = false;
|
|
17
|
+
const onResize = () => {
|
|
18
|
+
if (pending)
|
|
19
|
+
return;
|
|
20
|
+
pending = true;
|
|
21
|
+
queueMicrotask(() => {
|
|
22
|
+
pending = false;
|
|
23
|
+
try {
|
|
24
|
+
instance.clear();
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
/* best-effort — never let a repaint fix crash the session */
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
out.on("resize", onResize);
|
|
32
|
+
try {
|
|
33
|
+
await instance.waitUntilExit();
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
out.off("resize", onResize);
|
|
37
|
+
}
|
|
10
38
|
}
|
|
11
39
|
// A tiny ink yes/no prompt for pre-TUI confirms (e.g. the first-run "create AGENTS.md?" offer).
|
|
12
40
|
// MUST be ink, NOT readline: a readline question before the main TUI leaves stdin in a state ink
|