Skip to content

Commit bea81b2

Browse files
committed
chat: clean simple thread labels
1 parent 1a091a3 commit bea81b2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/packages/frontend/chat/chatroom.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ const THREAD_ITEM_LABEL_STYLE: React.CSSProperties = {
115115
overflow: "hidden",
116116
textOverflow: "ellipsis",
117117
whiteSpace: "nowrap",
118-
marginTop: "10px",
119118
pointerEvents: "none",
120119
} as const;
121120

@@ -127,6 +126,11 @@ export type ThreadMeta = ThreadListItem & {
127126
isAI: boolean;
128127
};
129128

129+
function stripHtml(value: string): string {
130+
if (!value) return "";
131+
return value.replace(/<[^>]*>/g, "");
132+
}
133+
130134
export interface ChatPanelProps {
131135
actions: ChatActions;
132136
project_id: string;
@@ -434,6 +438,7 @@ export function ChatPanel({
434438

435439
const renderThreadRow = (thread: ThreadMeta) => {
436440
const { key, displayLabel, hasCustomName, unreadCount, isAI } = thread;
441+
const plainLabel = stripHtml(displayLabel);
437442
const isHovered = hoveredThread === key;
438443
const showMenu = isHovered || selectedThreadKey === key;
439444
return {
@@ -452,7 +457,7 @@ export function ChatPanel({
452457
}
453458
>
454459
<Icon name={isAI ? "robot" : "users"} style={{ color: "#888" }} />
455-
<div style={THREAD_ITEM_LABEL_STYLE}>{displayLabel}</div>
460+
<div style={THREAD_ITEM_LABEL_STYLE}>{plainLabel}</div>
456461
{unreadCount > 0 && (
457462
<Badge
458463
count={unreadCount}
@@ -466,7 +471,7 @@ export function ChatPanel({
466471
)}
467472
{showMenu && (
468473
<Dropdown
469-
menu={threadMenuProps(key, displayLabel, hasCustomName)}
474+
menu={threadMenuProps(key, plainLabel, hasCustomName)}
470475
trigger={["click"]}
471476
>
472477
<Button

0 commit comments

Comments
 (0)