feat(webui): refine composer action feedback (#6419)
* feat(webui): refine composer action feedback * fix(webui): preserve composer hit targets and ring previews
This commit is contained in:
1 parent
03e9b5430b
commit
6d4add200b
20 files changed
+351
-48
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { useState } from "react";
|
||||
import { ThreadComposer } from "@/components/thread/ThreadComposer";
|
||||
|
||||
export function ComposerActionFixture({ parameters }: { parameters: URLSearchParams }) {
|
||||
const [running, setRunning] = useState(false);
|
||||
const [stopRequested, setStopRequested] = useState(false);
|
||||
return <main className="mx-auto w-full max-w-5xl px-4 pt-24">
|
||||
<ThreadComposer
|
||||
variant={parameters.get("composerVariant") === "thread" ? "thread" : "hero"}
|
||||
modelLabel="Preview"
|
||||
isStreaming={running}
|
||||
onTranscribeAudio={async () => "Voice draft"}
|
||||
onSend={() => { setStopRequested(false); setRunning(true); }}
|
||||
onStop={() => setStopRequested(true)}
|
||||
/>
|
||||
<div className="mt-6 flex gap-4 text-sm">
|
||||
<output aria-label="Execution status">{stopRequested ? "Stop requested" : running ? "Working" : "Idle"}</output>
|
||||
<button onClick={() => { setRunning(false); setStopRequested(false); }}>Finish response</button>
|
||||
<button onClick={() => document.documentElement.classList.toggle("dark")}>Toggle theme</button>
|
||||
</div>
|
||||
</main>;
|
||||
}
|
||||
Reference in new issue
Block a user