Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 0 additions & 82 deletions apps/sim/app/api/copilot/training/examples/route.ts

This file was deleted.

94 changes: 0 additions & 94 deletions apps/sim/app/api/copilot/training/route.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { requestJson } from '@/lib/api/client/request'
import { telemetryContract } from '@/lib/api/contracts/telemetry'
import { signOut, useSession } from '@/lib/auth/auth-client'
import { ANONYMOUS_USER_ID } from '@/lib/auth/constants'
import { getEnv, isTruthy } from '@/lib/core/config/env'
import { isHosted } from '@/lib/core/config/env-flags'
import { getBrowserTimezone, getTimezoneOptions } from '@/lib/core/utils/timezone'
import { getBaseUrl } from '@/lib/core/utils/urls'
Expand Down Expand Up @@ -79,7 +78,6 @@ export function General() {

const isLoading = isProfileLoading || isSettingsLoading

const isTrainingEnabled = isTruthy(getEnv('NEXT_PUBLIC_COPILOT_TRAINING_ENABLED'))
const isAuthDisabled = session?.user?.id === ANONYMOUS_USER_ID

const [name, setName] = useState(profile?.name || '')
Expand Down Expand Up @@ -232,12 +230,6 @@ export function General() {
}
}

const handleTrainingControlsChange = async (checked: boolean) => {
if (checked !== settings?.showTrainingControls && !updateSetting.isPending) {
await updateSetting.mutateAsync({ key: 'showTrainingControls', value: checked })
}
}

