inline-chat-kit 0.54.1 → 0.54.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 +27 -0
- package/dist/inline-chat-kit.js +12 -4
- package/dist/inline-chat-kit.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,33 @@ The versions before 1.0 follow the pre-release convention: **a breaking change
|
|
|
8
8
|
or new public API bumps the minor**, and the patch is for fixes. Anything that would break an
|
|
9
9
|
existing install is called out under **Breaking**, with what to do about it.
|
|
10
10
|
|
|
11
|
+
## 0.54.2 — 2026-09-12
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **The sent message leapt off the top of the view when an answer settled.**
|
|
16
|
+
Measured on the demo at 1100×700, at the frame the turn count went from one
|
|
17
|
+
to two: `scrollTop` 0 → 175, in a single frame, and the message that had
|
|
18
|
+
just been sent went from 100px down the view to −75.
|
|
19
|
+
|
|
20
|
+
It was not the scroll logic. `Conversation` made **exactly one** correction
|
|
21
|
+
in the whole session — a smooth one, arriving after the jump had already
|
|
22
|
+
happened. The jump was `focus()`: when an answer settles the next turn is
|
|
23
|
+
appended, its composer mounts at the bottom of the conversation and focuses
|
|
24
|
+
itself, and focusing an element brings it into view. Instantly, and without
|
|
25
|
+
asking anyone.
|
|
26
|
+
|
|
27
|
+
`preventScroll` now. Where the view goes belongs to `Conversation`, which
|
|
28
|
+
knows about anchors, tails, and whether the reader has scrolled away; focus
|
|
29
|
+
is about the keyboard. The same moment is now eight frames with a largest
|
|
30
|
+
step of 48px.
|
|
31
|
+
|
|
32
|
+
Three traces to find, because every instrument pointed at the scroll logic
|
|
33
|
+
and the scroll logic was innocent. The first two also measured the wrong
|
|
34
|
+
element — during an answer the last editable belongs to the turn being
|
|
35
|
+
written, and afterwards to a different turn entirely, so the trace read a
|
|
36
|
+
change of subject as a movement.
|
|
37
|
+
|
|
11
38
|
## 0.54.1 — 2026-09-12
|
|
12
39
|
|
|
13
40
|
### Fixed
|
package/dist/inline-chat-kit.js
CHANGED
|
@@ -853,7 +853,7 @@ var Ue = {
|
|
|
853
853
|
Le,
|
|
854
854
|
et
|
|
855
855
|
]), o(() => {
|
|
856
|
-
(e === "idle" || e === "typing") && F.current?.focus();
|
|
856
|
+
(e === "idle" || e === "typing") && F.current?.focus({ preventScroll: !0 });
|
|
857
857
|
}, [e]), o(() => {
|
|
858
858
|
let e = F.current;
|
|
859
859
|
e && (ve.current = e.scrollHeight || 17);
|
|
@@ -4996,12 +4996,20 @@ var Xr = {
|
|
|
4996
4996
|
let e = S.current, n = C.current;
|
|
4997
4997
|
if (!e || !n || typeof ResizeObserver > "u") return;
|
|
4998
4998
|
let r = () => {
|
|
4999
|
-
let
|
|
4999
|
+
let n = M();
|
|
5000
5000
|
if (N.current) {
|
|
5001
|
-
if (performance.now() < N.current && Math.abs(e.scrollTop -
|
|
5001
|
+
if (performance.now() < N.current && Math.abs(e.scrollTop - n) > 1) return;
|
|
5002
5002
|
N.current = 0;
|
|
5003
5003
|
}
|
|
5004
|
-
e.scrollTop
|
|
5004
|
+
let r = n - e.scrollTop;
|
|
5005
|
+
if (O.current && !t && Math.abs(r) > s && !K()) {
|
|
5006
|
+
N.current = performance.now() + Qr, e.scrollTo({
|
|
5007
|
+
top: n,
|
|
5008
|
+
behavior: "smooth"
|
|
5009
|
+
});
|
|
5010
|
+
return;
|
|
5011
|
+
}
|
|
5012
|
+
e.scrollTop = n;
|
|
5005
5013
|
}, i = t != null && t !== P.current;
|
|
5006
5014
|
t && (P.current = t), i && !K() && Math.abs(e.scrollTop - M()) > s ? (N.current = performance.now() + Qr, e.scrollTo({
|
|
5007
5015
|
top: M(),
|