Skip to content
Draft

feat #2104

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
2 changes: 1 addition & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENSURE that you use the logger.info and logger.warn and logger.error instead of

## Comments

You must use TSDOC for comments. Do not use ==== for comments to separate sections.
You must use TSDOC for comments. Do not use ==== for comments to separate sections. Do not leave any comments that are not TSDOC.

## Globals styles

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const TxtIcon: React.FC<IconProps> = ({ className = 'w-6 h-6' }) => (
<path d='M14 2V8H20' fill='#9E9E9E' />
<path
d='M14 2L20 8V20C20 21.1 19.1 22 18 22H6C4.9 22 4 21.1 4 20V4C4 2.9 4.9 2 6 2H14Z'
stroke='#424242'
stroke='var(--border-muted)'
strokeWidth='0.5'
strokeLinecap='round'
strokeLinejoin='round'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export function WorkflowDetails({
<LineChart
data={details.errorRates}
label='Error Rate'
color='#ef4444'
color='var(--text-error)'
unit='%'
/>
{hasDuration && (
Expand Down Expand Up @@ -467,12 +467,12 @@ export function WorkflowDetails({
<div
className='h-[6px] w-[6px] rounded-[2px]'
style={{
backgroundColor: isError ? '#EF4444' : '#B7B7B7',
backgroundColor: isError ? 'var(--text-error)' : '#B7B7B7',
}}
/>
<span
className='font-medium text-[11.5px]'
style={{ color: isError ? '#EF4444' : '#B7B7B7' }}
style={{ color: isError ? 'var(--text-error)' : '#B7B7B7' }}
>
{statusLabel}
</span>
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/workspace/[workspaceId]/logs/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,12 @@ export default function Logs() {
<div
className='h-[6px] w-[6px] rounded-[2px]'
style={{
backgroundColor: isError ? '#EF4444' : '#B7B7B7',
backgroundColor: isError ? 'var(--text-error)' : '#B7B7B7',
}}
/>
<span
className='font-medium text-[11.5px]'
style={{ color: isError ? '#EF4444' : '#B7B7B7' }}
style={{ color: isError ? 'var(--text-error)' : '#B7B7B7' }}
>
{statusLabel}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ interface TemplateCardProps {

export function TemplateCardSkeleton({ className }: { className?: string }) {
return (
<div className={cn('h-[268px] w-full rounded-[8px] bg-[#202020] p-[8px]', className)}>
<div
className={cn(
'h-[268px] w-full rounded-[8px] bg-[var(--surface-elevated)] p-[8px]',
className
)}
>
<div className='h-[180px] w-full animate-pulse rounded-[6px] bg-gray-700' />

<div className='mt-[14px] flex items-center justify-between'>
Expand Down Expand Up @@ -193,7 +198,10 @@ function TemplateCardInner({
return (
<div
onClick={handleCardClick}
className={cn('w-full cursor-pointer rounded-[8px] bg-[#202020] p-[8px]', className)}
className={cn(
'w-full cursor-pointer rounded-[8px] bg-[var(--surface-elevated)] p-[8px]',
className
)}
>
<div
ref={previewRef}
Expand Down Expand Up @@ -238,7 +246,7 @@ function TemplateCardInner({
)
})}
<div
className='flex h-[18px] w-[18px] flex-shrink-0 items-center justify-center rounded-[4px] bg-[#4A4A4A]'
className='flex h-[18px] w-[18px] flex-shrink-0 items-center justify-center rounded-[4px] bg-[var(--surface-14)]'
style={{ marginLeft: '-4px' }}
>
<span className='font-medium text-[10px] text-white'>+{blockTypes.length - 3}</span>
Expand Down Expand Up @@ -273,7 +281,7 @@ function TemplateCardInner({
<img src={authorImageUrl} alt={author} className='h-full w-full object-cover' />
</div>
) : (
<div className='flex h-[26px] w-[26px] flex-shrink-0 items-center justify-center rounded-full bg-[#4A4A4A]'>
<div className='flex h-[26px] w-[26px] flex-shrink-0 items-center justify-center rounded-full bg-[var(--surface-14)]'>
<User className='h-[18px] w-[18px] text-[#888888]' />
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import {
ChatMessage,
OutputSelect,
} from '@/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components'
import {
useChatBoundarySync,
useChatDrag,
useChatFileUpload,
useChatResize,
} from '@/app/workspace/[workspaceId]/w/[workflowId]/components/chat/hooks'
import { useChatFileUpload } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/chat/hooks'
import { useScrollManagement } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks'
import {
useFloatBoundarySync,
useFloatDrag,
useFloatResize,
} from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-float'
import { useWorkflowExecution } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution'
import type { BlockLog, ExecutionResult } from '@/executor/types'
import { getChatPosition, useChatStore } from '@/stores/chat/store'
Expand Down Expand Up @@ -312,15 +312,15 @@ export function Chat() {
)

// Drag hook
const { handleMouseDown } = useChatDrag({
const { handleMouseDown } = useFloatDrag({
position: actualPosition,
width: chatWidth,
height: chatHeight,
onPositionChange: setChatPosition,
})

// Boundary sync hook - keeps chat within bounds when layout changes
useChatBoundarySync({
useFloatBoundarySync({
isOpen: isChatOpen,
position: actualPosition,
width: chatWidth,
Expand All @@ -334,7 +334,7 @@ export function Chat() {
handleMouseMove: handleResizeMouseMove,
handleMouseLeave: handleResizeMouseLeave,
handleMouseDown: handleResizeMouseDown,
} = useChatResize({
} = useFloatResize({
position: actualPosition,
width: chatWidth,
height: chatHeight,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
export { useChatBoundarySync } from './use-chat-boundary-sync'
export { useChatDrag } from './use-chat-drag'
export type { ChatFile } from './use-chat-file-upload'
export { useChatFileUpload } from './use-chat-file-upload'
export { useChatResize } from './use-chat-resize'
export { type ChatFile, useChatFileUpload } from './use-chat-file-upload'
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { memo, useCallback } from 'react'
import clsx from 'clsx'
import { Eye, EyeOff } from 'lucide-react'
import { Button } from '@/components/emcn'
import { createLogger } from '@/lib/logs/console/logger'
import { useCopilotStore } from '@/stores/panel/copilot/store'
import { useTerminalStore } from '@/stores/terminal'
import { useWorkflowDiffStore } from '@/stores/workflow-diff'
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
import { mergeSubblockState } from '@/stores/workflows/utils'
Expand All @@ -11,6 +13,7 @@ import { useWorkflowStore } from '@/stores/workflows/workflow/store'
const logger = createLogger('DiffControls')

export const DiffControls = memo(function DiffControls() {
const isTerminalResizing = useTerminalStore((state) => state.isResizing)
// Optimized: Single diff store subscription
const {
isShowingDiff,
Expand Down Expand Up @@ -312,7 +315,10 @@ export const DiffControls = memo(function DiffControls() {

return (
<div
className='-translate-x-1/2 fixed left-1/2 z-30'
className={clsx(
'-translate-x-1/2 fixed left-1/2 z-30',
!isTerminalResizing && 'transition-[bottom] duration-100 ease-out'
)}
style={{ bottom: 'calc(var(--terminal-height) + 40px)' }}
>
<div className='flex items-center gap-[6px] rounded-[10px] p-[6px]'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { memo, useCallback } from 'react'
import clsx from 'clsx'
import { X } from 'lucide-react'
import { useParams } from 'next/navigation'
import { Button } from '@/components/emcn'
Expand All @@ -10,6 +11,7 @@ import {
openCopilotWithMessage,
useNotificationStore,
} from '@/stores/notifications'
import { useTerminalStore } from '@/stores/terminal'

const logger = createLogger('Notifications')
const MAX_VISIBLE_NOTIFICATIONS = 4
Expand All @@ -29,6 +31,7 @@ export const Notifications = memo(function Notifications() {
const removeNotification = useNotificationStore((state) => state.removeNotification)
const clearNotifications = useNotificationStore((state) => state.clearNotifications)
const visibleNotifications = notifications.slice(0, MAX_VISIBLE_NOTIFICATIONS)
const isTerminalResizing = useTerminalStore((state) => state.isResizing)

/**
* Executes a notification action and handles side effects.
Expand Down Expand Up @@ -95,7 +98,12 @@ export const Notifications = memo(function Notifications() {
}

return (
<div className='fixed right-[calc(var(--panel-width)+16px)] bottom-[calc(var(--terminal-height)+16px)] z-30 flex flex-col items-end'>
<div
className={clsx(
'fixed right-[calc(var(--panel-width)+16px)] bottom-[calc(var(--terminal-height)+16px)] z-30 flex flex-col items-end',
!isTerminalResizing && 'transition-[bottom] duration-100 ease-out'
)}
>
{[...visibleNotifications].reverse().map((notification, index, stacked) => {
const depth = stacked.length - index - 1
const xOffset = depth * 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ShimmerOverlayText({ label, value, active = false }: ShimmerOverlayText
return (
<span className='relative inline-block'>
<span style={{ color: '#B8B8B8' }}>{label}</span>
<span style={{ color: '#787878' }}>{value}</span>
<span style={{ color: 'var(--text-muted)' }}>{value}</span>
{active ? (
<span
aria-hidden='true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function ShimmerOverlayText({
{actionVerb ? (
<>
<span style={{ color: '#B8B8B8' }}>{actionVerb}</span>
<span style={{ color: '#787878' }}>{remainder}</span>
<span style={{ color: 'var(--text-muted)' }}>{remainder}</span>
</>
) : (
<span>{text}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,15 @@ export function MentionMenu({
active={index === submenuActiveIndex}
>
<span className='min-w-0 flex-1 truncate'>{log.workflowName}</span>
<span className='text-[#AEAEAE] text-[10px] dark:text-[#AEAEAE]'>·</span>
<span className='text-[10px] text-[var(--text-tertiary)] dark:text-[var(--text-tertiary)]'>
·
</span>
<span className='whitespace-nowrap text-[10px]'>
{formatTimestamp(log.createdAt)}
</span>
<span className='text-[#AEAEAE] text-[10px] dark:text-[#AEAEAE]'>·</span>
<span className='text-[10px] text-[var(--text-tertiary)] dark:text-[var(--text-tertiary)]'>
·
</span>
<span className='text-[10px] capitalize'>
{(log.trigger || 'manual').toLowerCase()}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export const Copilot = forwardRef<CopilotRef, CopilotProps>(({ panelWidth }, ref
{!isInitialized ? (
<div className='flex h-full w-full items-center justify-center'>
<div className='flex flex-col items-center gap-3'>
<p className='text-muted-foreground text-sm'>Loading chat history...</p>
<p className='text-muted-foreground text-sm'>Loading copilot</p>
</div>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect } from 'react'
import { Input, Label } from '@/components/emcn'
import { getEmailDomain } from '@/lib/urls/utils'
import { cn } from '@/lib/utils'
import { useIdentifierValidation } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/components/chat-deploy/hooks/use-identifier-validation'
import { useIdentifierValidation } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/hooks/hooks/use-identifier-validation'

interface IdentifierInputProps {
value: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface ConnectionBlocksProps {
}

const TREE_STYLES = {
LINE_COLOR: '#2C2C2C',
LINE_COLOR: 'var(--border)',
LINE_OFFSET: 4,
} as const

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useAccessibleReferencePrefixes } from '@/app/workspace/[workspaceId]/w/
import type { SubBlockConfig } from '@/blocks/types'

const MIN_TEXTAREA_HEIGHT_PX = 80
const MAX_TEXTAREA_HEIGHT_PX = 320

/**
* Interface for individual message in the messages array
Expand Down Expand Up @@ -236,10 +237,12 @@ export function MessagesInput({
return
}

// Auto-resize to fit content only when user hasn't manually resized.
textarea.style.height = 'auto'
const naturalHeight = textarea.scrollHeight || MIN_TEXTAREA_HEIGHT_PX
const nextHeight = Math.max(MIN_TEXTAREA_HEIGHT_PX, naturalHeight)
const nextHeight = Math.min(
MAX_TEXTAREA_HEIGHT_PX,
Math.max(MIN_TEXTAREA_HEIGHT_PX, naturalHeight)
)
textarea.style.height = `${nextHeight}px`

if (overlay) {
Expand Down Expand Up @@ -453,7 +456,7 @@ export function MessagesInput({
ref={(el) => {
textareaRefs.current[fieldId] = el
}}
className='allow-scroll box-border min-h-[80px] w-full resize-none whitespace-pre-wrap break-words border-none bg-transparent px-[8px] py-[8px] font-[inherit] font-medium text-sm text-transparent leading-[inherit] caret-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)] focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed'
className='allow-scroll box-border min-h-[80px] w-full resize-none whitespace-pre-wrap break-words border-none bg-transparent px-[8px] pt-[8px] font-[inherit] font-medium text-sm text-transparent leading-[inherit] caret-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)] focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed'
rows={3}
placeholder='Enter message content...'
value={message.content}
Expand Down Expand Up @@ -496,7 +499,7 @@ export function MessagesInput({
ref={(el) => {
overlayRefs.current[fieldId] = el
}}
className='pointer-events-none absolute top-0 left-0 box-border w-full overflow-auto whitespace-pre-wrap break-words border-none bg-transparent px-[8px] py-[8px] font-[inherit] font-medium text-[var(--text-primary)] text-sm leading-[inherit]'
className='scrollbar-none pointer-events-none absolute top-0 left-0 box-border w-full overflow-auto whitespace-pre-wrap break-words border-none bg-transparent px-[8px] pt-[8px] font-[inherit] font-medium text-[var(--text-primary)] text-sm leading-[inherit]'
>
{formatDisplayText(message.content, {
accessiblePrefixes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function SubflowEditor({
className='h-[1.25px]'
style={{
backgroundImage:
'repeating-linear-gradient(to right, #2C2C2C 0px, #2C2C2C 6px, transparent 6px, transparent 12px)',
'repeating-linear-gradient(to right, var(--border) 0px, var(--border) 6px, transparent 6px, transparent 12px)',
}}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export function Editor() {
className='h-[1.25px]'
style={{
backgroundImage:
'repeating-linear-gradient(to right, #2C2C2C 0px, #2C2C2C 6px, transparent 6px, transparent 12px)',
'repeating-linear-gradient(to right, var(--border) 0px, var(--border) 6px, transparent 6px, transparent 12px)',
}}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function createDragPreview(info: DragItemInfo): HTMLElement {
const preview = document.createElement('div')
preview.style.cssText = `
width: 250px;
background: #232323;
background: var(--surface-1);
border-radius: 8px;
padding: 8px 9px;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import { useDeleteWorkflow, useImportWorkflow } from '@/app/workspace/[workspace
import { useChatStore } from '@/stores/chat/store'
import { usePanelStore } from '@/stores/panel/store'
import type { PanelTab } from '@/stores/panel/types'
import { DEFAULT_TERMINAL_HEIGHT, MIN_TERMINAL_HEIGHT, useTerminalStore } from '@/stores/terminal'
import { useVariablesStore } from '@/stores/variables/store'
import { useWorkflowJsonStore } from '@/stores/workflows/json/store'
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
Expand Down Expand Up @@ -143,10 +142,6 @@ export function Panel() {
openSubscriptionSettings()
return
}
const { openOnRun, terminalHeight, setTerminalHeight } = useTerminalStore.getState()
if (openOnRun && terminalHeight <= MIN_TERMINAL_HEIGHT) {
setTerminalHeight(DEFAULT_TERMINAL_HEIGHT)
}
await handleRunWorkflow()
}, [usageExceeded, handleRunWorkflow])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const SubflowNodeStyles: React.FC = () => {
/* Drag-over states */
.loop-node-drag-over,
.parallel-node-drag-over {
box-shadow: 0 0 0 1.75px #33B4FF !important;
box-shadow: 0 0 0 1.75px var(--brand-secondary) !important;
border-radius: 8px !important;
}

Expand Down
Loading