Skip to content

Commit aba72b8

Browse files
committed
fix(ui): restore delayed animation, handle tilde fences, fix follow-up scroll root cause
1 parent 4f98438 commit aba72b8

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function MothershipChat({
176176
blocks={msg.contentBlocks || []}
177177
fallbackContent={msg.content}
178178
isStreaming={isThisStreaming}
179-
onOptionSelect={isLastMessage && !isStreamActive ? onSubmit : undefined}
179+
onOptionSelect={isLastMessage ? onSubmit : undefined}
180180
onWorkspaceResourceSelect={onWorkspaceResourceSelect}
181181
/>
182182
{!isThisStreaming && (msg.content || msg.contentBlocks?.length) && (

apps/sim/hooks/use-auto-scroll.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,7 @@ export function useAutoScroll(
117117
el.removeEventListener('scroll', onScroll)
118118
observer.disconnect()
119119
cancelAnimationFrame(rafIdRef.current)
120-
if (stickyRef.current) {
121-
scrollToBottom()
122-
const settled = new MutationObserver(() => scrollToBottom())
123-
settled.observe(el, { childList: true, subtree: true })
124-
setTimeout(() => settled.disconnect(), 300)
125-
}
120+
if (stickyRef.current) scrollToBottom()
126121
}
127122
}, [isStreaming, scrollToBottom])
128123

apps/sim/hooks/use-streaming-reveal.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ function findSafeSplitPoint(content: string): number {
1313
let i = 0
1414

1515
while (i < content.length) {
16-
if (content[i] === '`' && content[i + 1] === '`' && content[i + 2] === '`') {
16+
const isBacktickFence = content[i] === '`' && content[i + 1] === '`' && content[i + 2] === '`'
17+
const isTildeFence = content[i] === '~' && content[i + 1] === '~' && content[i + 2] === '~'
18+
19+
if (isBacktickFence || isTildeFence) {
1720
inCodeBlock = !inCodeBlock
1821
i += 3
1922
continue

apps/sim/tailwind.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export default {
223223
'placeholder-pulse': 'placeholder-pulse 1.5s ease-in-out infinite',
224224
'ring-pulse': 'ring-pulse 1.5s ease-in-out infinite',
225225
'stream-fade-in': 'stream-fade-in 300ms ease-out forwards',
226+
'stream-fade-in-delayed': 'stream-fade-in 300ms ease-out 1.5s forwards',
226227
'thinking-block': 'thinking-block 1.6s ease-in-out infinite',
227228
'slide-in-right': 'slide-in-right 350ms ease-out forwards',
228229
'slide-in-bottom': 'slide-in-bottom 400ms cubic-bezier(0.16, 1, 0.3, 1)',

0 commit comments

Comments
 (0)