Skip to content

Commit eac44eb

Browse files
authored
fix(chat): clarify activity spacing and unify overflow fades (#8271)
* fix(chat): clarify activity spacing and unify overflow fades * fix(chat): retain response-sized activity text * chore(chat): cover interaction spacing boundaries
1 parent addb457 commit eac44eb

22 files changed

Lines changed: 293 additions & 40 deletions

File tree

‎apps/sim/app/(interfaces)/chat/components/message/message.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ describe('ClientChatMessage thinking chrome (Step 6)', () => {
154154
})
155155
mounts.push(unmount)
156156

157-
expect(container.textContent).toContain('Thinking…')
157+
expect(container.textContent).toContain('Thinking')
158158
expect(container.textContent).toContain('Internal reasoning')
159159
expect(container.textContent).toContain('Answer text')
160160
})

‎apps/sim/app/(landing)/components/hero/components/hero-chat-loop/hero-chat-loop.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe('HeroChatLoop production thinking handoff', () => {
139139
})
140140

141141
it.each([
142-
['thinking', 'Thinking…'],
142+
['thinking', 'Thinking'],
143143
['dispatching', 'Dispatching…'],
144144
] as const)('shows the production activity indicator alone during %s', (phase, label) => {
145145
renderPhase(phase)

‎apps/sim/app/(landing)/components/hero/components/hero-chat-loop/hero-chat-loop.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export function HeroChatLoop({
208208
)}
209209
>
210210
{showThinking && (
211-
<PendingTagIndicator label={phase === 'dispatching' ? 'Dispatching…' : 'Thinking…'} />
211+
<PendingTagIndicator label={phase === 'dispatching' ? 'Dispatching…' : 'Thinking'} />
212212
)}
213213
{showBuilding && (
214214
<AgentGroupView

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
'use client'
22

33
import { type ReactNode, useEffect, useLayoutEffect, useRef } from 'react'
4-
import { cn, scrollFadeAttributes, scrollFadeClass, useScrollEdges } from '@sim/emcn'
4+
import {
5+
cn,
6+
overflowFadeSizeClass,
7+
scrollFadeAttributes,
8+
scrollFadeClass,
9+
useScrollEdges,
10+
} from '@sim/emcn'
511

612
interface ActivityViewportProps {
713
children: ReactNode
@@ -85,7 +91,8 @@ export function ActivityViewport({
8591
className={cn(
8692
'pr-2',
8793
!unbounded && 'scrollbar-hide max-h-[110px] overflow-y-auto',
88-
scrollFadeClass
94+
scrollFadeClass,
95+
overflowFadeSizeClass
8996
)}
9097
{...scrollFadeAttributes(edges)}
9198
>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ export function AgentGroupView({
280280
liveToolId={liveCall?.id}
281281
/>
282282
) : (
283-
<div className='flex min-w-0 flex-col gap-2'>{items.map(renderItem)}</div>
283+
<div className='flex min-w-0 flex-col gap-2 [&>*:has(+[data-interaction-card])]:mb-2 [&>[data-interaction-card]:not(:last-child)]:mb-2'>
284+
{items.map(renderItem)}
285+
</div>
284286
)
285287
const headerText = error
286288
? agentLabel

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@ export function MainAgentActivity({
4949
)
5050
})
5151

52-
return <div className='flex min-w-0 flex-col gap-2'>{activity}</div>
52+
return (
53+
<div className='flex min-w-0 flex-col gap-2 [&>*:has(+[data-interaction-card])]:mb-2 [&>[data-interaction-card]:not(:last-child)]:mb-2'>
54+
{activity}
55+
</div>
56+
)
5357
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
chipRadiusClass,
66
cn,
77
OverflowText,
8+
overflowFadeSizeClass,
89
scrollFadeAttributes,
910
scrollFadeClass,
1011
useScrollEdges,
@@ -40,7 +41,11 @@ export function SearchActivityResults({ sources, label }: SearchActivityResultsP
4041
ref={scrollRef}
4142
role='region'
4243
aria-label={label}
43-
className={cn('max-h-[152px] overflow-y-auto overscroll-contain p-1', scrollFadeClass)}
44+
className={cn(
45+
'max-h-[152px] overflow-y-auto overscroll-contain p-1',
46+
scrollFadeClass,
47+
overflowFadeSizeClass
48+
)}
4449
{...scrollFadeAttributes(edges)}
4550
>
4651
<ul className='m-0 list-none p-0'>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
cn,
2929
Lightbox,
3030
languages,
31+
overflowFadeSizeClass,
3132
highlight as prismHighlight,
3233
scrollFadeAttributes,
3334
scrollFadeXClass,
@@ -287,7 +288,8 @@ function MarkdownTable({ children }: MarkdownTableProps) {
287288
tabIndex={isOverflowing ? 0 : undefined}
288289
className={cn(
289290
'not-prose my-4 w-full overflow-x-auto [&_strong]:font-semibold',
290-
scrollFadeXClass
291+
scrollFadeXClass,
292+
overflowFadeSizeClass
291293
)}
292294
{...scrollFadeAttributes(edges)}
293295
>
@@ -754,7 +756,7 @@ function ChatContentInner({
754756
<WorkspaceRefsContext.Provider
755757
value={{ resources: workspaceRefs, onSelect: onWorkspaceResourceSelect }}
756758
>
757-
<div className={cn('space-y-3', inter.className)}>
759+
<div className={cn('space-y-4', inter.className)}>
758760
{groups.map((group, i) => {
759761
if (group.kind === 'inline') {
760762
return (

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface InteractionCardProps {
2727
export function InteractionCard({ children, title, actions, className }: InteractionCardProps) {
2828
return (
2929
<div
30+
data-interaction-card
3031
className={cn(
3132
'rounded-2xl border border-[var(--border-1)] bg-[var(--white)] px-2.5 py-2 dark:bg-[var(--surface-4)]',
3233
className

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ export function WatchActivity({ task: recorded }: WatchActivityProps) {
4848
: recorded
4949
const pending = task.status === undefined || task.status === 'pending'
5050
return (
51-
<div aria-busy={pending} title={[task.summary, task.note].filter(Boolean).join('\n')}>
51+
<div
52+
data-chat-activity
53+
aria-busy={pending}
54+
title={[task.summary, task.note].filter(Boolean).join('\n')}
55+
>
5256
<ActivityStatus label={watchLabel(task, params?.workspaceId)} isActive={pending} />
5357
</div>
5458
)

0 commit comments

Comments
 (0)