mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-19 18:35:18 +02:00
Add chat counter back to playground app
This commit is contained in:
parent
4d4231180f
commit
9994720889
1 changed files with 5 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ export function App({
|
||||||
mcpServerUrls: Array<z.infer<typeof MCPServer>>;
|
mcpServerUrls: Array<z.infer<typeof MCPServer>>;
|
||||||
toolWebhookUrl: string;
|
toolWebhookUrl: string;
|
||||||
}) {
|
}) {
|
||||||
|
const [counter, setCounter] = useState<number>(0);
|
||||||
const [testProfile, setTestProfile] = useState<WithStringId<z.infer<typeof TestProfile>> | null>(null);
|
const [testProfile, setTestProfile] = useState<WithStringId<z.infer<typeof TestProfile>> | null>(null);
|
||||||
const [systemMessage, setSystemMessage] = useState<string>(defaultSystemMessage);
|
const [systemMessage, setSystemMessage] = useState<string>(defaultSystemMessage);
|
||||||
const [chat, setChat] = useState<z.infer<typeof PlaygroundChat>>({
|
const [chat, setChat] = useState<z.infer<typeof PlaygroundChat>>({
|
||||||
|
|
@ -45,13 +46,16 @@ export function App({
|
||||||
|
|
||||||
function handleSystemMessageChange(message: string) {
|
function handleSystemMessageChange(message: string) {
|
||||||
setSystemMessage(message);
|
setSystemMessage(message);
|
||||||
|
setCounter(counter + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleTestProfileChange(profile: WithStringId<z.infer<typeof TestProfile>> | null) {
|
function handleTestProfileChange(profile: WithStringId<z.infer<typeof TestProfile>> | null) {
|
||||||
setTestProfile(profile);
|
setTestProfile(profile);
|
||||||
|
setCounter(counter + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleNewChatButtonClick() {
|
function handleNewChatButtonClick() {
|
||||||
|
setCounter(counter + 1);
|
||||||
setChat({
|
setChat({
|
||||||
projectId,
|
projectId,
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
|
|
@ -139,6 +143,7 @@ export function App({
|
||||||
/>
|
/>
|
||||||
<div className="h-full overflow-auto px-4 py-4">
|
<div className="h-full overflow-auto px-4 py-4">
|
||||||
<Chat
|
<Chat
|
||||||
|
key={`chat-${counter}`}
|
||||||
chat={chat}
|
chat={chat}
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
workflow={workflow}
|
workflow={workflow}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue