Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ enum CBServerEventId {
cb_database_output_log_updated,
cb_ai_chat_message_chunk @since(version: "25.1.1")
cb_ai_chat_message_error @since(version: "25.1.1")
cb_ai_chat_message @since(version: "25.3.5")

"Transaction count updated"
cb_transaction_count @since(version: "24.3.3"),
Expand Down Expand Up @@ -290,6 +291,18 @@ type WSAIChatMessageErrorEvent implements CBServerEvent @since(version: "25.1.1"
errorMessage: String
}


type WSAIChatMessageEvent implements CBServerEvent @since(version: "25.3.5") {
id: CBServerEventId!
topicId: CBEventTopic
conversationId: ID!
messageId: ID!
role: String!
content: String!
displayMessage: String!
time: String!
}

enum WSServerNotificationEventType {
INFO
ERROR
Expand Down
8 changes: 8 additions & 0 deletions webapp/packages/core-blocks/src/Alert.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@
font-weight: 500;
margin: 0;
}

.alert.error {
background-color: rgba(255, 77, 79, 0.15);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can use some of the predefined colors in css variables?


.title {
color: var(--theme-error);
}
}
11 changes: 7 additions & 4 deletions webapp/packages/core-blocks/src/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ import classes from './Alert.module.css';

interface Props {
title?: string;
variant?: 'info' | 'error';
className?: string;
}

export const Alert = observer<PropsWithChildren<Props>>(function Alert({ title, className, children }) {
export const Alert = observer<PropsWithChildren<Props>>(function Alert({ title, variant = 'info', className, children }) {
const translate = useTranslate();
const styles = useS(classes);

const icon = variant === 'info' ? '/icons/preload/info_icon_sm.svg' : '/icons/preload/error_icon_sm.svg';

return (
<div className={s(styles, { alert: true }, className)} role="alert">
<IconOrImage icon="/icons/preload/info_icon_sm.svg" className="tw:mt-0.5" />
<div className={s(styles, { alert: true, error: variant === 'error' }, className)} role="alert">
<IconOrImage icon={icon} className="tw:mt-0.5" />
<div className={s(styles, { body: true })}>
<h3 className={s(styles, { title: true })}>{title ?? translate('ui_information')}</h3>
<h3 className={s(styles, { title: true })}>{title ?? translate(variant === 'info' ? 'ui_information' : 'ui_error')}</h3>
{children}
</div>
</div>
Expand Down
Loading