Skip to content

Commit fce18a7

Browse files
committed
fix(search): polish inline action review interactions
1 parent 04272ac commit fce18a7

8 files changed

Lines changed: 600 additions & 70 deletions

File tree

‎apps/docs/content/docs/search/ask-questions.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ Copy the reviewed draft into another app, or ask Assistant to create it using yo
127127

128128
When integration actions are enabled, Assistant can answer questions and take supported actions in the same conversation. For example, ask it to draft an email in Gmail or create a Jira issue using your own connected account.
129129

130-
Reads run without a prompt by default. Writes wait for review by default. Each proposal appears inline in the conversation with its app, account, destination, and proposed content. Edit the supported fields, then select **Allow** or **Cancel** for each action. For several proposals, **Allow N shown** approves the actions currently displayed in the review.
130+
Reads run without a prompt by default. Writes wait for review by default. Each proposal appears inline in the conversation with its app, account, destination, and proposed content. Edit the supported fields, then select **Allow** or **Cancel** for each action. After several proposals, **Allow N shown** or **Cancel N shown** applies your choice to that displayed batch. You can approve individual actions first, then cancel the remaining batch.
131131

132132
<Image
133133
src="/static/search/assistant-action-review.png"
134134
alt="Inline Assistant action review showing the connected Jira account, exact site and project, editable issue summary and description, and Allow or Cancel controls"
135135
width={705}
136-
height={535}
136+
height={489}
137137
variant="detail"
138138
/>
139139

-1.62 KB
Loading

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,8 @@ interface MessageContentProps {
953953
* place without ever changing height.
954954
*/
955955
isLast?: boolean
956+
/** Pending review controls own the tail until the user decides. */
957+
awaitingInteraction?: boolean
956958
/** Transcript-derived answers for this message's question card (renders the recap). */
957959
questionAnswers?: string[]
958960
/** Transcript-derived status payload for this message's credential card. */
@@ -980,6 +982,7 @@ function MessageContentInner({
980982
requestMode,
981983
isStreaming = false,
982984
isLast = false,
985+
awaitingInteraction = false,
983986
questionAnswers,
984987
credentialSubmission,
985988
credentialAbandoned,
@@ -1082,7 +1085,8 @@ function MessageContentInner({
10821085
// trailing text keeps visually revealing on a timer after the network stream
10831086
// closes, and collapsing under a still-growing reveal reads as the blob
10841087
// winking out early while everything shifts.
1085-
const thinkingExpanded = phase !== 'settled' && lastSegment?.type !== 'stopped'
1088+
const thinkingExpanded =
1089+
!awaitingInteraction && phase !== 'settled' && lastSegment?.type !== 'stopped'
10861090

10871091
if (segments.length === 0 && !isLast) return null
10881092

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import {
2222
} from '@sim/emcn'
2323
import { useQueryClient } from '@tanstack/react-query'
2424
import { defaultRangeExtractor, type Range, useVirtualizer } from '@tanstack/react-virtual'
25-
import { AssistantActionReviewMessage } from '@/components/assistant-actions'
25+
import {
26+
AssistantActionReviewMessage,
27+
useHasAssistantActionReview,
28+
} from '@/components/assistant-actions'
2629
import { ComputerUseActivity } from '@/components/computer-use/activity'
2730
import { SMOOTH_CHASE_RATE } from '@/lib/core/utils/smooth-bottom-chase'
2831
import type { TurnOrigin } from '@/lib/mothership/generated/protocol'
@@ -282,6 +285,7 @@ const AssistantMessageRow = memo(function AssistantMessageRow({
282285
onOptionSelect,
283286
onAnimatingChange,
284287
}: AssistantMessageRowProps) {
288+
const hasActionReview = useHasAssistantActionReview()
285289
const permissions = useOptionalWorkspacePermissionsContext()
286290
const canEdit = permissions?.userPermissions.canEdit ?? false
287291
const blocks = message.contentBlocks ?? EMPTY_BLOCKS
@@ -325,15 +329,18 @@ const AssistantMessageRow = memo(function AssistantMessageRow({
325329
// Settle timing lives in MessageContent (the actions take the thinking
326330
// slot's place in the same render), so eligibility here is phase-free:
327331
// `phase: 'settled'` asks the helper "would a settled turn show them?".
328-
const actionsEligible = shouldShowAssistantMessageActions({
329-
phase: 'settled',
330-
hasContent: Boolean(message.content) || hasAnyBlocks,
331-
endsWithInteraction: endsWithQuestion || showsCredentialCard,
332-
questionDismissed,
333-
})
332+
const actionsEligible =
333+
!hasActionReview &&
334+
shouldShowAssistantMessageActions({
335+
phase: 'settled',
336+
hasContent: Boolean(message.content) || hasAnyBlocks,
337+
endsWithInteraction: endsWithQuestion || showsCredentialCard,
338+
questionDismissed,
339+
})
334340

335341
/** Match the 16px prose/card gap when the card is the message's last visible content. */
336-
const showsInteractionCard = (endsWithQuestion && !questionDismissed) || showsCredentialCard
342+
const showsInteractionCard =
343+
(endsWithQuestion && !questionDismissed) || showsCredentialCard || hasActionReview
337344

338345
return (
339346
<div className={cn(rowClassName, showsInteractionCard && 'pb-4')}>
@@ -345,6 +352,7 @@ const AssistantMessageRow = memo(function AssistantMessageRow({
345352
fallbackContent={message.content}
346353
isStreaming={isStreaming}
347354
isLast={isLast}
355+
awaitingInteraction={hasActionReview}
348356
questionAnswers={questionAnswers}
349357
credentialSubmission={credentialSubmission}
350358
credentialAbandoned={credentialAbandoned}

‎apps/sim/components/assistant-actions/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export {
22
AssistantActionReviewMessage,
33
AssistantActionReviewProvider,
44
AssistantActionReviewStatus,
5+
useHasAssistantActionReview,
56
} from './review'

0 commit comments

Comments
 (0)