const handleErrorNotificationsChange = async (checked: boolean) => {
if (checked !== settings?.errorNotificationsEnabled && !updateSetting.isPending) {
await updateSetting.mutateAsync({ key: 'errorNotificationsEnabled', value: checked })
Expand Down Expand Up @@ -528,17 +520,6 @@ export function General() {
onCheckedChange={handleShowActionBarChange}
/>
</div>

{isTrainingEnabled && (
<div className='flex items-center justify-between'>
<Label htmlFor='training-controls'>Training controls</Label>
<Switch
id='training-controls'
checked={settings?.showTrainingControls ?? false}
onCheckedChange={handleTrainingControlsChange}
/>
</div>
)}
</div>
</SettingsSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ import {
ArrowUp,
Check,
Clipboard,
Database,
Download,
MoreHorizontal,
Palette,
Pause,
Search,
Trash,
X,
Expand Down Expand Up @@ -94,9 +92,6 @@ export interface OutputPanelProps {
setShowInput: (show: boolean) => void
hasInputData: boolean
isPlaygroundEnabled: boolean
shouldShowTrainingButton: boolean
isTraining: boolean
handleTrainingClick: (e: React.MouseEvent) => void
showCopySuccess: boolean
handleCopy: () => void
hasEntries: boolean
Expand All @@ -121,9 +116,6 @@ export const OutputPanel = React.memo(function OutputPanel({
setShowInput,
hasInputData,
isPlaygroundEnabled,
shouldShowTrainingButton,
isTraining,
handleTrainingClick,
showCopySuccess,
handleCopy,
hasEntries,
Expand Down Expand Up @@ -392,31 +384,6 @@ export const OutputPanel = React.memo(function OutputPanel({
</Tooltip.Root>
)}

{shouldShowTrainingButton && (
<Tooltip.Root>
<Tooltip.Trigger asChild>
<Button
variant='ghost'
onClick={handleTrainingClick}
aria-label={isTraining ? 'Stop training' : 'Train Sim'}
className={clsx(
'!p-1.5 -m-1.5',
isTraining && 'text-orange-600 dark:text-orange-400'
)}
>
{isTraining ? (
<Pause className='h-3.5 w-3.5' />
) : (
<Database className='h-3.5 w-3.5' />
)}
</Button>
</Tooltip.Trigger>
<Tooltip.Content>
<span>{isTraining ? 'Stop Training' : 'Train Sim'}</span>
</Tooltip.Content>
</Tooltip.Root>
)}

<Tooltip.Root>
<Tooltip.Trigger asChild>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ import {
PopoverTrigger,
Tooltip,
} from '@sim/emcn'
import {
ArrowDown,
ArrowUp,
Database,
Download,
MoreHorizontal,
Palette,
Pause,
Trash,
} from '@sim/emcn/icons'
import { ArrowDown, ArrowUp, Download, MoreHorizontal, Palette, Trash } from '@sim/emcn/icons'
import { formatDuration } from '@sim/utils/formatting'
import { useVirtualizer } from '@tanstack/react-virtual'
import clsx from 'clsx'
Expand Down Expand Up @@ -58,7 +49,6 @@ import {
} from '@/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/utils'
import { useContextMenu } from '@/app/workspace/[workspaceId]/w/components/sidebar/hooks'
import { getTileIconColorClass } from '@/blocks/icon-color'
import { useShowTrainingControls } from '@/hooks/queries/general-settings'
import { OUTPUT_PANEL_WIDTH, TERMINAL_HEIGHT } from '@/stores/constants'
import type { ConsoleEntry } from '@/stores/terminal'
import {
Expand Down Expand Up @@ -718,14 +708,6 @@ export const Terminal = memo(function Terminal() {
const [autoSelectEnabled, setAutoSelectEnabled] = useState(true)
const [mainOptionsOpen, setMainOptionsOpen] = useState(false)

const [isTrainingEnvEnabled] = useState(() =>
isTruthy(getEnv('NEXT_PUBLIC_COPILOT_TRAINING_ENABLED'))
)
const showTrainingControls = useShowTrainingControls()
const isTraining = false
const toggleTrainingModal = useCallback(() => {}, [])
const stopTraining = useCallback(() => {}, [])

const [isPlaygroundEnabled] = useState(() => isTruthy(getEnv('NEXT_PUBLIC_ENABLE_PLAYGROUND')))

const { handlePointerDown } = useTerminalResize()
Expand Down Expand Up @@ -1044,20 +1026,6 @@ export const Terminal = memo(function Terminal() {
[closeLogRowMenu]
)

const handleTrainingClick = useCallback(
(e: React.MouseEvent) => {
e.stopPropagation()
if (isTraining) {
stopTraining()
} else {
toggleTrainingModal()
}
},
[isTraining, stopTraining, toggleTrainingModal]
)

const shouldShowTrainingButton = isTrainingEnvEnabled && showTrainingControls

useRegisterGlobalCommands(() =>
createCommands([
{
Expand Down Expand Up @@ -1392,31 +1360,6 @@ export const Terminal = memo(function Terminal() {
</Tooltip.Root>
)}

{shouldShowTrainingButton && (
<Tooltip.Root>
<Tooltip.Trigger asChild>
<Button
variant='ghost'
onClick={handleTrainingClick}
aria-label={isTraining ? 'Stop training' : 'Train Sim'}
className={clsx(
'!p-1.5 -m-1.5',
isTraining && 'text-orange-600 dark:text-orange-400'
)}
>
{isTraining ? (
<Pause className='h-3.5 w-3.5' />
) : (
<Database className='h-3.5 w-3.5' />
)}
</Button>
</Tooltip.Trigger>
<Tooltip.Content>
<span>{isTraining ? 'Stop Training' : 'Train Sim'}</span>
</Tooltip.Content>
</Tooltip.Root>
)}

{filteredEntries.length > 0 && (
<>
<Tooltip.Root>
Expand Down Expand Up @@ -1528,9 +1471,6 @@ export const Terminal = memo(function Terminal() {
setShowInput={setShowInput}
hasInputData={hasInputData}
isPlaygroundEnabled={isPlaygroundEnabled}
shouldShowTrainingButton={shouldShowTrainingButton}
isTraining={isTraining}
handleTrainingClick={handleTrainingClick}
showCopySuccess={showCopySuccess}
handleCopy={handleCopy}
hasEntries={filteredEntries.length > 0}
Expand Down
Loading
Loading