Put a user message's copy button beside its timestamp

The copy button sat on its own row above the group's time, costing a
line of vertical space for nothing. It now shares that row, left of the
timestamp, the way a bot message's actions already do. A file-only
message leaves no gap: only messages with text get a button, picked by
copyableMessages.
This commit is contained in:
2026-10-22 12:33:48 +01:00
parent 08d02e6033
commit 133e6b87c9
5 changed files with 72 additions and 11 deletions
@@ -1,8 +1,6 @@
import { memo } from "react";
import Row from "@moduletrace/twui/layout/Row";
import Stack from "@moduletrace/twui/layout/Stack";
import type { BotMessageWithAttachments } from "@/src/types";
import CopyMessageButton from "./copy-message-button";
import MessageAttachments from "./message-attachments";
import MessageReactions from "./message-reactions";
import MessageReplyQuote from "./message-reply-quote";
@@ -17,7 +15,8 @@ type Props = {
* One user message: the quoted message it answers, its files, then its
* text (a file-only message has no bubble) and the bot's reactions to it.
* The user doesn't reply to or react to their own messages, but they can
* copy one. Memoized, like `BotMessageLine`.
* copy one: the group's copy buttons sit beside its timestamp, in
* `UserMessageGroup`. Memoized, like `BotMessageLine`.
*/
function UserMessage({ message, bot_name }: Props) {
return (
@@ -37,11 +36,6 @@ function UserMessage({ message, bot_name }: Props) {
reactions={message.reactions}
/>
) : null}
{message.text ? (
<Row className="gap-3! items-center">
<CopyMessageButton text={message.text} />
</Row>
) : null}
</Stack>
);
}