@ -19,6 +19,7 @@ import type { UserSettings, ProviderConfig, ProgressEvent } from '~/types';
import { createSSEConnection , type SSEConnection , type SSEStatus } from '~/utils/sse' ;
import { providerSupportsWebSearch } from '~/utils/providers' ;
import LoadingSpinner from '~/components/ui/LoadingSpinner' ;
import Button from '~/components/ui/Button' ;
/** Metadata for a single generation pipeline step. */
interface StepInfo {
@ -238,11 +239,7 @@ const GenerateSynthesis: Component = () => {
const id = jobId ( ) ;
if ( ! id ) return ;
try {
await fetch ( ` /api/v1/syntheses/generate/ ${ id } /stop ` , {
method : 'POST' ,
headers : { 'X-Requested-With' : 'XMLHttpRequest' } ,
credentials : 'same-origin' ,
} ) ;
await synthesesApi . stop ( id ) ;
} catch {
// ignore errors — the pipeline will stop on its own
}
@ -422,13 +419,13 @@ const GenerateSynthesis: Component = () => {
< / p >
{ /* Stop generation button */ }
< b utton
type = "button "
< B utton
variant = "danger "
onClick = { handleStop }
class = "mt-4 px-4 py-2 text-sm font-medium text-red-700 bg-red-50 border border-red-300 rounded-md hover:bg-red-100 "
class = "mt-4 "
>
{ t ( 'generate.stop' ) }
< / b utton>
< / B utton>
< / div >
< / Show >
@ -437,28 +434,20 @@ const GenerateSynthesis: Component = () => {
< Show
when = { ! error ( ) }
fallback = {
< button
type = "button"
onClick = { handleRetry }
class = "inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm w-full sm:w-auto"
>
< Button onClick = { handleRetry } >
{ t ( 'generate.retry' ) }
< / b utton>
< / Button >
}
>
< button
type = "button"
< Button
onClick = { handleGenerate }
disabled = { generating ( ) || success ( ) || ! selectedThemeId ( ) }
class = "inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm disabled:opacity-50 disabled:cursor-not-allowed w-full sm:w-auto"
loading = { generating ( ) && ! success ( ) }
>
< Show when = { generating ( ) && ! success ( ) } >
< Loader2 class = "animate-spin -ml-1 mr-2 h-5 w-5 text-white" / >
< / Show >
{ generating ( ) && ! success ( )
? t ( 'generate.inProgress' )
: t ( 'generate.launch' ) }
< / b utton>
< / B utton>
< / Show >
< / div >
< / div >