Skip to content

Commit 842d37c

Browse files
committed
fix(copilot): chat loading; refactor(copilot): components, utils, hooks
1 parent 93955ff commit 842d37c

File tree

47 files changed

+640
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+640
-265
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { PopoverSection } from '@/components/emcn'
2+
3+
/**
4+
* Skeleton loading component for chat history dropdown
5+
* Displays placeholder content while chats are being loaded
6+
*/
7+
export function ChatHistorySkeleton() {
8+
return (
9+
<>
10+
<PopoverSection>
11+
<div className='h-3 w-12 animate-pulse rounded bg-muted/40' />
12+
</PopoverSection>
13+
<div className='flex flex-col gap-0.5'>
14+
{[1, 2, 3].map((i) => (
15+
<div key={i} className='flex h-[25px] items-center px-[6px]'>
16+
<div className='h-3 w-full animate-pulse rounded bg-muted/40' />
17+
</div>
18+
))}
19+
</div>
20+
</>
21+
)
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './chat-history-skeleton'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { Button } from '@/components/emcn'
2+
3+
interface CheckpointDiscardModalProps {
4+
isProcessingDiscard: boolean
5+
onCancel: () => void
6+
onRevert: () => void
7+
onContinue: () => void
8+
}
9+
10+
/**
11+
* Inline confirmation modal for discarding checkpoints during message editing
12+
* Shows options to cancel, revert to checkpoint, or continue without reverting
13+
*/
14+
export function CheckpointDiscardModal({
15+
isProcessingDiscard,
16+
onCancel,
17+
onRevert,
18+
onContinue,
19+
}: CheckpointDiscardModalProps) {
20+
return (
21+
<div className='mt-[8px] rounded-[4px] border border-[var(--border)] bg-[var(--surface-4)] p-[10px]'>
22+
<p className='mb-[8px] text-[12px] text-[var(--text-primary)]'>
23+
Continue from a previous message?
24+
</p>
25+
<div className='flex gap-[8px]'>
26+
<Button
27+
onClick={onCancel}
28+
variant='active'
29+
size='sm'
30+
className='flex-1'
31+
disabled={isProcessingDiscard}
32+
>
33+
Cancel
34+
</Button>
35+
<Button
36+
onClick={onRevert}
37+
variant='destructive'
38+
size='sm'
39+
className='flex-1'
40+
disabled={isProcessingDiscard}
41+
>
42+
{isProcessingDiscard ? 'Reverting...' : 'Revert'}
43+
</Button>
44+
<Button
45+
onClick={onContinue}
46+
variant='tertiary'
47+
size='sm'
48+
className='flex-1'
49+
disabled={isProcessingDiscard}
50+
>
51+
Continue
52+
</Button>
53+
</div>
54+
</div>
55+
)
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './checkpoint-discard-modal'

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

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './file-display'
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
export * from './checkpoint-discard-modal'
12
export * from './file-display'
2-
export { default as CopilotMarkdownRenderer } from './markdown-renderer'
3+
export { CopilotMarkdownRenderer } from './markdown-renderer'
4+
export * from './restore-checkpoint-modal'
35
export * from './smooth-streaming'
46
export * from './thinking-block'
57
export * from './usage-limit-actions'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as CopilotMarkdownRenderer } from './markdown-renderer'

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

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './restore-checkpoint-modal'

0 commit comments

Comments
 (0)