@@ -43,15 +58,41 @@ export function ChatMessageRow({
{name}
{formatTime(message.createdAt)}
+ {message.editedAt && !deleted && (edited)}
+ {canModify && !editing && (
+
+ setEditing(true)} />
+
+
+ )}
{slashInvocation && (
/{slashInvocation.command}
)}
-
- {renderBody(message.bodyMd, messageMentions, context)}
-
+ {deleted ? (
+
Message deleted
+ ) : editing ? (
+
+ ) : (
+
+ {renderBody(message.bodyMd, messageMentions, context)}
+
+ )}
{messageFiles.length > 0 && (
{messageFiles.map((file) => {
diff --git a/AgentCompany-New/src/renderer/src/pages/chat/ChatTimeline.tsx b/AgentCompany-New/src/renderer/src/pages/chat/ChatTimeline.tsx
index 19c5c188..29f84ee5 100644
--- a/AgentCompany-New/src/renderer/src/pages/chat/ChatTimeline.tsx
+++ b/AgentCompany-New/src/renderer/src/pages/chat/ChatTimeline.tsx
@@ -22,9 +22,12 @@ export function ChatTimeline({
slashInvocations,
files,
context,
+ currentEmployeeId,
onOpenThread,
onApprove,
onDecline,
+ onEditMessage,
+ onDeleteMessage,
}: {
rootMessages: ChatMessageRecord[];
messagesInSpace: ChatMessageRecord[];
@@ -35,9 +38,12 @@ export function ChatTimeline({
slashInvocations: ChatSlashInvocationRecord[];
files: FileObjectRecord[];
context: MessageContext;
+ currentEmployeeId: string;
onOpenThread: (threadId: string) => void;
onApprove: (approvalId: string) => void;
onDecline: (approvalId: string) => void;
+ onEditMessage: (messageId: string, bodyMd: string) => void;
+ onDeleteMessage: (messageId: string) => void;
}) {
const elements: ReactNode[] = [];
let lastDay = "";
@@ -62,6 +68,9 @@ export function ChatTimeline({
replyCount={replyCount}
onOpenThread={thread ? () => onOpenThread(thread.id) : null}
context={context}
+ canModify={message.senderType === "employee" && message.senderId === currentEmployeeId && !message.deletedAt}
+ onEdit={(bodyMd) => onEditMessage(message.id, bodyMd)}
+ onDelete={() => onDeleteMessage(message.id)}
/>,
);
});