Skip to content

Commit 67592f3

Browse files
urmauurlouis-menlo
andauthored
🐛fix: avoid render html title thread (#5375)
* 🐛fix: avoid render html title thread * chore: minor bump - tokenjs for manual adding models --------- Co-authored-by: Louis <[email protected]>
1 parent 2239611 commit 67592f3

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

web-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"remark-math": "^6.0.0",
6666
"sonner": "^2.0.3",
6767
"tailwindcss": "^4.1.4",
68-
"token.js": "npm:[email protected].5",
68+
"token.js": "npm:[email protected].9",
6969
"tw-animate-css": "^1.2.7",
7070
"ulidx": "^2.4.1",
7171
"unified": "^11.0.5",

web-app/src/containers/DropdownModelProvider.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,9 @@ const DropdownModelProvider = ({
391391
)}
392392
>
393393
<div className="flex items-center gap-2 flex-1 min-w-0">
394-
<span
395-
className="truncate text-main-view-fg/80 text-sm"
396-
dangerouslySetInnerHTML={{
397-
__html:
398-
searchableModel.highlightedId ||
399-
searchableModel.model.id,
400-
}}
401-
/>
394+
<span className="truncate text-main-view-fg/80 text-sm">
395+
{searchableModel.model.id}
396+
</span>
402397

403398
<div className="flex-1"></div>
404399
{!isProd && capabilities.length > 0 && (

web-app/src/containers/ThreadList.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ const SortableItem = memo(({ thread }: { thread: Thread }) => {
101101
)}
102102
>
103103
<div className="py-1 pr-2 truncate">
104-
<span
105-
dangerouslySetInnerHTML={{ __html: thread.title || 'New Thread' }}
106-
/>
104+
<span>{thread.title || 'New Thread'}</span>
107105
</div>
108106
<div className="flex items-center">
109107
<DropdownMenu

web-app/src/hooks/useThreads.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { create } from 'zustand'
22
import { ulid } from 'ulidx'
33
import { createThread, deleteThread, updateThread } from '@/services/threads'
44
import { Fzf } from 'fzf'
5-
import { highlightFzfMatch } from '../utils/highlight'
5+
66
type ThreadState = {
77
threads: Record<string, Thread>
88
currentThreadId?: string
@@ -68,12 +68,10 @@ export const useThreads = create<ThreadState>()((set, get) => ({
6868
return fzfResults.map(
6969
(result: { item: Thread; positions: Set<number> }) => {
7070
const thread = result.item // Fzf stores the original item here
71-
// Ensure result.positions is an array, default to empty if undefined
72-
const positions = Array.from(result.positions) || []
73-
const highlightedTitle = highlightFzfMatch(thread.title, positions)
71+
7472
return {
7573
...thread,
76-
title: highlightedTitle, // Override title with highlighted version
74+
title: thread.title, // Override title with highlighted version
7775
}
7876
}
7977
)

0 commit comments

Comments
 (0)