Give each user message its own copy, reply and time

Two prompts sent close together (as while a bot is still answering)
shared one row under their group: every copy button bunched beside the
last message's time. Each user message now has its own row, with its
copy button, a new Reply button (once it is saved) and its own time.
copyableMessages is gone with the shared row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-27 07:40:22 +01:00
co-authored by Claude Opus 5.5
parent c75d3fe62c
commit 51fd4d5538
6 changed files with 47 additions and 61 deletions
@@ -0,0 +1,30 @@
import { useContext } from "react";
import { Reply } from "lucide-react";
import type { BotMessageWithAttachments } from "@/src/types";
import { BotMessageActionsContext } from "../(data)/message-actions-context";
import MessageActionButton from "./message-action-button";
type Props = {
message: BotMessageWithAttachments;
};
/**
* Reply to one of the user's own messages, beside its copy button. A
* message still on its way has only a temporary (negative) id, so it gets
* no button until the saved one replaces it.
*/
export default function UserMessageReply({ message }: Props) {
const { onReply } = useContext(BotMessageActionsContext);
if (!(Number(message.id) > 0)) return null;
return (
<MessageActionButton
title="Reply"
aria_label="Reply to this message"
onClick={() => onReply({ message })}
>
<Reply size={14} aria-hidden />
</MessageActionButton>
);
}