From 18e8304f3fbb5b3e6f0eaf4567f03aebe90e069c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Mon, 15 Jun 2026 15:46:10 -0400 Subject: [PATCH] fix: generate canonical Comms search URLs --- src/lib/search-helpers.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/search-helpers.ts b/src/lib/search-helpers.ts index a5bd397..1263bd2 100644 --- a/src/lib/search-helpers.ts +++ b/src/lib/search-helpers.ts @@ -211,6 +211,7 @@ export async function runSearch( function buildSearchResultUrl( workspaceId: number, result: { + id: string type: string threadId?: string | null channelId?: string | null @@ -233,10 +234,17 @@ function buildSearchResultUrl( commentId: result.commentId, }) } + if (result.type === 'conversation') { + return getFullCommsURL({ workspaceId, conversationId: result.id }) + } if (result.type === 'message' && result.conversationId) { - return getFullCommsURL({ workspaceId, conversationId: result.conversationId }) + return getFullCommsURL({ + workspaceId, + conversationId: result.conversationId, + messageId: result.id, + }) } - return `https://comms.todoist.com/a/${workspaceId}` + return `https://comms.todoist.com/${workspaceId}` } type SearchOutputOptions = Pick