fix(web): add pointer cursor to running stop-generation button (#900)

Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
0x1f99dandJulius Marminge authored and GitHub committed 2026-03-12 12:15:01 -07:00
1 parent 85c174a6ca
commit 224acebb57
2 files changed
+26 -2

No files matched your search

+25 -1
View File
@@ -11,6 +11,7 @@ import {
type WsWelcomePayload,
WS_CHANNELS,
WS_METHODS,
OrchestrationSessionStatus,
} from "@t3tools/contracts";
import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
import { HttpResponse, http, ws } from "msw";
@@ -153,6 +154,7 @@ function createSnapshotForTargetUser(options: {
targetMessageId: MessageId;
targetText: string;
targetAttachmentCount?: number;
sessionStatus?: OrchestrationSessionStatus;
}): OrchestrationReadModel {
const messages: Array<OrchestrationReadModel["threads"][number]["messages"][number]> = [];
@@ -222,7 +224,7 @@ function createSnapshotForTargetUser(options: {
checkpoints: [],
session: {
threadId: THREAD_ID,
status: "ready",
status: options.sessionStatus ?? "ready",
providerName: "codex",
runtimeMode: "full-access",
activeTurnId: null,
@@ -1009,6 +1011,28 @@ describe("ChatView timeline estimator parity (full app)", () => {
}
});
it("shows a pointer cursor for the running stop button", async () => {
const mounted = await mountChatView({
viewport: DEFAULT_VIEWPORT,
snapshot: createSnapshotForTargetUser({
targetMessageId: "msg-user-stop-button-cursor" as MessageId,
targetText: "stop button cursor target",
sessionStatus: "running",
}),
});
try {
const stopButton = await waitForElement(
() => document.querySelector<HTMLButtonElement>('button[aria-label="Stop generation"]'),
"Unable to find stop generation button.",
);
expect(getComputedStyle(stopButton).cursor).toBe("pointer");
} finally {
await mounted.cleanup();
}
});
it("keeps the new thread selected after clicking the new-thread button", async () => {
const mounted = await mountChatView({
viewport: DEFAULT_VIEWPORT,
+1 -1
View File
@@ -3604,7 +3604,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
) : phase === "running" ? (
<button
type="button"
className="flex size-8 items-center justify-center rounded-full bg-rose-500/90 text-white transition-all duration-150 hover:bg-rose-500 hover:scale-105 sm:h-8 sm:w-8"
className="flex size-8 cursor-pointer items-center justify-center rounded-full bg-rose-500/90 text-white transition-all duration-150 hover:bg-rose-500 hover:scale-105 sm:h-8 sm:w-8"
onClick={() => void onInterrupt()}
aria-label="Stop generation"
>