Skip to content

Commit 70a2f03

Browse files
committed
address comments
1 parent c0ff3ca commit 70a2f03

File tree

7 files changed

+18
-20
lines changed

7 files changed

+18
-20
lines changed

apps/sim/app/workspace/[workspaceId]/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export { ErrorState, type ErrorStateProps } from './error'
22
export { InlineRenameInput } from './inline-rename-input'
3+
export { MessageActions } from './message-actions'
34
export { ownerCell } from './resource/components/owner-cell/owner-cell'
45
export type {
56
BreadcrumbEditing,

apps/sim/app/workspace/[workspaceId]/home/components/message-actions/index.ts renamed to apps/sim/app/workspace/[workspaceId]/components/message-actions/index.ts

File renamed without changes.

apps/sim/app/workspace/[workspaceId]/home/components/message-actions/message-actions.tsx renamed to apps/sim/app/workspace/[workspaceId]/components/message-actions/message-actions.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
DropdownMenuContent,
88
DropdownMenuItem,
99
DropdownMenuTrigger,
10-
Tooltip,
1110
} from '@/components/emcn'
1211

1312
interface MessageActionsProps {
@@ -46,21 +45,16 @@ export function MessageActions({ content, requestId }: MessageActionsProps) {
4645

4746
return (
4847
<DropdownMenu modal={false}>
49-
<Tooltip.Root>
50-
<Tooltip.Trigger asChild>
51-
<DropdownMenuTrigger asChild>
52-
<button
53-
type='button'
54-
aria-label='More options'
55-
className='flex h-5 w-5 items-center justify-center rounded-sm text-[var(--text-icon)] opacity-0 transition-colors transition-opacity hover:bg-[var(--surface-3)] hover:text-[var(--text-primary)] focus-visible:opacity-100 focus-visible:outline-none group-hover/msg:opacity-100 data-[state=open]:opacity-100'
56-
onClick={(event) => event.stopPropagation()}
57-
>
58-
<Ellipsis className='h-3 w-3' strokeWidth={2} />
59-
</button>
60-
</DropdownMenuTrigger>
61-
</Tooltip.Trigger>
62-
<Tooltip.Content side='top'>More options</Tooltip.Content>
63-
</Tooltip.Root>
48+
<DropdownMenuTrigger asChild>
49+
<button
50+
type='button'
51+
aria-label='More options'
52+
className='flex h-5 w-5 items-center justify-center rounded-sm text-[var(--text-icon)] opacity-0 transition-colors transition-opacity hover:bg-[var(--surface-3)] hover:text-[var(--text-primary)] focus-visible:opacity-100 focus-visible:outline-none group-hover/msg:opacity-100 data-[state=open]:opacity-100'
53+
onClick={(event) => event.stopPropagation()}
54+
>
55+
<Ellipsis className='h-3 w-3' strokeWidth={2} />
56+
</button>
57+
</DropdownMenuTrigger>
6458
<DropdownMenuContent align='end' side='top' sideOffset={4}>
6559
<DropdownMenuItem
6660
disabled={!content}

apps/sim/app/workspace/[workspaceId]/home/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export { MessageActions } from './message-actions'
21
export { MessageContent } from './message-content'
32
export { MothershipView } from './mothership-view'
43
export { QueuedMessages } from './queued-messages'

apps/sim/app/workspace/[workspaceId]/home/home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import {
1313
LandingWorkflowSeedStorage,
1414
} from '@/lib/core/utils/browser-storage'
1515
import { persistImportedWorkflow } from '@/lib/workflows/operations/import-export'
16+
import { MessageActions } from '@/app/workspace/[workspaceId]/components'
1617
import { useChatHistory, useMarkTaskRead } from '@/hooks/queries/tasks'
1718
import type { ChatContext } from '@/stores/panel'
1819
import { useSidebarStore } from '@/stores/sidebar/store'
1920
import {
20-
MessageActions,
2121
MessageContent,
2222
MothershipView,
2323
QueuedMessages,

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { type FC, memo, useCallback, useMemo, useRef, useState } from 'react'
44
import { RotateCcw } from 'lucide-react'
55
import { Button } from '@/components/emcn'
6-
import { MessageActions } from '@/app/workspace/[workspaceId]/home/components/message-actions'
6+
import { MessageActions } from '@/app/workspace/[workspaceId]/components'
77
import {
88
OptionsSelector,
99
parseSpecialTags,
@@ -413,7 +413,7 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
413413
className={`group/msg relative w-full max-w-full flex-none overflow-hidden [max-width:var(--panel-max-width)] ${isDimmed ? 'opacity-40' : 'opacity-100'}`}
414414
style={{ '--panel-max-width': `${panelWidth - 16}px` } as React.CSSProperties}
415415
>
416-
{!isStreaming && message.content && (
416+
{!isStreaming && (message.content || message.contentBlocks?.length) && (
417417
<div className='absolute right-0 bottom-0 z-10'>
418418
<MessageActions content={message.content} requestId={message.requestId} />
419419
</div>

apps/sim/lib/copilot/messages/serialization.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ export function serializeMessagesForDB(
141141
timestamp,
142142
}
143143

144+
if (msg.requestId) {
145+
serialized.requestId = msg.requestId
146+
}
147+
144148
if (Array.isArray(msg.contentBlocks) && msg.contentBlocks.length > 0) {
145149
serialized.contentBlocks = deepClone(msg.contentBlocks)
146150
}

0 commit comments

Comments
 (0)