@detergent-software/atk 9.3.0-dev.7 → 9.3.0-dev.8
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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [9.3.0-dev.8](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/branchCompare?baseVersion=GTv9.3.0-dev.7&targetVersion=GTv9.3.0-dev.8) (2026-10-26)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **cli:** keep a text prompt's cursor in step with outside values (ATK-782) ([6e67491](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/6e67491703bc933e55fd8ef87219ce5cc2039722))
|
|
6
|
+
* **cli:** start a text prompt's cursor at the end of a new value (ATK-782) ([93c4ed1](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/93c4ed18bf7a9ed39b351611f799964ed20b1214))
|
|
7
|
+
|
|
1
8
|
## [9.3.0-dev.7](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/branchCompare?baseVersion=GTv9.3.0-dev.6&targetVersion=GTv9.3.0-dev.7) (2026-10-26)
|
|
2
9
|
|
|
3
10
|
### Bug Fixes
|
|
@@ -11,10 +11,16 @@ interface TextInputProps {
|
|
|
11
11
|
* ink-text-input calls Ink's `useInput` itself, so a key pressed as a new value or a new prompt
|
|
12
12
|
* first shows reached the previous render's handler: it went to the previous prompt's field,
|
|
13
13
|
* submitted it again, or dropped the character before it (ATK-781). React keeps one instance across
|
|
14
|
-
* prompts drawn at the same place (init's,
|
|
15
|
-
* previous prompt
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* prompts drawn at the same place (init's, register's, publish's), so the cursor would carry over
|
|
15
|
+
* from the previous prompt. It is stored with the value it was set for, and a value the input didn't
|
|
16
|
+
* type (a new prompt's pre-filled value, a value set from outside) puts it at the end of that value
|
|
17
|
+
* (ATK-782). The render does that before React commits, so a key pressed as the new value first
|
|
18
|
+
* shows has it, and a later return to the old value doesn't bring the old cursor back. A new prompt
|
|
19
|
+
* pre-filled with exactly the text the cursor was set for keeps that cursor: only a prompt's
|
|
20
|
+
* identity could tell them apart.
|
|
21
|
+
* ink-text-input clamped the offset in an effect instead, which ran after a key pressed as the new
|
|
22
|
+
* prompt first showed, with that prompt's first value, and so put the cursor back to 0: the next
|
|
23
|
+
* characters went in front of the first.
|
|
18
24
|
*
|
|
19
25
|
* Ink emits every key of one stdin chunk in a row, and React renders their updates only after the
|
|
20
26
|
* last, so each key edits the value and cursor the previous key left (`edit`), not the render's;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":"AA4BA,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":"AA4BA,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,KAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,cAAc,+BAmD5F"}
|
|
@@ -32,10 +32,16 @@ import { useLatestInput } from '../hooks/useLatestInput.js';
|
|
|
32
32
|
* ink-text-input calls Ink's `useInput` itself, so a key pressed as a new value or a new prompt
|
|
33
33
|
* first shows reached the previous render's handler: it went to the previous prompt's field,
|
|
34
34
|
* submitted it again, or dropped the character before it (ATK-781). React keeps one instance across
|
|
35
|
-
* prompts drawn at the same place (init's,
|
|
36
|
-
* previous prompt
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* prompts drawn at the same place (init's, register's, publish's), so the cursor would carry over
|
|
36
|
+
* from the previous prompt. It is stored with the value it was set for, and a value the input didn't
|
|
37
|
+
* type (a new prompt's pre-filled value, a value set from outside) puts it at the end of that value
|
|
38
|
+
* (ATK-782). The render does that before React commits, so a key pressed as the new value first
|
|
39
|
+
* shows has it, and a later return to the old value doesn't bring the old cursor back. A new prompt
|
|
40
|
+
* pre-filled with exactly the text the cursor was set for keeps that cursor: only a prompt's
|
|
41
|
+
* identity could tell them apart.
|
|
42
|
+
* ink-text-input clamped the offset in an effect instead, which ran after a key pressed as the new
|
|
43
|
+
* prompt first showed, with that prompt's first value, and so put the cursor back to 0: the next
|
|
44
|
+
* characters went in front of the first.
|
|
39
45
|
*
|
|
40
46
|
* Ink emits every key of one stdin chunk in a row, and React renders their updates only after the
|
|
41
47
|
* last, so each key edits the value and cursor the previous key left (`edit`), not the render's;
|
|
@@ -43,8 +49,10 @@ import { useLatestInput } from '../hooks/useLatestInput.js';
|
|
|
43
49
|
* assumes the parent takes each `onChange` value as sent, as every caller does.
|
|
44
50
|
*/
|
|
45
51
|
export default function TextInput({ focus = true, onChange, onSubmit, value }) {
|
|
46
|
-
const [
|
|
47
|
-
|
|
52
|
+
const [cursor, setCursor] = useState({ for: value, offset: value.length });
|
|
53
|
+
if (cursor.for !== value)
|
|
54
|
+
setCursor({ for: value, offset: value.length });
|
|
55
|
+
const cursorOffset = cursor.for === value ? cursor.offset : value.length;
|
|
48
56
|
const edit = useRef({ offset: cursorOffset, value });
|
|
49
57
|
edit.current = { offset: cursorOffset, value };
|
|
50
58
|
useLatestInput((input, key) => {
|
|
@@ -75,7 +83,7 @@ export default function TextInput({ focus = true, onChange, onSubmit, value }) {
|
|
|
75
83
|
}
|
|
76
84
|
nextOffset = Math.max(0, Math.min(nextOffset, nextValue.length));
|
|
77
85
|
edit.current = { offset: nextOffset, value: nextValue };
|
|
78
|
-
|
|
86
|
+
setCursor({ for: nextValue, offset: nextOffset });
|
|
79
87
|
if (nextValue !== current)
|
|
80
88
|
onChange(nextValue);
|
|
81
89
|
}, { isActive: focus });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAS5D
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../src/components/TextInput.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAS5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAkB;IAC3F,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GA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