mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Remove the duplicate floating Stop and run the full checks
This commit is contained in:
1 parent
64749a760d
commit
f01fa4ab2f
2 files changed
+18
-23
No files matched your search
@@ -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() {
|
||||
<span className="text-sm font-medium hidden sm:inline">Clear</span>
|
||||
</button>
|
||||
)}
|
||||
{isSessionActive && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleInterruptSession}
|
||||
title="Stop"
|
||||
aria-label="Stop"
|
||||
className="md:hidden p-3 rounded-xl transition-all duration-200 active:scale-95 hover:scale-105 bg-destructive hover:bg-destructive/90 text-destructive-foreground border border-destructive/60 shadow-lg shadow-destructive/30"
|
||||
>
|
||||
<SquareFill className="w-5 h-5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{showScrollButton && !isFormSheetOpen && (
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user