diff --git a/packages/paste-core/components/ai-chat-log/stories/scrollableSidePanel.stories.tsx b/packages/paste-core/components/ai-chat-log/stories/scrollableSidePanel.stories.tsx
index 6ba5d87e88..7bb4d0f742 100644
--- a/packages/paste-core/components/ai-chat-log/stories/scrollableSidePanel.stories.tsx
+++ b/packages/paste-core/components/ai-chat-log/stories/scrollableSidePanel.stories.tsx
@@ -32,7 +32,6 @@ import {
SidePanelHeader,
SidePanelPushContentWrapper,
} from "@twilio-paste/side-panel";
-
import * as React from "react";
import {
@@ -169,7 +168,7 @@ export const SidePanelScroll: StoryFn = () => {
Good Bot
This is an indicator that the message was filtered (blocked) by Twilio or by the carrier. This may be done
- by Twilio for violating Twilio's{" "}
+ by Twilio for violating Twilio&aposs{" "}
Messaging Policy
{" "}
@@ -203,7 +202,7 @@ export const SidePanelScroll: StoryFn = () => {
setMounted(true);
}, []);
- const scrollToChatEnd = () => {
+ const scrollToChatEnd = (): void => {
const scrollPosition: any = scrollerRef.current;
const scrollHeight: any = loggerRef.current;
scrollPosition?.scrollTo({ top: scrollHeight.scrollHeight, behavior: "smooth" });
@@ -221,12 +220,12 @@ export const SidePanelScroll: StoryFn = () => {
});
};
- const onAnimationEnd = () => {
+ const onAnimationEnd = (): void => {
setIsAnimating(false);
scrollToChatEnd();
};
- const onAnimationStart = () => {
+ const onAnimationStart = (): void => {
setIsAnimating(true);
};
@@ -239,8 +238,8 @@ export const SidePanelScroll: StoryFn = () => {
}, [isAnimating]);
// eslint-disable-next-line storybook/prefer-pascal-case
- const createNewMessage = (message: any, forceBot?: boolean): Omit => {
- const messageDirection = forceBot ? "bot" : getRandomInt(2) === 1 ? "user" : "bot";
+ const createNewMessage = (newMessage: any, forceBot?: boolean): Omit => {
+ const messageDirection = getRandomInt(2) === 1 && !forceBot ? "user" : "bot";
return {
variant: messageDirection,
@@ -248,11 +247,11 @@ export const SidePanelScroll: StoryFn = () => {
messageDirection === "user" ? (
Gibby Radki
- {message}
+ {newMessage}
) : (
-
+
),
};
@@ -263,7 +262,7 @@ export const SidePanelScroll: StoryFn = () => {
push(createNewMessage(message));
};
- const pushLargeBotMessage = () => {
+ const pushLargeBotMessage = (): void => {
push(
createNewMessage(
<>
diff --git a/packages/paste-core/components/ai-chat-log/type-docs.json b/packages/paste-core/components/ai-chat-log/type-docs.json
index 31ec9b4886..972b106312 100644
--- a/packages/paste-core/components/ai-chat-log/type-docs.json
+++ b/packages/paste-core/components/ai-chat-log/type-docs.json
@@ -3695,10 +3695,11 @@
"externalProp": true
},
"onAnimationEnd": {
- "type": "AnimationEventHandler",
- "defaultValue": null,
+ "type": "() => void",
+ "defaultValue": false,
"required": false,
- "externalProp": true
+ "externalProp": false,
+ "description": "A callback when the animation is complete"
},
"onAnimationEndCapture": {
"type": "AnimationEventHandler",
@@ -3719,10 +3720,11 @@
"externalProp": true
},
"onAnimationStart": {
- "type": "AnimationEventHandler",
- "defaultValue": null,
+ "type": "() => void",
+ "defaultValue": false,
"required": false,
- "externalProp": true
+ "externalProp": false,
+ "description": "A callback when the animation is started"
},
"onAnimationStartCapture": {
"type": "AnimationEventHandler",