From 3712d695fc8295b8edc3d3a2c2ea725cb777dfd4 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 6 Mar 2026 08:57:10 +0200 Subject: [PATCH] Show original task names for recurring tasks in search results (#914) (#915) Recurring task templates had their names replaced with the recurrence type label (e.g. "Weekly") in search results, making them unrecognizable. Skip the display name transform when serializing tasks for search. --- backend/modules/search/service.js | 4 +++- backend/tests/integration/search.test.js | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/backend/modules/search/service.js b/backend/modules/search/service.js index 24ceaf1..b8e1a12 100644 --- a/backend/modules/search/service.js +++ b/backend/modules/search/service.js @@ -233,7 +233,9 @@ class SearchService { params.offset ); - const serializedTasks = await serializeTasks(tasks, timezone); + const serializedTasks = await serializeTasks(tasks, timezone, { + skipDisplayNameTransform: true, + }); return { count, diff --git a/backend/tests/integration/search.test.js b/backend/tests/integration/search.test.js index 69afb85..b41b107 100644 --- a/backend/tests/integration/search.test.js +++ b/backend/tests/integration/search.test.js @@ -731,6 +731,28 @@ describe('Universal Search Routes', () => { .filter((r) => r.type === 'Task') .map((task) => task.original_name || task.name); + it('should include recurring tasks in default search with their original names', async () => { + const response = await agent.get('/api/search').query({ + q: 'Recurring', + filters: 'Task', + }); + + expect(response.status).toBe(200); + const names = getTaskNames(response); + expect(names).toContain('Recurring Template'); + expect(names).toContain('Recurring Instance'); + + // Verify template shows original name, not recurrence type label + const template = response.body.results.find( + (r) => + r.type === 'Task' && + r.recurrence_type === 'weekly' && + !r.recurring_parent_id + ); + expect(template).toBeDefined(); + expect(template.name).toBe('Recurring Template'); + }); + it('should return only recurring tasks when extras contains recurring', async () => { const response = await agent.get('/api/search').query({ filters: 'Task',