fix: make footer sole workflow run control

This commit is contained in:
lda
2026-07-12 15:48:17 +07:00 Verified
parent ed2ee043bd
commit 1359a7f8e3
8 changed files with 9 additions and 59 deletions
@@ -99,19 +99,10 @@ describe("AssistantOperatorThread", () => {
expect(requestRevision).toHaveBeenCalledOnce();
});
it("renders a chat-owned run action", async () => {
const user = userEvent.setup();
const run = vi.fn();
render(
<AssistantOperatorThread
mode="dock"
messages={[]}
runAction={{ label: "Run prepared workflow", disabled: false, run }}
/>,
);
it("does not render a run action", () => {
render(<AssistantOperatorThread mode="dock" messages={[]} />);
await user.click(screen.getByRole("button", { name: /run prepared workflow/i }));
expect(run).toHaveBeenCalledOnce();
expect(screen.queryByRole("button", { name: /run prepared workflow/i })).not.toBeInTheDocument();
});
it("labels and opens the synchronized authoring phase group", () => {
@@ -23,7 +23,6 @@ import {
type AssistantOperatorThreadProps = {
readonly mode: "hidden" | "full" | "rail" | "dock";
readonly messages: ReadonlyArray<AgentMessage>;
readonly runAction?: { readonly label: string; readonly disabled: boolean; readonly run: () => void } | undefined;
readonly scrollMode?: "active" | "start" | undefined;
readonly submitApproval?: (() => void) | undefined;
readonly requestRevision?: (() => void) | undefined;
@@ -250,7 +249,6 @@ const MessageBubble = ({
export const AssistantOperatorThread = ({
mode,
messages,
runAction,
scrollMode = "active",
submitApproval,
requestRevision,
@@ -304,11 +302,6 @@ export const AssistantOperatorThread = ({
});
}, []);
const handleRun = useCallback(() => {
if (!runAction || runAction.disabled) return;
runAction.run();
}, [runAction]);
return (
<section
className="assistant-operator-thread"
@@ -345,13 +338,6 @@ export const AssistantOperatorThread = ({
})}
</div>
</div>
{runAction ? (
<div className="assistant-operator-thread__action">
<button type="button" disabled={runAction.disabled} onClick={handleRun}>
{runAction.label}
</button>
</div>
) : null}
</section>
);
};