Skip to content

Commit 00c0f87

Browse files
committed
fix(mothership): a label that stops being a placeholder starts holding the header
1 parent a0f0abb commit 00c0f87

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,14 @@ describe('usePacedActivity', () => {
7070
act(() => vi.advanceTimersByTime(100))
7171
expect(show('Looking up the failed run', true, 'call-1')).toBe('Looking up the failed run')
7272
})
73+
74+
it('holds a title that matched its placeholder text once the call names itself', () => {
75+
show('Reading Gauge', true, 'call-1', true)
76+
act(() => vi.advanceTimersByTime(100))
77+
expect(show('Reading Gauge', true, 'call-1')).toBe('Reading Gauge')
78+
act(() => vi.advanceTimersByTime(300))
79+
expect(show('Read Gauge', false, 'call-1')).toBe('Reading Gauge')
80+
act(() => vi.advanceTimersByTime(700))
81+
expect(shown?.label).toBe('Read Gauge')
82+
})
7383
})

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export function usePacedActivity(
4646

4747
if (visible.resetKey !== resetKey) {
4848
setVisible({ activity, key, resetKey, placeholder, shownAt: Date.now() })
49+
} else if (key === visible.key && placeholder !== visible.placeholder) {
50+
// The same text now names the call itself (an activity title its description matches), so
51+
// it holds the header from here.
52+
setVisible({ ...visible, activity, placeholder, shownAt: Date.now() })
4953
}
5054

5155
useEffect(() => {

0 commit comments

Comments
 (0)