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
9 changes: 4 additions & 5 deletions apps/desktop/src/main/terminal/selection.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { sleep } from '@sim/utils/helpers'
import { Terminal } from '@xterm/headless'
import { describe, expect, it } from 'vitest'
import { findSelectedRow } from '@/main/terminal/session'
Expand All @@ -7,14 +6,14 @@ const REVERSE = '\u001b[7m'
const RESET = '\u001b[0m'

/**
* Writes to a real headless emulator and lets it settle, so these exercise the
* same buffer the agent reads rather than a hand-built fake. xterm parses
* asynchronously, hence the flush.
* Writes to a real headless emulator and waits for the queued writes to finish,
* so these exercise the same buffer the agent reads. The trailing empty write's
* callback fires after xterm has parsed every preceding chunk.
*/
async function screen(write: (term: Terminal) => void, rows = 8): Promise<Terminal> {
const term = new Terminal({ cols: 40, rows, allowProposedApi: true })
write(term)
await sleep(30)
await new Promise<void>((resolve) => term.write('', resolve))
return term
}

Expand Down
10 changes: 2 additions & 8 deletions apps/sim/app/(interfaces)/chat/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type React from 'react'
import { useLayoutEffect, useRef, useState } from 'react'
import { Badge, Button, cn, Tooltip } from '@sim/emcn'
import { ArrowUp, Paperclip, X } from '@sim/emcn/icons'
import { ArrowUp, Paperclip, StopFilled, X } from '@sim/emcn/icons'
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { CHAT_ACCEPT_ATTRIBUTE } from '@/lib/uploads/utils/validation'
Expand Down Expand Up @@ -258,13 +258,7 @@ export const ChatInput: React.FC<{
className='size-[28px] rounded-full p-0'
aria-label='Stop generation'
>
<svg
className='block size-[14px] fill-current'
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
>
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
</svg>
<StopFilled className='block size-[14px] fill-current' />
</Button>
) : (
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useRef } from 'react'
import { Button, Chip, cn, Tooltip } from '@sim/emcn'
import { ArrowUp, Plus } from '@sim/emcn/icons'
import { ArrowUp, Plus, StopFilled } from '@sim/emcn/icons'
import { ASSISTANT_IMAGE_ACCEPT_ATTRIBUTE } from '@/lib/uploads/shared/assistant-images'
import { useOrganizationContext } from '@/app/o/[organizationId]/providers/organization-provider'
import { AttachedFilesList } from '@/app/workspace/[workspaceId]/home/components/user-input/components/attached-files-list/attached-files-list'
Expand Down Expand Up @@ -137,13 +137,7 @@ export function Composer({
aria-label='Stop generation'
className={cn(SEND_BUTTON_BASE, SEND_BUTTON_ACTIVE)}
>
<svg
className='block size-[14px] fill-white dark:fill-black'
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
>
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
</svg>
<StopFilled className='block size-[14px] fill-white dark:fill-black' />
</Button>
) : (
<Button
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use client'

import React from 'react'
import { ArrowUp, Button, cn } from '@sim/emcn'
import { Button, cn } from '@sim/emcn'
import { ArrowUp, StopFilled } from '@sim/emcn/icons'
import {
SEND_BUTTON_ACTIVE,
SEND_BUTTON_BASE,
Expand Down Expand Up @@ -30,13 +31,7 @@ export const SendButton = React.memo(function SendButton({
title='Stop generation'
aria-label='Stop generation'
>
<svg
className='block h-[14px] w-[14px] fill-white dark:fill-black'
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
>
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
</svg>
<StopFilled className='block h-[14px] w-[14px] fill-white dark:fill-black' />
</Button>
)
}
Expand Down
1 change: 1 addition & 0 deletions packages/emcn/src/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export { Split } from './split'
export { Sprout } from './sprout'
export { Square } from './square'
export { SquareArrowUpRight } from './square-arrow-up-right'
export { StopFilled } from './stop-filled'
export { Strikethrough } from './strikethrough'
export { Sun } from './sun'
export { Table } from './table'
Expand Down
12 changes: 12 additions & 0 deletions packages/emcn/src/icons/stop-filled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { SVGProps } from 'react'

/**
* Filled stop icon. Callers provide the size and fill through SVG props.
*/
export function StopFilled(props: SVGProps<SVGSVGElement>) {
return (
<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' {...props}>
<rect x='4' y='4' width='16' height='16' rx='3' ry='3' />
</svg>
)
}
Loading