Files
nanobot/webui/browser/composer-action-fixture.tsx
T
chengyongru 4f7c4f0885 style(webui): refine composer surface and workspace hover (#6444)
* style(webui): refine the chat composer surface

Use a themed card background with a subtle edge and soft shadow. Keep focus stable without a darker frame while preserving Goal and drag rings. Align the startup composer surface and add composer-scoped browser coverage.

* style(webui): align workspace hover with access control

Keep the workspace trigger background clear on hover and use its existing text-color feedback, matching the adjacent access control. Preserve focus, disabled, and directory-picker behavior.
2026-10-25 15:16:08 +08:00

24 lines
1.2 KiB
TypeScript

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"
goalState={parameters.has("goal") ? { active: true, objective: "Keep the work in focus." } : undefined}
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>;
}