diff --git a/src/lib/search.ts b/src/lib/search.ts index bd23add..af0967a 100644 --- a/src/lib/search.ts +++ b/src/lib/search.ts @@ -87,5 +87,7 @@ export async function searchThreads(query: string): Promise { }), ); - return [...byThread.values()].sort((a, b) => b.createdAt - a.createdAt); + // Keep the relay's relevance order (arrival order); a thread keeps the + // position of its best-ranked match + return [...byThread.values()]; }