Auto-refresh active sessions, collapsible skill categories, platform toolsets in config, search highlighting
This commit is contained in:
+11
-1
@@ -14,6 +14,12 @@ const PLATFORMS = [
|
||||
{ id: "web", label: "Web" },
|
||||
] as const;
|
||||
|
||||
function highlightMatch(text: string, query: string): string {
|
||||
if (!query) return text;
|
||||
const escaped = query.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
return text.replace(new RegExp("(" + escaped + ")", "gi"), '<mark style="background:var(--accent-dim);color:var(--accent);border-radius:2px;padding:0 2px">$1</mark>');
|
||||
}
|
||||
|
||||
export default function HistoryPage() {
|
||||
const [filter, setFilter] = useState<string | null>(null);
|
||||
const [query, setQuery] = useState("");
|
||||
@@ -68,7 +74,11 @@ export default function HistoryPage() {
|
||||
<div className="text-[12px] mb-0.5" style={{ color: "var(--text-2)" }}>
|
||||
{r.session_title || r.session_id.slice(0, 8)}
|
||||
</div>
|
||||
<p className="text-[13px] line-clamp-2" style={{ color: "var(--text-1)" }}>{r.content}</p>
|
||||
<p className="text-[13px] line-clamp-2" style={{ color: "var(--text-1)" }}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: highlightMatch(r.content, query),
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user