Skip to content

Commit 68354d9

Browse files
authored
feat: extend tabdata interface to include support for welcome screen (#411)
* feat: extend tabdata interface to include support for welcome screen * feat: include tabHeaderDetails in the tab interface * chore: removed old tabData title and grouped PromptInput data * feat: added id to chatActions * feat: adding welcome counter update message in the ui contract * feat: adding title to tabdata
1 parent 674c026 commit 68354d9

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

chat-client-ui-types/src/uiContracts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const AUTH_FOLLOW_UP_CLICKED = 'authFollowUpClicked'
2424
export const GENERIC_COMMAND = 'genericCommand'
2525
export const CHAT_OPTIONS = 'chatOptions'
2626
export const DISCLAIMER_ACKNOWLEDGED = 'disclaimerAcknowledged'
27+
export const WELCOME_COUNTER_UPDATE_MESSAGE = 'welcomeCounterUpdateMessage'
2728

2829
export type UiMessageCommand =
2930
| typeof SEND_TO_PROMPT
@@ -34,6 +35,7 @@ export type UiMessageCommand =
3435
| typeof CHAT_OPTIONS
3536
| typeof COPY_TO_CLIPBOARD
3637
| typeof DISCLAIMER_ACKNOWLEDGED
38+
| typeof WELCOME_COUNTER_UPDATE_MESSAGE
3739

3840
export interface UiMessage {
3941
command: UiMessageCommand

types/chat.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export interface ChatItemAction {
3030
disabled?: boolean
3131
description?: string
3232
type?: string
33+
status?: string
34+
id?: string
3335
}
3436

3537
export interface SourceLink {
@@ -102,6 +104,8 @@ export interface FileList {
102104
export interface ChatMessage {
103105
type?: 'answer' | 'prompt' | 'system-prompt' // will default to 'answer'
104106
body?: string
107+
buttons: ChatItemAction[]
108+
icon?: IconType
105109
messageId?: string
106110
canBeVoted?: boolean // requires messageId to be filled to show vote thumbs
107111
relatedContent?: {
@@ -158,10 +162,24 @@ export interface QuickActions {
158162
}
159163

160164
export interface TabData {
161-
placeholderText?: string
165+
title?: string
166+
tabHeader?: TabHeader
167+
promptInput?: PromptInput
168+
compactMode?: boolean
162169
messages: ChatMessage[]
163170
}
164171

172+
export interface TabHeader {
173+
icon?: IconType
174+
title?: string
175+
description?: string
176+
}
177+
178+
export interface PromptInput {
179+
placeholderText?: string
180+
label?: string
181+
}
182+
165183
/**
166184
* Registration options regarding chat data
167185
* Currently contains the available quick actions provided by a server

0 commit comments

Comments
 (0)