Add revert button to user messages
- Add revert icon (↶) button in message header for all user messages - Clicking revert button reverts session to that specific message - Restores the message text back to the prompt input - Style revert button with hover effects and border highlight - Revert action updates UI automatically via SSE session.updated event
This commit is contained in:
@@ -17,6 +17,7 @@ interface MessageStreamProps {
|
||||
diff?: string
|
||||
}
|
||||
loading?: boolean
|
||||
onRevert?: (messageId: string) => void
|
||||
}
|
||||
|
||||
interface DisplayItem {
|
||||
@@ -179,7 +180,12 @@ export default function MessageStream(props: MessageStreamProps) {
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<MessageItem message={item.data} messageInfo={item.messageInfo} isQueued={item.data.isQueued} />
|
||||
<MessageItem
|
||||
message={item.data}
|
||||
messageInfo={item.messageInfo}
|
||||
isQueued={item.data.isQueued}
|
||||
onRevert={props.onRevert}
|
||||
/>
|
||||
</Show>
|
||||
)
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user