Skip to content

fix(deployed-chat): fix page crash on chat stream completion - #1892

Merged
Sg312 merged 1 commit into
stagingfrom
fix/deployed-chat-completion
Nov 11, 2025
Merged

fix(deployed-chat): fix page crash on chat stream completion#1892
Sg312 merged 1 commit into
stagingfrom
fix/deployed-chat-completion

Conversation

@Sg312

Copy link
Copy Markdown
Collaborator

Summary

Fixes page crash on chat stream completion

Type of Change

  • Bug fix

Testing

Manual

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Nov 11, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedNov 11, 2025 5:44pm

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Fixed page crash that occurred when chat stream completed by ensuring Tooltip.Root components have proper Tooltip.Provider context.

  • Refactored component from using early returns to a ternary operator pattern
  • Wrapped the entire rendered content in Tooltip.Provider to provide required context for tooltip components
  • The crash occurred because tooltips appeared when streaming finished (isStreaming: false), but had no provider context

Confidence Score: 5/5

  • Safe to merge - this is a straightforward bug fix with minimal risk
  • The change correctly addresses the root cause by adding the missing Tooltip.Provider wrapper. The refactoring from early returns to ternary operator is a well-established pattern and maintains identical functionality while enabling proper context wrapping.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/chat/components/message/message.tsx5/5Refactored to wrap tooltip components in Tooltip.Provider to prevent crash on stream completion

Sequence Diagram

sequenceDiagram
participant User
participant ChatComponent
participant ClientChatMessage
participant TooltipProvider
participant TooltipRoot
User->>ChatComponent: Send message
ChatComponent->>ClientChatMessage: Render message (isStreaming: true)
ClientChatMessage->>TooltipProvider: Wrap content
Note over ClientChatMessage: Copy button hidden during streaming
User->>ChatComponent: Stream completes
ChatComponent->>ClientChatMessage: Re-render (isStreaming: false)
ClientChatMessage->>TooltipProvider: Wrap content
ClientChatMessage->>TooltipRoot: Render copy button tooltip
TooltipRoot->>TooltipProvider: Access context
Note over TooltipProvider,TooltipRoot: Provider context available - no crash
TooltipRoot-->>User: Show copy button with tooltip
Loading

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@Sg312
Sg312 merged commit fc162ab into stagingNov 11, 2025
9 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/deployed-chat-completion branch November 11, 2025 18:24
@waleedlatif1waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Sg312