Skip to content

Commit b00543a

Browse files
Merge pull request #46 from microsoft/jamesdevdochistory
Template History implementation
2 parents c3f991d + f9b5cb5 commit b00543a

File tree

9 files changed

+407
-352
lines changed

9 files changed

+407
-352
lines changed

frontend/src/api/api.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,19 @@ export const historyRead = async (convId: string): Promise<ChatMessage[]> => {
116116
export const historyGenerate = async (
117117
options: ConversationRequest,
118118
abortSignal: AbortSignal,
119-
convId?: string
119+
convId?: string, chatType: ChatType = ChatType.Browse
120120
): Promise<Response> => {
121121
let body
122122
if (convId) {
123123
body = JSON.stringify({
124124
conversation_id: convId,
125-
messages: options.messages
125+
messages: options.messages,
126+
chat_type: chatType
126127
})
127128
} else {
128129
body = JSON.stringify({
129-
messages: options.messages
130+
messages: options.messages,
131+
chat_type: chatType
130132
})
131133
}
132134
const response = await fetch('/history/generate', {

frontend/src/components/ChatHistory/ChatHistoryPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export function ChatHistoryPanel(_props: ChatHistoryPanelProps) {
116116
marginRight: 'auto',
117117
paddingLeft: '20px'
118118
}}>
119-
Chat history
119+
Template history
120120
</Text>
121121
</StackItem>
122122
<Stack verticalAlign="start">
@@ -184,7 +184,7 @@ export function ChatHistoryPanel(_props: ChatHistoryPanelProps) {
184184
</StackItem>
185185
<StackItem>
186186
<Text style={{ alignSelf: 'center', fontWeight: '400', fontSize: 14 }}>
187-
<span>Chat history can't be saved at this time</span>
187+
<span>Template history can't be saved at this time</span>
188188
</Text>
189189
</StackItem>
190190
</Stack>

frontend/src/components/common/Button.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424

2525
.historyButtonRoot {
26-
width: 180px;
26+
width: 220px;
2727
border: 1px solid #d1d1d1;
2828
}
2929

frontend/src/pages/chat/Chat.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
flex-direction: column;
2222
align-items: center;
2323
background: radial-gradient(108.78% 108.78% at 50.02% 19.78%, #ffffff 57.29%, #eef6fe 100%);
24-
box-shadow:
24+
/* box-shadow:
2525
0px 2px 4px rgba(0, 0, 0, 0.14),
26-
0px 0px 2px rgba(0, 0, 0, 0.12);
26+
0px 0px 2px rgba(0, 0, 0, 0.12); */
2727
border-radius: 8px;
2828
overflow-y: auto;
2929
max-height: calc(100vh - 100px);

0 commit comments

Comments
 (0)