From f01fa4ab2fca5455c1eb6d7973fa6064a2e1f1d0 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:08:14 -0500 Subject: [PATCH] Remove the duplicate floating Stop and run the full checks --- frontend/src/pages/SessionDetail.tsx | 12 -------- .../SessionDetail.scroll-floating.test.tsx | 29 ++++++++++++------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/frontend/src/pages/SessionDetail.tsx b/frontend/src/pages/SessionDetail.tsx index 11618c43..ddd23c25 100644 --- a/frontend/src/pages/SessionDetail.tsx +++ b/frontend/src/pages/SessionDetail.tsx @@ -6,7 +6,6 @@ import { MessageThread } from "@/components/message/MessageThread"; import { PromptInput, type PromptInputHandle } from "@/components/message/PromptInput"; import { FloatingTTSButton } from '@/components/message/FloatingTTSButton' import { X, CornerUpLeft, GitBranch, ArrowDown, Server } from "lucide-react"; -import { SquareFill } from "@/components/ui/square-fill"; import { Header } from "@/components/ui/header"; import { Badge } from "@/components/ui/badge"; import { getServerProjectPath, getSessionListPath, getSessionPath } from '@/lib/navigation' @@ -935,17 +934,6 @@ export function SessionDetail() { Clear )} - {isSessionActive && ( - - )} )} {showScrollButton && !isFormSheetOpen && ( diff --git a/frontend/src/pages/__tests__/SessionDetail.scroll-floating.test.tsx b/frontend/src/pages/__tests__/SessionDetail.scroll-floating.test.tsx index 76df95d9..4c9a853c 100644 --- a/frontend/src/pages/__tests__/SessionDetail.scroll-floating.test.tsx +++ b/frontend/src/pages/__tests__/SessionDetail.scroll-floating.test.tsx @@ -34,12 +34,15 @@ function paddingBottom() { return transcriptContainer().style.paddingBottom } -function floatingStopButton() { - const button = screen.getAllByTitle('Stop').find((candidate) => candidate.classList.contains('md:hidden')) - if (!button) throw new Error('the floating stop button is not rendered') - return button +function stopButton() { + return screen.getByTitle('Stop') } +const VIEWPORTS = [ + { name: 'mobile', width: 480 }, + { name: 'desktop', width: 900 }, +] + let scrollMetrics: ElementScrollMetricsFake let resizeObserver: ResizeObserverFake @@ -125,12 +128,13 @@ describe('SessionDetail scroll and composer affordances', () => { }) }) - it('interrupts the active session from the floating stop button', async () => { + it.each(VIEWPORTS)('interrupts the active session from the composer stop button on $name', async ({ width }) => { + installWindowSize(width) const { fetchFake } = renderSessionPage({ activeSessions: ['session-1'] }) await waitForComposer() - await screen.findAllByTitle('Stop') + await screen.findByTitle('Stop') - fireEvent.click(floatingStopButton()) + fireEvent.click(stopButton()) await waitFor(() => { expect( @@ -139,15 +143,18 @@ describe('SessionDetail scroll and composer affordances', () => { }) }) - it('shows the floating stop button while the session is active', async () => { + it.each(VIEWPORTS)('renders a single composer stop button while the session is active on $name', async ({ width }) => { + installWindowSize(width) renderSessionPage({ activeSessions: ['session-1'] }) await waitForComposer() - await screen.findAllByTitle('Stop') + await screen.findByTitle('Stop') - expect(floatingStopButton()).toBeInTheDocument() + expect(screen.getAllByTitle('Stop')).toHaveLength(1) + expect(stopButton()).toBeInTheDocument() }) - it('hides the stop button while the session is idle', async () => { + it.each(VIEWPORTS)('hides the stop button while the session is idle on $name', async ({ width }) => { + installWindowSize(width) renderSessionPage() await waitForComposer()