Skip to content

Commit 7b22bcf

Browse files
Show recommendation buttons instead of push/PR buttons after setup script execution
- Filter out environment events when determining which suggestions to show - Environment events (like setup script execution) are infrastructure-related - Only show action suggestions (Push to Branch, etc.) when there are actual user/agent interactions - Show chat suggestions (recommendation buttons) when there are only environment events - Update posthog tracking to use userAgentEvents for consistency
1 parent 3505aeb commit 7b22bcf

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

frontend/src/components/features/chat/chat-interface.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,19 @@ export function ChatInterface() {
7777

7878
const events = parsedEvents.filter(shouldRenderEvent);
7979

80+
// Filter out environment events (like setup script execution) when determining
81+
// which suggestions to show. Environment events are setup/infrastructure related
82+
// and shouldn't trigger action suggestions like "Push to Branch"
83+
const userAgentEvents = events.filter(
84+
(event) => event.source !== "environment",
85+
);
86+
8087
const handleSendMessage = async (
8188
content: string,
8289
images: File[],
8390
files: File[],
8491
) => {
85-
if (events.length === 0) {
92+
if (userAgentEvents.length === 0) {
8693
posthog.capture("initial_query_submitted", {
8794
entry_point: getEntryPoint(
8895
selectedRepository !== null,
@@ -93,7 +100,7 @@ export function ChatInterface() {
93100
});
94101
} else {
95102
posthog.capture("user_message_sent", {
96-
session_message_count: events.length,
103+
session_message_count: userAgentEvents.length,
97104
current_message_length: content.length,
98105
});
99106
}
@@ -167,7 +174,7 @@ export function ChatInterface() {
167174
return (
168175
<ScrollProvider value={scrollProviderValue}>
169176
<div className="h-full flex flex-col justify-between">
170-
{events.length === 0 && !optimisticUserMessage && (
177+
{userAgentEvents.length === 0 && !optimisticUserMessage && (
171178
<ChatSuggestions onSuggestionsClick={setMessageToSend} />
172179
)}
173180

@@ -192,7 +199,7 @@ export function ChatInterface() {
192199
)}
193200

194201
{isWaitingForUserInput &&
195-
events.length > 0 &&
202+
userAgentEvents.length > 0 &&
196203
!optimisticUserMessage && (
197204
<ActionSuggestions
198205
onSuggestionsClick={(value) => handleSendMessage(value, [], [])}

0 commit comments

Comments
 (0)