Skip to content

Commit 67c7f0f

Browse files
committed
refactor: remove unused conversationTitle prop from MessageHeader and MessageList components
1 parent 37218e7 commit 67c7f0f

File tree

5 files changed

+50
-63
lines changed

5 files changed

+50
-63
lines changed

src/components/chat/ChatInterface.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ export const ChatInterface: React.FC<ChatInterfaceProps> = ({
381381
messages={messages}
382382
isLoading={isLoading}
383383
isPendingNewConversation={pendingNewConversation || !sessionId.trim()}
384-
conversationTitle={currentConversation?.title}
385384
/>
386385

387386
<ApprovalDialog

src/components/chat/Message.tsx

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -68,63 +68,59 @@ export const Message = memo<MessageProps>(({
6868
data-message-role={normalized.role}
6969
data-message-timestamp={normalized.timestamp}
7070
>
71-
{/* Message Content */}
72-
<div className="w-full min-w-0">
73-
{/* Header */}
74-
<div className="flex items-center justify-between mb-1">
75-
<div className="flex items-center gap-2">
76-
{normalized.model && normalized.role === 'assistant' && (
77-
<span className="text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded">
78-
{normalized.model}
71+
{normalized.content.length !== 0 &&
72+
<div className="w-full min-w-0">
73+
{/* Header */}
74+
<div className="flex items-center justify-between mb-1">
75+
<div className="flex items-center gap-2">
76+
<span className="text-xs text-gray-500">
77+
{formatTime(normalized.timestamp)}
7978
</span>
80-
)}
81-
<span className="text-xs text-gray-500">
82-
{formatTime(normalized.timestamp)}
83-
</span>
79+
</div>
80+
81+
{/* Actions */}
82+
<div className="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
83+
<button
84+
onClick={handleCopy}
85+
className="p-1 hover:bg-gray-200 rounded transition-colors"
86+
title={copied ? "Copied!" : "Copy message"}
87+
>
88+
{copied ? (
89+
<Check className="w-4 h-4 text-green-600" />
90+
) : (
91+
<Copy className="w-4 h-4 text-gray-600" />
92+
)}
93+
</button>
94+
<MessageNoteActions
95+
messageId={normalized.id}
96+
messageContent={normalized.content}
97+
messageRole={normalized.role}
98+
timestamp={normalized.timestamp}
99+
selectedText={selectedText}
100+
/>
101+
</div>
84102
</div>
85-
86-
{/* Actions */}
87-
<div className="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
88-
<button
89-
onClick={handleCopy}
90-
className="p-1 hover:bg-gray-200 rounded transition-colors"
91-
title={copied ? "Copied!" : "Copy message"}
92-
>
93-
{copied ? (
94-
<Check className="w-4 h-4 text-green-600" />
103+
104+
{/* Content */}
105+
<div className={`relative rounded-lg border px-3 py-2 w-full min-w-0 max-w-full ${getMessageStyle(normalized.role)}`}>
106+
<div className="break-words overflow-wrap-anywhere min-w-0 max-w-full overflow-hidden">
107+
{normalized.isStreaming ? (
108+
<StreamingMessage
109+
message={{
110+
id: normalized.id,
111+
role: normalized.role as "user" | "assistant" | "system",
112+
content: normalized.content,
113+
timestamp: normalized.timestamp,
114+
isStreaming: normalized.isStreaming
115+
}}
116+
/>
95117
) : (
96-
<Copy className="w-4 h-4 text-gray-600" />
118+
<MarkdownRenderer content={normalized.content} />
97119
)}
98-
</button>
99-
<MessageNoteActions
100-
messageId={normalized.id}
101-
messageContent={normalized.content}
102-
messageRole={normalized.role}
103-
timestamp={normalized.timestamp}
104-
selectedText={selectedText}
105-
/>
106-
</div>
107-
</div>
108-
109-
{/* Content */}
110-
<div className={`relative rounded-lg border px-3 py-2 w-full min-w-0 max-w-full ${getMessageStyle(normalized.role)}`}>
111-
<div className="break-words overflow-wrap-anywhere min-w-0 max-w-full overflow-hidden">
112-
{normalized.isStreaming ? (
113-
<StreamingMessage
114-
message={{
115-
id: normalized.id,
116-
role: normalized.role as "user" | "assistant" | "system",
117-
content: normalized.content,
118-
timestamp: normalized.timestamp,
119-
isStreaming: normalized.isStreaming
120-
}}
121-
/>
122-
) : (
123-
<MarkdownRenderer content={normalized.content} />
124-
)}
120+
</div>
125121
</div>
126122
</div>
127-
</div>
123+
}
128124
</div>
129125
);
130126
});

src/components/chat/MessageHeader.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import { Folder } from 'lucide-react';
22

33
interface MessageHeaderProps {
44
workingDirectory?: string;
5-
conversationTitle?: string;
65
}
76

8-
export const MessageHeader = ({ workingDirectory, conversationTitle }: MessageHeaderProps) => {
7+
export const MessageHeader = ({ workingDirectory }: MessageHeaderProps) => {
98
if (!workingDirectory) {
109
return null;
1110
}
@@ -19,11 +18,6 @@ export const MessageHeader = ({ workingDirectory, conversationTitle }: MessageHe
1918
{workingDirectory}
2019
</span>
2120
</div>
22-
{conversationTitle && (
23-
<div className="mt-1 text-xs text-gray-500">
24-
{conversationTitle}
25-
</div>
26-
)}
2721
</div>
2822
);
2923
};

src/components/chat/MessageList.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ interface MessageListProps {
1515
className?: string;
1616
isLoading?: boolean;
1717
isPendingNewConversation?: boolean;
18-
conversationTitle?: string;
1918
}
2019

21-
export function MessageList({ messages, className = "", isLoading = false, isPendingNewConversation = false, conversationTitle }: MessageListProps) {
20+
export function MessageList({ messages, className = "", isLoading = false, isPendingNewConversation = false }: MessageListProps) {
2221
const messagesEndRef = useRef<HTMLDivElement>(null);
2322
const messagesContainerRef = useRef<HTMLDivElement>(null);
2423
const [showScrollButtons, setShowScrollButtons] = useState(false);
@@ -131,7 +130,6 @@ export function MessageList({ messages, className = "", isLoading = false, isPen
131130
{/* Message Header */}
132131
<MessageHeader
133132
workingDirectory={workingDirectory as string | undefined}
134-
conversationTitle={conversationTitle}
135133
/>
136134
{/* Single Text Selection Menu for all messages */}
137135
<TextSelectionMenu />

src/components/common/DebugInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const DebugInfo: React.FC<DebugInfoProps> = ({
1818
return (
1919
<div className="relative group">
2020
<div className="absolute top-0 right-0 p-2 text-xs text-gray-400 group-hover:text-gray-600">
21-
Debug Info
21+
Debug
2222
</div>
2323
<div className="hidden group-hover:block absolute top-6 right-0 z-10 p-2 bg-white border rounded shadow-lg text-xs text-gray-700 w-64">
2424
<div>

0 commit comments

Comments
 (0)