Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty input message on empty streaming #2729

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/frontend/src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,8 @@ export const TITLE_ERROR_UPDATING_COMPONENT =

export const EMPTY_INPUT_SEND_MESSAGE = "No input message provided.";

export const EMPTY_OUTPUT_SEND_MESSAGE = "Message empty.";

export const TABS_ORDER = [
"run curl",
"python api",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import Robot from "../../../../../assets/robot.png";
import CodeTabsComponent from "../../../../../components/codeTabsComponent";
import IconComponent from "../../../../../components/genericIconComponent";
import SanitizedHTMLWrapper from "../../../../../components/sanitizedHTMLWrapper";
import { EMPTY_INPUT_SEND_MESSAGE } from "../../../../../constants/constants";
import {
EMPTY_INPUT_SEND_MESSAGE,
EMPTY_OUTPUT_SEND_MESSAGE,
} from "../../../../../constants/constants";
import useAlertStore from "../../../../../stores/alertStore";
import useFlowStore from "../../../../../stores/flowStore";
import { chatMessagePropsType } from "../../../../../types/components";
Expand Down Expand Up @@ -251,8 +254,8 @@ export default function ChatMessage({
},
}}
>
{chatMessage === ""
? EMPTY_INPUT_SEND_MESSAGE
{chatMessage === "" && !chat.stream_url
? EMPTY_OUTPUT_SEND_MESSAGE
: chatMessage}
</Markdown>
),
Expand Down Expand Up @@ -286,10 +289,8 @@ export default function ChatMessage({
className={cn(
"prose word-break-break-word dark:prose-invert",
chatMessage !== ""
? EMPTY_INPUT_SEND_MESSAGE
: chatMessage
? "text-primary"
: "text-chat-trigger-disabled",
? "text-primary"
: "text-chat-trigger-disabled",
)}
>
{promptOpen
Expand Down
Loading