Skip to content

Commit 709f91f

Browse files
committed
improvements: ui/ux around mothership
1 parent 0c9ab10 commit 709f91f

File tree

36 files changed

+780
-1290
lines changed

36 files changed

+780
-1290
lines changed

apps/sim/app/api/mothership/chats/read/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { db } from '@sim/db'
22
import { copilotChats } from '@sim/db/schema'
33
import { createLogger } from '@sim/logger'
4-
import { and, eq } from 'drizzle-orm'
4+
import { and, eq, sql } from 'drizzle-orm'
55
import { type NextRequest, NextResponse } from 'next/server'
66
import { z } from 'zod'
77
import {
@@ -29,7 +29,7 @@ export async function POST(request: NextRequest) {
2929

3030
await db
3131
.update(copilotChats)
32-
.set({ lastSeenAt: new Date() })
32+
.set({ lastSeenAt: sql`GREATEST(${copilotChats.updatedAt}, NOW())` })
3333
.where(and(eq(copilotChats.id, chatId), eq(copilotChats.userId, userId)))
3434

3535
return NextResponse.json({ success: true })

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/agent-group.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,10 @@
33
import { useEffect, useRef, useState } from 'react'
44
import { ChevronDown } from '@/components/emcn'
55
import { cn } from '@/lib/core/utils/cn'
6-
import type { ToolCallStatus } from '../../../../types'
6+
import type { ToolCallData } from '../../../../types'
77
import { getAgentIcon } from '../../utils'
88
import { ToolCallItem } from './tool-call-item'
99

10-
interface ToolCallData {
11-
id: string
12-
toolName: string
13-
displayTitle: string
14-
status: ToolCallStatus
15-
}
16-
1710
interface AgentGroupProps {
1811
agentName: string
1912
agentLabel: string

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/agent-group/tool-call-item.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,14 @@ export function ToolCallItem({ toolName, displayTitle, status }: ToolCallItemPro
5555
{status === 'executing' ? (
5656
<Loader className='h-[16px] w-[16px] text-[var(--text-icon)]' animate />
5757
) : status === 'cancelled' ? (
58-
<CircleStop className='h-[16px] w-[16px] text-[var(--text-secondary)]' />
58+
<CircleStop className='h-[16px] w-[16px] text-[var(--text-icon)]' />
5959
) : Icon ? (
6060
<Icon className='h-[16px] w-[16px] text-[var(--text-icon)]' />
6161
) : (
6262
<CircleCheck className='h-[16px] w-[16px] text-[var(--text-icon)]' />
6363
)}
6464
</div>
65-
<span
66-
className={
67-
status === 'cancelled'
68-
? 'font-base text-[14px] text-[var(--text-secondary)]'
69-
: 'font-base text-[14px] text-[var(--text-body)]'
70-
}
71-
>
72-
{displayTitle}
73-
</span>
65+
<span className='font-base text-[14px] text-[var(--text-body)]'>{displayTitle}</span>
7466
</div>
7567
)
7668
}

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type ThProps = ComponentPropsWithoutRef<'th'>
6767
const MARKDOWN_COMPONENTS: React.ComponentProps<typeof ReactMarkdown>['components'] = {
6868
table({ children }) {
6969
return (
70-
<div className='not-prose my-4 w-full overflow-x-auto'>
70+
<div className='not-prose my-4 w-full overflow-x-auto [&_strong]:font-[600]'>
7171
<table className='min-w-full border-collapse'>{children}</table>
7272
</div>
7373
)
@@ -131,7 +131,7 @@ const MARKDOWN_COMPONENTS: React.ComponentProps<typeof ReactMarkdown>['component
131131
)}
132132
<div className='code-editor-theme bg-[var(--surface-5)] dark:bg-[#1F1F1F]'>
133133
<pre
134-
className='m-0 overflow-x-auto whitespace-pre p-4 font-[430] font-mono text-[13px] text-[var(--text-primary)] leading-[21px] dark:text-[#eeeeee]'
134+
className='m-0 overflow-x-auto whitespace-pre p-4 font-[430] font-mono text-[13px] text-[var(--text-primary)] leading-[21px]'
135135
dangerouslySetInnerHTML={{ __html: html }}
136136
/>
137137
</div>

apps/sim/app/workspace/[workspaceId]/home/components/message-content/message-content.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import type { ContentBlock, OptionItem, SubagentName, ToolCallStatus } from '../../types'
3+
import type { ContentBlock, OptionItem, SubagentName, ToolCallData } from '../../types'
44
import { SUBAGENT_LABELS } from '../../types'
55
import { AgentGroup, ChatContent, CircleStop, Options } from './components'
66

@@ -9,13 +9,6 @@ interface TextSegment {
99
content: string
1010
}
1111

12-
interface ToolCallData {
13-
id: string
14-
toolName: string
15-
displayTitle: string
16-
status: ToolCallStatus
17-
}
18-
1912
interface AgentGroupSegment {
2013
type: 'agent_group'
2114
id: string
@@ -252,8 +245,8 @@ export function MessageContent({
252245
case 'stopped':
253246
return (
254247
<div key={`stopped-${i}`} className='flex items-center gap-[8px]'>
255-
<CircleStop className='h-[16px] w-[16px] flex-shrink-0 text-[var(--text-secondary)]' />
256-
<span className='font-base text-[14px] text-[var(--text-secondary)]'>
248+
<CircleStop className='h-[16px] w-[16px] flex-shrink-0 text-[var(--text-icon)]' />
249+
<span className='font-base text-[14px] text-[var(--text-body)]'>
257250
Stopped by user
258251
</span>
259252
</div>

0 commit comments

Comments
 (0)